Discussion Forums  >  Maps, Device Location, Tracking

Replies: 30    Views: 161

UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
04/23/12 01:27 PM (13 years ago)

Building BT_config.txt through other means

I'm building a 99¢ Map App, of things to do in world geographical regions, for tourists. E.g. I'm in Europe. technically 26 countries make up the EU travel region (Schengen), but slice off the Eastern bloc, and it's about 15. Each country has 1-15 cities, and each city has 3-4 categories. Using the BT click and click and click set up method, would be horrendously painful. I did that for 2 Countries > 2 Cities > 4 categories, and studied the BT_config.txt file. (Not to mention on-going maintenance of adding new locations, and dropping closed.) I could build that outside of BT, using PHP, from my spreadsheet of countries, cities, categories, in a snap. It's exactly like what I do to make Google Maps of my travels. I even do the Lat/Lng geocoding. Has any one else done something like this? My concern is the id=hex string identifying the screens. Can we users create that ourselves - following a protocol? Is something like this needing to be done outside of BT? I'm nervous about the Self Hosted thing @ $30/month, this early in the game. I am in contact with a bright user here who does some of what I am thinking I should do, but only with a handful of screens, that he creates in BT and then pastes in additional map locations. That's doable for him, but I'm looking to create the whole text file via a PHP script, day one and monthly maintenance. Thanks in advance...
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/23/12 01:35 PM (13 years ago)
I will be experimenting with suggestions in http://www.buzztouch.com/docs/v1.5/child_locationItems.php Thanks,
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/23/12 01:54 PM (13 years ago)
This is the config data for a screen that links to an embedded HTML Doc. {"itemNickname":"HTML Doc Embeded", "itemId":"5B0594E4306DD315CE27ADE", "itemType":"BT_screen_webView", "localFileName":"fredssample.html", "navBarTitleText":"HTML Doc Embeded", "hideFromSearch":"0", "includeAds":"0", "XdComm":"undefined" }, The itemNickname and navBarTitleText would be edited. Good question about the itemid. itemType would be unchanged. localFileName set accordingly. The last three items set according to desire. Fred
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/23/12 02:11 PM (13 years ago)
The only requirement for that property is that the ID is truly unique and only used for that 1 item. How that ID is created is up to you, so long as the former requirement is true. Per Parker from previous post. My question is does the id need to be unique to: All items in the app. Yes All items in the users account? I would think not if the config file is not on the Control Panel. All items on the Server hosting BTv2.0? Same as above. Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/23/12 02:11 PM (13 years ago)
itemID can be whatever you want. It can be as complex as what BT uses, or as simple a 1, 2, 3! As long as you correctly reference it later, when you want to use that item, then it's all good! itemType needs to follow the convention found in the v1.5 Users Guide that you referenced above. Using the JSON file, you can code your entire app using a remote host for the data. You point your app to a Configuration URL that exists elsewhere, and it won't count against your app views when the user opens the app. The BT_Config.txt file drives the appears and content of the whole app, passing it's variables into the appropriate Java or Objective C files. Mark
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/23/12 02:16 PM (13 years ago)
If I would figure out how to 'point' something to something (that's all still little vague), does that mean when I update the map list every month, the user would not need to download the App update? I get tired of typing my Apple ID everyday an App gets an update.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/23/12 02:21 PM (13 years ago)
Hi, For a list of map points, you can easily create a JSON file that contains all the information needed to create the map, the pins, and the screens that the pins connect to (if any). That file can be hosted somewhere like DropBox, and you configure the Multiple Location Screen to grab it's data from that file...you provide the screen with a URL to the file. From that point forward, to update the list of locations, you just update the JSON file, and the next time the user loads the app (or that screen), then they receive the new locations. No need to submit an update to Apple at all. You an even configure the Multiple Location Screen to force refresh each time it's loaded, to make sure you user gets all the latest points. Does that make sense? Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/23/12 02:25 PM (13 years ago)
Pointing short for changing the URL that's in the config file.
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/23/12 02:27 PM (13 years ago)
Yes, considering I've been doing html since 1995 and PHP since 2005, I get the concept in theory. I call it BT_config.txt. Is that what you call "the JSON file"? So my App would be one screen calling the URL in the background, and the URL is the BT_config.txt file on a web server, updated as needed? That would be great. I host a bunch of websites on a web host in Denmark. Can I host the file there, or would I need to use a specific Cloud host?
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/23/12 02:30 PM (13 years ago)
Can I then test it from my desktop, iPhone and iPad (3)? I'm still a little fuzzy about if I can put my App in progress on my own iPad and iPhone, before going all the way to the App store process.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/23/12 02:33 PM (13 years ago)
Regarding updates. There are several types of updates. Update of the apps .apk or .ipa file typically done via publishing an update to the respective app store. Update of the config file. Controlled via Control Panel. Updates of resources via URL. FRED
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/23/12 02:36 PM (13 years ago)
For iOS you would need to go through the App Store or jailbreak if you wish for the device not to be connected to the computer. Any server will do for hosting of config file.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/23/12 02:37 PM (13 years ago)
BT_Config.txt is composed of JSON data. Most screens in buzztouch have a way for you to provide the screen data via JSON from a URL. Those files can be hosted anywhere that the app can access...a web server, DropBox public link..whatever. So long as a browser can access it, so can the app. You can have the entire BT_Config.txt file hosted off buzztouch.com, or just parts of it, on a screen-by-screen basis. Yep, you can install your app on you iDevice, using the Developer Certificate. Read through some of the material in the Apple Developer Center...it gives guidance on that. You basically configure Xcode to recognize your device by the UUID, then instead of compiling for the simulator, you compile for your device. But it does require development certificates. Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/23/12 02:44 PM (13 years ago)
BT_config.txt Information about how the application looks, the layout it uses, and it's overall functionality is saved in one main configuration file, BT_config.txt. This is a plain text file organized in JSON format. This file can be edited using the buzztouch control panel or it can be edited manually with any text editor. In short the config file is a JSON file, but Mark indicated you can use a JSON file to extend individual screens. So a JSON file could be your map locations. Fred
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/23/12 03:07 PM (13 years ago)
I'm going to try to write a PHP script, that reads my .csv file, (Country, City, Category, location Map data address, Lat, Lng) and creates the hierarchy of screens: Country > City > Category Map. The App itself would be the default.png and one screen that points to the URL where the hierarchy of screens and Country > City > Category data would exist, then. I'll work on that tomorrow CET.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/23/12 03:09 PM (13 years ago)
That's totally doable. At one point I had experimented with a PHP script querying my mySQL database that has lat/long coords and descriptions for the points. I was able to get it to work after a bit of tweaking, so it's totally possible. Absolutely interested in what you come up with...could be very useful to a lot of people! Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/23/12 03:12 PM (13 years ago)
Certain info you might consider embedding the files since people are traveling and an internet connection would not always be available.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/23/12 03:16 PM (13 years ago)
At the moment, I don't believe the JSON files can be embedded. The only way to link them in the buzztouch control panel is via URLs. Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/23/12 03:22 PM (13 years ago)
Was referring to additional res > files. But that brings up the point that by republishing the app regularly with updated config file, it would make the app work better when it's downloaded or the cache is cleared when offline. Fred
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/23/12 03:28 PM (13 years ago)
Yes, that would then get into the need-to-download-updates scenario? I think people are pretty connected here. Tourists seem to be connected. Here in Europe, iPhones have been unlocked for ages, and I think travelers are savvy. Everyone's got a phone in their ear here. I bought my iPhone4S unlocked in June 2011 in the UK. and had 3-4 immediate choices for Carriers. I heard unlocked iPhones happened in the US in Oct, about a month before I returned, and I was able to get H2O pay as you go service, which was quite good in FTL. I got the iPad (3), which is unlocked, a week before leaving FTL. Once I got to the Berlin airport April 1, I swapped in my O2 DE pay and go SIM from last November, and my phone worked fine. Then I went to O2 and got monthly contract plans for both iPhone and iPad. I've used O2 in UK, IE, CZ and now DE. Each country is different SIM - same company, different SIM, different plan. Stops working at the border. I don't do the Roam thing. Pay and go SIMS are swappable when you enter/leave. Monthly contract SIMS aren't - you need a new plan, new number, etc. When I'm somewhere for more than a month, I get a Monthly plan service rather than expensive convenient pay and go.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/23/12 03:36 PM (13 years ago)
Sounds like you are probably covered then! If you expect to have network access close to 100% of the time in places you expect people to use the app, then I wouldn't worry too much about offline access. Certainly more a problem here in the US. But, there are tons of super popular apps out there that require a network connection all the time. Mark
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/23/12 03:49 PM (13 years ago)
But without WiFi or Carrier Internet, what would the Maps - the graphic maps - do? Just sit at the last GPS position, or go grey?
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/23/12 04:10 PM (13 years ago)
go grey, but that brings up to question of embedding map tiles. Google permits up to 50 MB of downloading of map tiles. I use another map app and have over 2 GIGs of downloaded map tiles. I been looking into embedding Google map tiles but haven't figured it out. GPS on most devices are now independent of having a signal. Having a signal can enhance GPS but usually not required on newer devices. Fred
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/26/12 02:43 AM (13 years ago)
I got it working. Sorry I haven't been more verbose, but I wanted it to work. My 99¢ Map App has three levels of screens: (Western Europe) Country Cities Categories (up to 4) Locations (per category) on Map My .csv table has 4 columns: Country, City, Category (from 1-4), Location (Lat, Lng, Name, Address) (I do my own GeoCoding - getting the Lat/Lng - since I also do Google Maps) I built a sample in BT for 1 Country>City>Category>Location. Then I copy/pasted that JSON into a PHP editor. The PHP script outputs new JSON code as text to a config.txt file on my web server (that the App reads from - not just a data file, but the whole config.txt JSON!), based on the BT JSON with repetitive occurrences of Screens for each Country, City, Category, Location in my .csv file. My PHP script followed the BT JSON sample. At each point that a menu needed to be repeated, and child[] items added, the PHP script read thru the .csv file, looking for each. The hardest part of all of this is following the very specific punctuation requirements of JSON. If you have more than one item in a child [], each needs to be separated with a comma ',': },{, But as in anything else, including English grammar e.g., no comma after the last child item: }]! That adds an extra if() statement! Without it, the JSON is invalid, e.g. },] is invalid. }] is valid. While the App is far from done, as in I need to add a e-mail screen at the top so users can let me know if a location has closed up or simply doesn't exist, and maybe some other info and links. BT was invaluable in creating the sample skeleton JSON, 1 Country>1 City>1 Category>1 Location, from which I added 11 countries, about 100 cities, 4 categories, and about 600 locations. And every time I add a new row to my .csv file, the script just adds a new location. Very good partnership.
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/26/12 04:22 AM (13 years ago)
One immediate bug: In the call out window on the map, the text displayed on screen is not correct - in the sense that many street names in countries use special characters, like omlauts, and the &... characters are being displayed as the &... text as typed, rather than being converted to what they should be - like an o with 2 dots over it. I'll need to research that in the FAQs somehow. if I can just think of the right query to search on. Unless anyone has been thru this before.
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/26/12 04:34 AM (13 years ago)
Next, I need to make the Android version. But I don't have an Android device. I would never sell something, even at 99¢, without owning a device to test it on. So I guess I'll be taking the U to MediaMarkt and see what Android devices are all about. I wonder what the ratio is of iPhone to Android users?
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/26/12 05:48 AM (13 years ago)
Hmmmmmm, being an Apple Developer is $99USD/year. Didn't read that here prior.
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/26/12 06:07 AM (13 years ago)
Looks good in iPad as well.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
04/26/12 07:30 AM (13 years ago)
Regarding the special characters. I research that before. Was not able to solve this problem. Use my search engine to find those threads. www.MySkylla.com Fred
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/26/12 07:53 AM (13 years ago)
I remember now what I was going to ask! In my spreadsheet, I also have the location's website URL. Can I put that in the callout bubble - or the underlying info screen - on the Map, so the user can tap to launch Safari?? I'm not yet thinking of doing the phone number. I didn't see that on the first go round of making the Map itself work, with the menu structure.
 
UniApps
Aspiring developer
Profile
Posts: 124
Reg: Apr 21, 2012
An American in ...
5,940
like
04/26/12 03:40 PM (13 years ago)
I fixed the special characters printing with their &...' text. The reason why: they were in the "title":"" and "subtitle":"" lines, in-between the quotes. So of course, that means I'm telling JSON to print the characters exactly as I entered them. So now I do a search on the frequently used &...' codes, and replace for the actual printed character I want. See http://webdesign.about.com/od/localization/l/blhtmlcodes-de.htm - the first that came up in Google search. I search for the "friendly code" and replace with the "Display" character. IOS Simulator likes it. The most frequent were: ö ö ö Lowercase o-umlaut é é é Lowercase E-acute ß ß ß SZ ligature
 

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.