Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 7    Views: 51

bobisback
Code is Art
Profile
Posts: 24
Reg: Sep 22, 2012
Pensacola
1,540
11/02/12 06:30 PM (13 years ago)

Using buzz touch screens during runtime?

Is it possible to programmatically call a buzz touch screen at runtime and fill it with information that is collected during run time? edit: I guess the better question would be is this worth doing? I am sure most things our possible with programming. Example I could(theoretically) get a bunch of info from the user on one screen and save it internally, and then they hit done and it opens another screen that displays it using a buzz touch menu button screen as a list. I think I got my point across but if you need any more info/explanation let me no. Thanks, Bob
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
11/02/12 06:49 PM (13 years ago)
Hi @bobisback, Welcome to buzztouch! This could certainly be done using buzztouch, but it would require modification of the current code. Basically, I think what you want to do is save the information to a local file, and then query that info and build the menu list based on it. The screens in buzztouch aren't currently set up to do that by default, or even easily, but with some programming, it could be done. buzztouch provides a great base to build this on! Mark
 
bobisback
Code is Art
Profile
Posts: 24
Reg: Sep 22, 2012
Pensacola
1,540
like
11/02/12 07:00 PM (13 years ago)
Thats what I figured just by looking at the code. So i guess the real issue here is weather it is easier to just make my own screen or figure out how to store the data as JSON. Based off of the code I am guessing this is what buzztouch is doing, storing the information in a JSON file and then the program interprets that information and builds screens out of it.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
11/02/12 09:47 PM (13 years ago)
Yep, that would be a good way of approaching it. JSON is indeed interpreted by the class files for that screen, and the resulting screen is presented to the user. If you look in the How-To section of the site, there's a guide to buzztouch v1.5, most of which holds for v2.0. It'll give you a good start on the JSON. Mark
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
11/03/12 01:56 AM (13 years ago)
You can programmatically create screens - easily. This is a common approach for loading screens that are NOT included in the JSON data in advance. Dynamic. Example: //create JSON string for dynamic customURL screen... NSString *JSONdata = @"{\"itemId\":\"99999\", \"itemType\":\"BT_screen_customURL\", \"dataURL\":\"http://www.google.com\"}"; //dictionary for new screen.. NSDictionary *screenDictionary = [JSONdata JSONValue]; BT_item *nextScreen = [[BT_item alloc] init]; nextScreen.itemId = @"9999999"; nextScreen.itemType = @"BT_screen_customURL"; nextScreen.jsonVars = screenDictionary; //next, load the screen using the built in method in the BT_viewControllerManager class [BT_viewControllerManager handleTapToLoadScreen:self.screenData:nil:nextScreen]; Tons of other ways to do it :-)
 
0z2000tv
Aspiring developer
Profile
Posts: 315
Reg: Sep 10, 2011
Nashville
11,950
like
11/03/12 07:04 AM (13 years ago)
I use a tool / Plug in that Stobe sells to created a menu screen of 35 pdfs using a list of Titles and URL's to the PDF on Dropbox. . When you tap a menu item a screen opens with all of the attributes you selected. Mike
 
bobisback
Code is Art
Profile
Posts: 24
Reg: Sep 22, 2012
Pensacola
1,540
like
11/03/12 07:51 AM (13 years ago)
Sweet, that does look alot easier then I thought, so my next question would be: How would we display the data that we get on the screen once it is called. Is this another JSON thing or is this more like calling a function passing it the data as a string? I have not done any research on the subject so sorry if this sounds like a stupid question.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
11/05/12 11:10 PM (13 years ago)
@bobisback: No questions are stupid - really. Legit questions are welcome. So...I'm not totally sure what you're referring to when you say "display data on the screen" I guess it depends! Ha, like everything else, right. Lets say you have a UITextField in your code named myTextView. You may have added this to a view with Interface Builder, in Objective C in Xcode, whatever. Just a text box. Next, lets say you want to show some data from your screens JSON in the text box. In most cases, it's... //Create a variable of type NSString to hold the data. NSString *myData = [BT_strings getJsonPropertyValue:self.screenData.jsonVars:@"nameOfJsonKey":@"default value if not found"]; //myData holds the value from the json data...add it to the text view... [myTextView setText:myData]; As long as you have the BT_strings.h file included at the top of your code (with all the other includes) you'll be off to the races.
 

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.