Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 14    Views: 112

ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
05/22/12 06:07 PM (13 years ago)

BT_Config question

So as most of you know ive been having trouble with JSON ive read every guide on here and i dont quite get how to mix buzztouchs menu list with extra menu lists I looked in the BT Config and was wondering why i cant add other things to it without the emulator saying that somethings wrong with the bt config file. is it because its not the same as the one in the control panel? i know all the syntax was correct so that wasnt an issue Can i make my own random item ID numbers? and where do these numbers get referenced? Is there something i have to change in one of the java classes? do i have to make my own java class? I have been testing out everything and nothing works
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/22/12 06:51 PM (13 years ago)
Hi Cono, First step is to make sure you've created properly formatted JSON. You can do that by going to jsonlint.com and plugging in your code. It'll tell you if it's good or not, and what needs to be fixed. Then, in, for example, the Menu List screen, where it asks for a data file, you would point to the JSON file you have created and placed somewhere like DropBox. You can make you own random ID numbers. They get referenced in the JSON you create. So, if you create a Menu List, and it says loadItem=XXCCFF, you need to make sure you have another JSON object that has the XXCCFF ID, so that way the menu knows what to load. You don't have to touch Java at all. Buzztouch has done that for you! It's pretty difficult to get something to work. Best thing to do is look at a BT_Config.txt file for an app you know has the features you want, and then basically duplicate the sections you need, using different item IDs. Mark
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
05/22/12 06:54 PM (13 years ago)
Hello Mark, thanks for the reply! When you say the menu list screen, where it asks for the data file...where is that?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/22/12 06:57 PM (13 years ago)
Go into your Control Panel, select (or create) a menu list. Then go into Advanced Properties...Screen Data URL. There you can link to the JSON that would get imported to create the screens. Mark
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/22/12 07:32 PM (13 years ago)
Are you trying to modify the BT_config.txt in xCode (or eclipse)? If so, as soon as you launch the emulator, you run the chance of the dataURL taking over and overwriting what you tried to modify in the compiler. Whenever I want to mess around with JSON manually, I always either hotlink the file I'm playing with to the app, or cut ties with BT's dataURL and hard code it in the compiler. I can assure you that you can in fact add, subtract, multiply, nest, etc JSON parameters in the config file and get great results. (I just created triple nested list menus with my latest tool - coming soon!) (Shameless plug)
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
05/22/12 07:41 PM (13 years ago)
@Mark, but since id be using the control panel wouldnt that consist as using a screen? or are we talking multiple screens for that 1 screen data url @Stobe, im on eclipse. Yea let me know when the tool comes out, i sent you a PM if its possible to make a tool like that. Thanks guys
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/22/12 07:55 PM (13 years ago)
@Stobe's tools rock! I'd suggest using them if you can. In the Menu List example, you would only be creating one screen - the base Menu List screen - and any linked screens would be created with the JSON file you create. So, you could create 1000 screens using JSON, have it linked to a single control panel screen via the Screen Data URL, and you're only docked one screen! The downside is that you obviously can't adjust the JSON screens using the control panel...you have to do it by hand using your JSON text file. Mark
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/22/12 07:57 PM (13 years ago)
The first person who wants to create a 1000 page menu list using one of my tools can win a free copy! lol. I'll screencast the creation to demonstrate the true power of JSON!
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
05/22/12 07:59 PM (13 years ago)
Okay so the JSON is going to be a text file in my eclipse just like bt_config is, and i reference that JSON to the Screen Data URL in the Control Panel, and the JSON is going to pull my stuff out of dropbox? If i read this correctly
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/22/12 08:01 PM (13 years ago)
You create a text file that has properly formatted JSON in it, that creates the screens you want, and you store it somewhere like DropBox. You link it to your BT_Config.txt file in the appropriate section of the Control Panel. When your app opens up and starts processing the BT_Config file to create screens, it sees that some of the data resides on an external text file. It goes out, reads that file, processes the information, then continues along with the BT_Config file. Mark
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/22/12 08:04 PM (13 years ago)
You can also manually include it in your config file (copy/paste). But linking it to dropbox allows you to edit/update it later without re-compiling.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/22/12 08:05 PM (13 years ago)
True, but that would only work if you have your app pointed to a config file somewhere other than buzztouch. Because if you edit the config, then cause a refresh, it'll replace that config file with the current one on the server. It absolutely can be done, but a person needs to understand all the scenarios. Mark
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
05/22/12 08:07 PM (13 years ago)
Ohhh i kind of get it now Mark, Plus that doc you sent is making it seem simpler also so im starting to put pieces together. @Stobe How do i do that in the config file? i tried and it wouldnt let me, it kept saying something was wrong wit my config file in eclipse emulator
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/22/12 08:08 PM (13 years ago)
For sure. No need to confuse an already confusing subject. I'm used to deleting my dataURL before submission so that my xCode project is self-supporting.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/22/12 08:09 PM (13 years ago)
@ceerup working with the JSON format in the BT_config file is almost an art form :) If you miss a quote or comma or curly brace, it will render the whole file bad.
 

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.