Updating or adding Javascript files without having to submit to appstores everytime

2 posts, 0 answers
  1. Carlos
    Carlos avatar
    69 posts
    Member since:
    Jun 2011

    Posted 08 Apr Link to this post

    We are trying to find a way to update our app and add features (such as modules, game levels, etc), without having to go through the appstore for every feature release or every level upgrade.  

    How we see this happening is items such as new game levels, simple features or HTML tweaks.  

    Something like, we would have our base app, THEN we want to know if the user wants to turn on a feature or get a new level, or if we want to provide a new section of our app but let the user opt in to getting it.  We would have our JS files out on our server and when if the user wants to add it to their app, the app would fetch the new feature (JS) file from our server, download it to the device in the file system and then the app would would read the new JS file and that feature would now be apart of the app.  This is an advantage to our user because we would not have to load all the features into one app and then release to the store and have the app be some huge 200mb app.  But instead let the user choose what features they want to add to their app.  

    I did some Googling and found someone had done this with the vanilla Phonegap projects, but I am wondering if we have the same access through an AppBuilder project. 

    Here is the post and how someone did this with their Phonegap project.



    In the StackOverflow question, the person who answer's the question recommends moving the WWW folder to NSDocumentDirectory, but since in AppBuilder we do not see or have a WWW folder, how would this work in an AppBuilder app?  Any suggestions, pointers, and code examples to get us on our way would be greatly appreciated.


    Thanks in advance.

  2. Martin Yankov
    Martin Yankov avatar
    177 posts

    Posted 13 Apr Link to this post

    Hi Carlos,

    First, let me explain that hybrid apps built with AppBuilder have a /www folder. All the files and folders that you see in the AppBuilder client are then packaged into it. If you build an app package, rename it to a .zip and extract it, you can find the /www folder. It's located in a different place depending on the platform. For Android apps it's in /assets/www. For iOS apps it's in Payload/CordovaXXX.app/www.

    That being said, the proposed solution in SO is suggesting you should modify the Cordova source files themselves. Telerik AppBuilder works with predefined stable and tested versions of Cordova for each platform and doesn't let you change the underlying source code. Any changes on the Cordova framework code can potentially break the whole framework and that is why we don't let you override the source code.

    Moreover, the suggested solution is quite old and sounds like something that breaks the application sandbox model. Several versions of iOS and Android have been released since then and I can't guarantee it will work even if you try to do this with the bare bones Cordova CLI.

    The common scenario with games and assets driven apps is that you don't have to update your source code. It's shouldn't be that big. You should have all the source code in the app and download all the necessary assets - images, data in the form of json, audio, video etc when the user wants to activate new stuff. You can easily download assets using the Cordova File plugin and then cache them in your app. Most big apps on the App Store are small and download huge amounts of assets on first startup.

    You can also check out the AppManager LiveSync feature that the Telerik Platform provides. It is available only for the Enterprise subscription level. It won't let you download chunks on demand, but it will let you update your front end code without the need to go through the store publishing process.

    I hope this information helps. If you have any questions I will be glad to answer them.

    Martin Yankov

    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

Back to Top