Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 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
    Felgo 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
    Felgo 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://felgo.com/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.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded