Forums

OverviewV-Play 2 Support (Qt 5) › Get data from outside of project

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #19023

    Daniel Tapia

    I would like to keep my API a secret.

    How do you get a string from outside your project and put into a string on a var?

    #19053

    Günther
    V-Play Team

    Hi Daniel!

    I’m not quite sure what you want to achieve. As mobile apps are packaged in a single app bundle, you can either

    • Include the settings/data directly in your app
    • Load settings/data from an external service (e.g. via  web requests to a REST service)

    Best,
    Günther

    #19058

    Daniel Tapia

    I would to be about to read a txt file from outside the project.

    #19064

    Günther
    V-Play Team

    I think the best solution would be to create a new QML component to handle your app and api settings.
    For example, the Qt World Summit app demo that comes with the SDK uses an AppSettings.qml file.

    The strings you configure this way are not publicly available when you publish the app, as you then set up the QML sources to be compiled with the app binary. For more information about publishing and protecting your source files see here: https://v-play.net/doc/vplay-publishing/

     

    Note: The above linked AppSettings.qml is a singleton (uses pragma Singleton keyword). It thus also requires a qmldir file with a singleton entry in the same directory. A Singleton type is then available throughout the whole application. You can then e.g. access the appKey setting everywhere in your code with:

    AppSettings.appKey

    Best,
    Günther

    #19140

    Daniel Tapia

    Thanks for the information! I will try that out.

Viewing 5 posts - 1 through 5 (of 5 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support