Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 3    Views: 215

delite
Lost but trying
Profile
Posts: 26
Reg: Sep 19, 2013
ireland
5,410
Fourm StarFourm Star
04/19/14 03:08 AM (8 years ago)

can anyone point me to useful forum topics on configuring data from an external URL

Hi, I am a complete end line user and have no programming skills period, I have made a test app just to try and play around with configuring a data file from an external URL I placed a link to a google doc in the ''Core'' parameter,I simply made an app that has two plugins,menu simple and sendSMS,I build the app on the buzztouch site so I could copy and paste the configuration data onto google docs,and was hoping to just use find and replace, to replace the title text of the menu simple plugin,and the titletext and innertext of SendSMS,whilst keeping all the Item ID's the same, when my app loads it just loads a blank homescreen on further inspection I see their is also a parameter to load data from URL in the Homescreen parameter so as a test I removed everything on the google doc file except the child items for menu simple,uploaded that doc to buzztouch,app still only loads a blank screen saying home screen what really confuses me is how the app even knows to load homescreen,if it cant read the rest of the data, thanks for any help as usual,really appreciate it
 
delite
Lost but trying
Profile
Posts: 26
Reg: Sep 19, 2013
ireland
5,410
Fourm StarFourm Star
like
04/19/14 03:44 AM (8 years ago)
forgot to mention the label at the top of the blank screen says ''Home'' not ''Homescreen'' so I cant figure where it even got that name from! I have realised the JSON snippet keeper will probably do the job,so I have purchased it and I am watch the youtube tutorials! fingers crossed
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
Fourm StarFourm StarFourm Star
like
04/19/14 06:57 AM (8 years ago)
There's a good chance that the app can't read the file from Google Drive. Sometimes file storage sites like those add a bunch of extra stuff, such as a web page around your document so it's easy for a user to 'click download'. The app can only look at the file itself, though, and *anything* extra will cause it to fail. When this happens, the app will silently use the BT_Config.txt file that gets downloaded from buzztouch.com when you downloaded your app project. Thus, it has something to look at, even if it's an outdated version of your app. Take a look at your debug output. Somewhere near the top when you first launch the app it will say it is trying to retrieve data from the dataURL. It will tell you which URL it is looking at and whether it succeeded.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
Fourm StarFourm StarFourm Star
like
04/19/14 10:58 AM (8 years ago)
You can use dataURL only if it exists in the control panel of the plugin. You can use it with the Menu Simple and you cannot use it with sendSMS, the former has dataURL as its parameter, the latter doesn't. Also, dataURL should only contain the data that the plugin developer intended it to. It is not meant for the entire JSON configuration data. In the ideal case -- create one Menu Simple, -- put it in the Layout section as the first screen that the app will start with, -- create the textual dataURL on some Internet server and -- put the address of that file in the dataURL field. The text file on the server should conform to the documentation for the plugin. For instance, here is what I copy directly from the documentation of the Menu Simple: ============ If you provide menu item data from a remote file there is no childItems array in the screen definition in the BT_config.txt file. Instead, the menu items are pulled from a remote file. { "itemId":"1111", "itemType":"BT_screen_menuListSimple", "navBarTitleText":"My Simple Menu", "dataURL":"http://www.domain.com/theMenuItemData.php" } In this case the menu items would come from a backend script at the dataURL. Loading the dataURL in your browser would produce output like this.... { "childItems":[ { "itemId":"menu_1", "itemType":"BT_menuItem", "titleText":"This is row 1", "loadScreenWithItemId":"1234" }, { "itemId":"menu_2", "itemType":"BT_menuItem", "titleText":"This is row 2", "loadScreenWithItemId":"5678" }, { "itemId":"menu_3", "itemType":"BT_menuItem", "titleText":"This is row 3", "loadScreenWithItemId":"2948" } ] } ============= It is of crucial importance to count the brackets, parentheses and other delimiters, for each one that you open, there should be one that you close. The example above would define a simple menu with options This is row 1 This is row 2 This is row 3 and for that to be really useful, you should have also had defined screens that will load after the option from the menu were pressed. Here those would be screens with itemIds 1234, 5678, and 2948. When you create a text file on an Internet server, load that address directly into the browser address bar; if it shows the text with the JSON in the browser, it will also load into the app; otherwise, it will not.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.