Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 33    Views: 128

Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
05/29/12 06:19 PM (13 years ago)

Possible to include List Menu config as file?

In the List Menu options (v1.5), there is an option for config data URL. Has anyone been able to use an included file (copied into the app) instead of a remote file (URL)? Before I start hacking away at the code to do so, I just wanted to see if anyone else has already done it. Thanks!
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
05/29/12 06:41 PM (13 years ago)
hey stobe, not that i have heard, but i am interested on what you can come up with, did you ever figure out how to make list menus with screens to work integrated into buzztouch like you did with the csv2json?
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/29/12 06:59 PM (13 years ago)
Yes, my latest tool is complete, but I was hoping to add this in as a bonus. As it stands, you can take the output from my (soon to be released) tool and host it (dropbox, etc). Or you can copy/paste it into the BT_Config.txt as childItems (a little more complex if you're not used to it). But what I'd really like to do is include the output from my tool (which is a txt file of the JSON childitems) and included it like you can an image vs a image URL. Probably a question for @David, but thought I'd ask around here as well.
 
ceerup
Code is Art
Profile
Posts: 1033
Reg: Oct 10, 2011
New York City
16,380
like
05/29/12 07:00 PM (13 years ago)
yea so far i didnt see nothing yet about it, i been lurking around, but someone else might know more than me. whens your tool going to be available? im ready to purchase it! lol
 
Arubaman
Aspiring developer
Profile
Posts: 636
Reg: Oct 20, 2011
Akron
16,910
like
05/29/12 07:04 PM (13 years ago)
file://path/ not sure if this would work or not
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/29/12 07:10 PM (13 years ago)
@Arubaman: Tried that first, lol. Made sense to me, but I don't think BT liked it :)
 
Arubaman
Aspiring developer
Profile
Posts: 636
Reg: Oct 20, 2011
Akron
16,910
like
05/29/12 07:15 PM (13 years ago)
Ive seen changing a url to a uri but not sure of the exact structure to make it work
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/29/12 08:25 PM (13 years ago)
In my guide a few days ago I add a detail examination in the Config file. In this particular app a menu screen was created with two menu items. The Config file was modified with a text editor and two items were added. A menu row item adding a Custom URL webpage screen with the nickname of Google. A second object was add creating the the actual screen. By reviewing said article you'll easily understand how to create any screen or action. Plus in conjunction with my using plugin files directly in the source code when a plugin has not been installed on the control panel you should understand how to play with the Config file to your hearts content. Fred www.MySkylla.com
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/29/12 08:31 PM (13 years ago)
ROFL ^^^^ Not sure you understood the question. It is far beyond modifying anything in the config. Has to be done in the source, as the existing source only allows for URL downloaded childitems, cached childitems, or childitems added in the control panel (config.txt items). The later of which is what I am trying to circumvent.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/29/12 09:27 PM (13 years ago)
Hi @stobe, Are you saying that your tool can create a Menu List and attached screens to that list all via JSON? I've been trying to do that as well, and the Menu List part is easy enough. But the rub is trying to create screens attached to that Menu List using the SAME JSON file. I was trying that, and @David finally told me it can't work, because the screens have to exist "before" the Menu List is created. Make sense? So, I'm excited if you've found a way, in a single JSON file, to create a Menu List and the screens that a user would get when they tap the item! Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/29/12 09:35 PM (13 years ago)
@Mark, you can do so in a single JSON file, unfortunately for what you're trying to accomplish, it's called the Config file. The only way to used said modified Config file is to self-host say on Dropbox. Fred
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/29/12 09:43 PM (13 years ago)
Mark, That's the gist of it. Basically, there are 3 parts to the tool finished. I'm just doing my initial documentation of their usage, as usual (which is my least favorite part, lol). The 3 parts ready now are: 1. Phone Tree - Creates a list menu, with each list item leading to another list menu containing up to 3 items (home, office, cell, etc), which all lead to "Call Me" screens with the correct phone number included. 2. App List Menu - Similar to my "AppListMaker", but this creates a nice looking list menu containing the name of the app, the app icon, and each item leads to a itunes store/linkshare screen (which prompts to open iTunes on the device). I use one of these screens in each app for my clients as a "Other Apps By..." screen. I use the "AppListMaker" tool to also create a "Recommended Apps" screen for each app. That way my clients get 2 avenues of linkshare income, plus cross-promotion of their own apps. 3. Video List Menu - Creates a list menu, with each list item leading to a "Streaming Video" screen. Might not sound like much, but when your client hands you 70+ videos to put in an app, its a life saver! (See my Tuff n Muddy app) I plan to include a HTML Doc List Menu as well for those apps that have a ton of list menus and docs (to save on screens, and speed up development). I know I just hijacked my own thread - but you asked, lol :)
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/29/12 09:48 PM (13 years ago)
@Fred - you confuse me more and more each time you type, lol. You don't need to self host a config file to modify it. @Mark, keep your eyes on me - don't be tempted to stare into the wooden bear's eyes. They may mesmerize you!
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/29/12 09:55 PM (13 years ago)
PM coming your way!
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/29/12 10:05 PM (13 years ago)
You don't need to self host a config file to modify it. If you modify the Config file and wish for the app to use an Online config file my understanding is that you must self-host the Online config file. Am I correct or not? Open to being wrong, but don't think I am. Fred
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/29/12 10:13 PM (13 years ago)
yes, "if you wish for the app to use an online config file" which is not the case for this thread.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/29/12 10:15 PM (13 years ago)
If you don't configure your Configuration Data URL to point to buzztouch.com, which is the default, or to your Self-Hosted server, then it must be located somewhere that is accessible on the Internet. Could be a web site, DropBox, SugarSync, Cubby...anywhere that the file can be accessed via a URL. Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/29/12 10:18 PM (13 years ago)
But it is, you're trying (and I hope you're successful) to host the JSON file in the app.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/29/12 10:25 PM (13 years ago)
What I'm trying to do, for a Menu List, is to host the JSON that defines that menu list, along with the screens each menu item loads, in a JSON file that is located at a place I specify in the Data URL field for the Menu List screen.
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/29/12 10:31 PM (13 years ago)
I think we're all confusing Fred. What Mark wants to do and what I was initially asking about are two separate things. Mark's is easily doable (especially with my nifty tool - coming soon, lol - shameless plug) Mine requires some hefty modification of the buzztouch source files.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/29/12 10:33 PM (13 years ago)
Mark, that's not possible with Buzztouch because the screen (a JSON object) referenced by the JSON object (the menu) is not part of the value pair that defines the menu. That's what David meant when he said the screen must exist prior to the menu item calling it. Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/29/12 10:34 PM (13 years ago)
Ha! Perhaps I should read the original post before I go throwing in my comments! I've wondered about the local JSON file as well. Seems like it should be doable, so long as you can tell the code where to find the file. That would certainly require source file modification. Mark
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/29/12 10:41 PM (13 years ago)
If I'm not mistaken, I believe Fred just called me a liar :) (indirectly) So I'll throw it right back and say "Fred, it is possible" - I do it all the time, and its what my tools do for me so I don't have to anymore. With that, I'm going to bed....
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/29/12 10:48 PM (13 years ago)
I know you're not understanding my point, but the solution is not in the Source Code. Unless you wish to create a app within an an app. Sort of what a HTML screen does when it references a HTML doc. (Think HTML doc as a embedded web app) But the original post was how to host the JSON file within the app, so I would think the solution would be to treat the app as a server. Fred
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/29/12 10:57 PM (13 years ago)
If I'm not mistaken, I believe Fred just called me a liar :) (indirectly) You are mistaken, in fact I agreed with you: As it stands, you can take the output from my (soon to be released) tool and host it (dropbox, etc). Or you can copy/paste it into the BT_Config.txt as childItems (a little more complex if you're not used to it). Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/29/12 11:04 PM (13 years ago)
Actually, the solution is indeed in the source code. Here's the scenario: * User wants to use the Data URL to populate a Menu List. That currently involves pointing to a JSON file residing at a URL somewhere (a URL implies the file is not bundled with the app, but has to be pulled from the network). * The BT_screen_menuList.m has the following logic in it (this is for iOS): Screen Data scenarios -------------------------------- a) No dataURL is provided in the screen data - use the info configured in the app's configuration file b) A dataURL is provided, download now if we don't have a cache, else, download on refresh. As you can see, either the information comes from the BT_Config.txt file, or from a URL. So, the code expects one or the other. * If we want to include the data file for that menu in a file that we bundle with the app...say in a folder called BT_JSON, then we would have to modify the logic of the code to include looking in that folder if the first two tests fail. So, indeed, new code would have to be written to support reference to a JSON data file, one that is not BT_Config.txt, that would be included directly with the app itself. Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/29/12 11:11 PM (13 years ago)
* User wants to use the Data URL to populate a Menu List. That currently involves pointing to a JSON file residing at a URL somewhere (a URL implies the file is not bundled with the app, but has to be pulled from the network). That's what the assets folder vs the resource folder is about. The items in the assets folder are not compiled, they a simply packaged into the zip file. As I said you wish to host the JSON data on the app. It's possible via the assets folder. Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/29/12 11:36 PM (13 years ago)
I think we're talking about different things. Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/30/12 12:16 AM (13 years ago)
Figured out perhaps why the URL is not working for the embedded JSON file. First the file must be in the assets folder or it’ll be compiled into unreadable binary data if placed in the res folder. Second, the URL is not treating the file as text data. It's just looking at the file and treating it as an image, something to be seen, but not read. Just as the Native browser must be used sometimes and not the HTML doc via URL when accessing certain files. Similar to accessing a word doc with a Custom URL vs the word doc screen URL. If you use the Custom URL webpage (notice this very important word that's overlooked by everyone "webpage"), the word doc will not be downloaded, instead it's treated as a webpage to view. Well there in lies the solution to the original post.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/30/12 12:21 AM (13 years ago)
If the JSON file had the extension of. HTML instead of .txt, perhaps.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/31/12 07:42 AM (13 years ago)
Perhaps: The correct url is: file:///android_asset/RELATIVEPATH http://stackoverflow.com/questions/4820816/how-to-get-uri-from-an-asset-file#comment5347018_4820905 Fred
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
05/31/12 07:48 AM (13 years ago)
I thought I specified before, but it looks like I didn't. If it comes to modifying source, I will be sticking with iOS (as per my usual)
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/31/12 08:05 AM (13 years ago)
Thanks for not specifying previously, it led me to Android solution. I'll leave the iOS solution to another.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
05/31/12 08:08 AM (13 years ago)
 

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.