Discussion Forums  >  Suggestions, Ideas, Wish List

Replies: 6    Views: 63

DavidEdgertonJr
Aspiring developer
Profile
Posts: 37
Reg: May 21, 2013
Cottage Grove, ...
3,970
07/12/13 12:05 PM (12 years ago)

Getting Data Into App From Internet

Hello everyone, I'm working on designing and building an app that displays data from a database online. Has anyone built one before and can you tell me how you did it? Most of the apps I've been working on contain all the data and content within the app locally on the phone. This new app will have to get real-time data from a website for reporting purposes. If you have done an app that queries a data source online somewhere that would be great to share. Thanks! David
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
07/12/13 01:19 PM (12 years ago)
Great question David. I've certainly done this before with my apps. But, if you take a step back, almost all Buzztouch apps do this to an extent. When you 'refresh' the app, the app is pulling information from the Buzztouch database and updating the content on the fly. It's the beauty of Buzztouch. I'm assuming, though, that you have another database that you're trying to get data from? If so, do you have complete access to that server? (i.e., can you upload your own php scripts, and do you know the table structures?). If so, you can write a php script that grabs data from this other database and outputs it (i.e., uses 'echo' statements) into a valid JSON format. Then you point the app's dataURL for a particular screen (perhaps a menu plugin, or perhaps a custom made plugin) to the php script you uploaded. If it all becomes way over your head, know that there are those of us available for hire to build the custom scripts/plugins for you.
 
DavidEdgertonJr
Aspiring developer
Profile
Posts: 37
Reg: May 21, 2013
Cottage Grove, ...
3,970
like
07/12/13 03:05 PM (12 years ago)
Thanks Chris, I am writing a web app using Ruby and the Sinatra web framework. I want to make a mobile app that reflects the functionality of the web app - basically responsive design is what I'm after. I get the idea of having buzztouch push updates and data to the mobile app (i'm self hosting myself) so that makes sense. Are there plugins that create menus and screens from data you download from a site? Can you walk me through an example? I hope I am articulating this correctly. David
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
07/12/13 04:35 PM (12 years ago)
Sounds great. So basically any plugin can be configured to do this. Each has certain JSON properties it downloads from a given dataURL. All you need to do is write a script from your server to spit out the data as JSON using the same key names that the plugin uses. There's a good chance you'll need a custom plugin to display your content though,depending on what it is and how it needs to be displayed.
 
WebNevees
Code is Art
Profile
Posts: 206
Reg: Oct 28, 2012
KL
11,660
like
07/12/13 05:43 PM (12 years ago)
You can also save the hassle if you don't need offline access and as you pointed out yourself, create a responsive layout, then open your pages as a menu item inside a buzztouch app.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/12/13 06:30 PM (12 years ago)
You're welcome to fool around with some code I've got in my dropbox. https://dl.dropboxusercontent.com/u/115208762/loadScreenObject.zip It takes info from a database and populates a menu for different screens, if I remember correctly (which is suspect...) Cheers! -- Smug
 
DavidEdgertonJr
Aspiring developer
Profile
Posts: 37
Reg: May 21, 2013
Cottage Grove, ...
3,970
like
07/12/13 08:29 PM (12 years ago)
Thanks guys. This is great information. I'll give it a try. David
 

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.