Discussion Forums  >  Config Data, JSON, App Refresh

Replies: 8    Views: 195

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

Pointing your Config file to Dropbox, a how-to tutorial.

Simple little exercise, "Pointing Your Online Config File to Dropbox" A better & Simpler method: *** 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. Yesterday I outlined a method that involves swapping in and out the Config file. The method described in this post is simpler than the method I described yesterday. 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. This tutorial is premised on you keeping the source code in a Dropbox folder. Doing so will simplify the process. Using Dropbox is not mandatory, you can use any solution such as your website or SugarSync that allows you to post files. You'll be playing with the Config file called BT_config.txt 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 1.: Download the source code to Dropbox. (We'll call this copy the "Development Copy".) You'll make all your changes to this copy. Add files here, modify the source code as appropriate. This is the copy you work on. It'll remain Online and the Config file will point to the control panel. Step 2.: Develop your app as you would normally. When your ready to publish the app go to step 3. Remember to update the Config file before you publish. How to? Simple, go to the control panel and copy the Config file and replace everything in the BT_config.txt file in the Development copy of the source code. So far you only have one copy so that should be easy. Step 3.: Copy the entire source code to a different folder in Dropbox. (We'll call the second copy the "Distribution Copy".) The file doesn't need to be in a "Public Folder". Dropbox is doing away with the "Public Folder" anyway, so new Dropbox 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, it makes no difference. Step 4: Open up Dropbox in your browser and get a "Public Link" to the BT_config.txt file in the Distribution Copy. A "Share Link" won't work. It must be a "Public Link". Hint when grabbing the "Public Link" use the URL shortner. Step 3.: Open up the BT_Config.txt file in the Distribution Copy 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.: Publish your app using the Distribution copy of the source code. The app you publish will point to Dropbox. 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.: The Development copy of the source code continues to point to the 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 in the Development copy." Well it won't work, because you'll need this copy to use for development of the app so it must remain pointing to the control panel. You can now use the technique I outlined in this post: http://www.buzztouch.com/forum/thread.php?tid=8C9947BD787B15FB24CDBF4 Or just see below. After you made the changes you desire to publish to your app just copy the Development Copy of the source code and a. overwrite the Publication copy of the source code and repeat from Step # 3, or b. Create a new copy of the source code (perhaps call it version 2, and repeat from Step 3). One advantage of option b is you'll have an older version of the source code should you need it. It's sometimes hard to find that "new bug" and going back to an older version could be the solution. The End. (Not really, again there's a even simpler method, but this time it's not necessarily better it's just simpler but different.) Fred
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
07/23/12 12:02 PM (13 years ago)
Buzztouch Config file - Advance use of for easy app updating and better user experience. 1. Publish app with BT_config.txt pointing to third party Online Config file. (Place online Config file on Dropbox or your website) Modify the BT_config.txt to point to the third party site. Copy modified BT_config.txt file data to third party online config file. 2. Place online Config file on Dropbox (if it's not there already) or your website. 3. When you plan to make MAJOR changes to the App, remove the reportToCloud URL from the third party (not Buzztouch) online Config file. Make any change to the app in the Control Panel. This will take the app Offline when the user updates. 4. The user will receive one notice that the "data has changed" which will take then offline. 5. Now the App is "Offline". 6. Put the reportToCloud URL back into the BT_Config.txt file in your project source code. Now compile your app. A. For iOS: Sign this app with the Development certificate not the Distribution certificate. Your development app is now online. This will allow you to see any changes in the control panel since the development app is now online. The published app remains offline pointing to the third party online Config file. They will not see any modifications made in the Control Panel. B. For Android: create a new .apk. Upload the app to your device. You now have a online app that will display modifications to the app made in the Control Panel. When you're finished with modifications (i) update the BT_Config.txt file in the source code. Copy and paste the source from the control panel. (ii) point the Config file to the third party online Config file. (iii) place copy of the updated Config file pointing to third party site on third party site. (iv) For iOS publish a new binary to iTunes using (the distribution profile), and / or (v) For Android publish app to Google Play (or appropriate market) (iv) This will take user back online with the Config file pointing to the third party online Config file. Repeat as necessary. Essentially this creates two apps: a. The published app users find on the market it's either online or offline but points to third party online Config file, and b. The development app (it's online and points to Control Panel online Config file.) You could use separate source code files, but it's not necessary. Wouldn't recommend it since it adds another level of complexity (you must remember to make each an every change in both source code files). But having a separate source code file to play with does allow you greater leeway to experiment without worrying that you'll make a fatal mistake. Xcode has a backup feature, use it wisely. Dropbox also has a backup feature use it wisely. Fred
 
Pablo
buzztouch Evangelist
Profile
Posts: 51
Reg: Nov 09, 2011
Argentina
510
like
07/23/12 03:33 PM (13 years ago)
Omg, this is to solve the problem i was asking in the other post? Genius!
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
07/23/12 03:37 PM (13 years ago)
:-)
 
Pablo
buzztouch Evangelist
Profile
Posts: 51
Reg: Nov 09, 2011
Argentina
510
like
07/23/12 03:49 PM (13 years ago)
Omg, this is to solve the problem i was asking in the other post? Genius!
 
Pablo
buzztouch Evangelist
Profile
Posts: 51
Reg: Nov 09, 2011
Argentina
510
like
07/23/12 04:34 PM (13 years ago)
Omg, this is to solve the problem i was asking in the other post? Genius!
 
Paddy
Lost but trying
Profile
Posts: 240
Reg: Oct 08, 2011
Hands Up !
12,500
like
07/23/12 04:46 PM (13 years ago)
Hey Fred, just to say, I checked out your site and now it's very much easier to navigate...Great job and thanks for your hard work.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
07/23/12 05:01 PM (13 years ago)
:-) Check out the search button. Find a thread or site, submit it, I'll add it to the search. Now need to figure out how to automate the process. Fred
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
07/23/12 07:59 PM (13 years ago)
Awesome re-designed site agreed ;p Now to add more to the search? :) 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.