Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 9    Views: 113

Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
07/22/12 11:51 PM (13 years ago)

Pointing Your App's online Config File To Dropbox

Simple little exercise, "Pointing Your Online Config File to Dropbox": **** See updated method at: http://www.buzztouch.com/forum/thread.php?tid=8C9947BD787B15FB24CDBF4&command= **** In a previous post I detailed a technique that allows you to take advantage of using Dropbox to host your online Config file. This technique allows you to make modifications in the Control Panel without annoying your app users or breaking the app while you make modifications in the Control Panel. In the most recent Buzzcast poll, the results indicated no one was taking their app offline. The poll didn't indicate if users were using a third party online Config file (Dropbox or your website) or using the control panel online Config file (the default setting).  Either way here's a quick little tutorial on how-to. Step 1.: Post a copy of the BT_config.txt file to Dropbox. (Don't worry about modifying the file yet, you just need the Dropbox link, and post a second copy in a different folder. (Yes, you'll need both copies.) In BTv2.0 (Android) and BTv1.5 (Android) it's located in the Assets folder of the source code. In BTv2.0 (iOS) and BTv1.5 (iOS) it's located in the BT_Config folder. Don't try this with BTv1.4, it won't work. Step 2.: Open up Dropbox in your browser and get a "Public Link" to the file. A "Share Link" won't work. The file doesn't need to be in a "Public Folder". Dropbox is doing away with the "Public Folder" anyway, so new accounts won't even have the option of using a "Public Folder". If you already have a Dropbox account you can use the "Public folder" or not, either way use a "Public Link". Hint when grabbing the "Public Link" use the URL shortner. Step 3.: Open up the BT_Config.txt file you just posted to Dropbox. Step 4.: Look at the file, and find the Configuration Data URL In BTv2.0 and BTv1.5 it's in line #10 It will looked as follows: "dataURL":"http://www.buzztouch.com/appdata/v1.5.php?command=getAppData&appGuid=[buzztouchAppId]&apiKey=[buzztouchAPIKey]", Step 5.: Replace the data URL with the Dropbox URL so it looks like this: "dataURL":"[PLACE YOUR DROPBOX LINK HERE, WITHOUT THE BRACKETS, but with the quotes and the comma]", Step 6.: I know you're tempted to, but leave the "reportToCloudURL" alone. Don't remove it or modify it. Step 7.: Save the file and exit. Step 8.: Make a copy the modified BT_config.txt file from Dropbox to your source code and replace the existing file. (If your source code is in your Dropbox folder as I recommend, you don't have to worry about saving a un-modified copy of the file because Dropbox will automatically keep a copy for you. Besides you can always get a copy from the control panel.) Step 9.: Publish the new binary to the Apple App Store or Google Play as appropriate. Your app now has a Dropbox online Config file. Step 10.: Now replace the modified Config file with the un-modified Config file (Copy #2). Your source code now points to the Buzztouch control panel for the online Config file, and any changes you make in the control panel will be reflected when you run the app either in the Simulator (iOS) or Emulator (Android) when you refresh the apps data. Make all the modifications you wish and they will not be reflected in the "Published" app that users download from the respective app store. You may be thinking, "Since I keep my source code in my Dropbox folder anyway, I'll just use the link to the BT_config.txt file." We'll it won't work, because you'll need this copy to use for development of the app. You can now use the technique I outlined in this post: http://www.buzztouch.com/forum/thread.php?tid=8C9947BD787B15FB24CDBF4 The End. (Not really, there's a second method which I consist a better technique which I'll post tomorrow. It involves having two sets of source code, but it's simpler, therefore better.) Fred
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
07/22/12 11:53 PM (13 years ago)
Option #2 (I'll post this later .)
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/22/12 11:54 PM (13 years ago)
Nice writeup, Fred!
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
07/22/12 11:58 PM (13 years ago)
Thanks, but goodnight to one and all, sleep calls me. Fred
 
OWC
Lost but trying
Profile
Posts: 5
Reg: Jul 06, 2012
Dayton, Ohio
9,550
like
07/23/12 12:12 AM (13 years ago)
Fred, I want to thank you for the time you put in to do these exercises, writings and all the other "learning" stuff you post. Kudos to you!
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
07/23/12 03:20 AM (13 years ago)
Nice writeup Fred. But the results of the Buzzcast Poll you mentioned actually stated that everyone was using a config file either pointed to Buzztouch's server OR their own (website or dropbox). It didn't differentiate between BT and 3rd party. The results stated that no one was removing the link to the dataURL completely. (at least no on that voted).
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
07/23/12 06:10 AM (13 years ago)
@Stobe, Brain memory need upgrade. Thanks, will edit. Fred
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
07/23/12 06:13 AM (13 years ago)
No prob. Blame it on MMBD (Monday Morning Brain Disorder) :)
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
07/23/12 06:21 AM (13 years ago)
@OWC, it actually a great way to learn how-to, when you write it down it's easier to see missing. Fred
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
07/23/12 07:44 AM (13 years ago)
Great stuff Fred. David buzztouchmods.com
 

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.