Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 17    Views: 123

Patuba
Lost but trying
Profile
Posts: 13
Reg: Apr 14, 2013
Lincoln
5,330
04/28/13 02:53 PM (12 years ago)

App Database Advice

I am new to programming and haven't done much with SQL in the past. I am currently making a iPhone/iPad reference app but I am confused as to the best way to go about it. The App is going to have 4 main features. One is a Profiles section that will list drug/medicine profiles. This will not be updated very often. I was thinking about using SQLite for this. The next section will be a General Health section. This information will be not updated very often so I think I was going to use SQLite for this as well. The next two sections will be a News and User Feedback section. They will need to be updated often so I was thinking about using a MySQL backend and having the app pull information from the website. The main problem I see with this is that iPads are not always on a data network like iPhones and I would like the content to be able to be viewed offline. I know from research that people use PHP for MySQL calls but PHP requires a interpreter which is usually ran on the database server. Does anyone have suggestions on how to do this? Also, if anyone can think of a better way to implement these databases please let me know.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/28/13 04:15 PM (12 years ago)
All these comments need to be taken with a grain of salt; my 'plans' and the implementation of my plans always end up differently. But my 'plan' was to use a Json file rather than SQLite for most of my data, and have the app look for an updated data file, and fall back on the internal file if not found. This way, I can include valid data (as of the apps launch date) yet still keep fresh data available when a network is around. As with most BT apps, your 'downloaded' data can be cached for offline use. Provided you don't have 10 million entries, any difference in processing speed would be relatively negligible for internal file processing, so Json text files would work just fine, and are far more legible, and easily updated after the app is released. I 'am' using an SQLite database for my map tiles (for an offline map experience, using my own created maps, not Google/Bing/Apple/OSM etcetera...) but that was laid out in the tutorial and I have no other experience in which to mitigate any modification. And it works out just fine. If you do decide to go this route, it won't kill you. If you're 'storing' user information, you could use SQLite, or it might be easier to implement NSUserDefaults depending on your grasp of either/both. https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html Cheers! -- Smug
 
Patuba
Lost but trying
Profile
Posts: 13
Reg: Apr 14, 2013
Lincoln
5,330
like
04/28/13 04:22 PM (12 years ago)
Thanks for the ideas. I will not be storing user information and users will not be updating or adding any information, just reading information. The idea of using JSON files instead of a database is a good idea for the profiles and health information since they will not be updated often and people just need to read them. Does anyone else have additional feedback?
 
SheriDee
Code is Art
Profile
Posts: 1094
Reg: Sep 23, 2011
location unknow...
22,840
like
04/28/13 07:02 PM (12 years ago)
@patuba have you looked on becoming a member? You can have your own self-hosted server and control the data in several ways. -Sheri
 
Patuba
Lost but trying
Profile
Posts: 13
Reg: Apr 14, 2013
Lincoln
5,330
like
04/29/13 07:14 AM (12 years ago)
Hi Sheri, Yes, I have thought about becoming a member but I don't know what that all gives me with the self-hosted server. How does it allow you to control the data?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/29/13 10:36 AM (12 years ago)
For the "Profiles" and the "General Health" sections, I agree with @SmugWimp - JSON is an easier approach - mainly because it is easy to integrate into Buzztouch. Here's how that would work: 1) Create a custom plugin for the "Profile" screen and a custom plugin for the "General Health" screen. Then create instances of these plugins for each screen you need in the control panel. (@Sheri is right that you'd need to be self-hosted to do this properly, although if you know what you're doing, you can do so on Buzztouch.com using the JSON Snippet Keeper). The advantage to this is that the app will work when offline, but if loaded while online, it can download the latest updates. 2) For the "news" and "user feedback" sections, Your best bet is probably to use a RSS feed and load it through the new RSS plugin. That's only available on iOS currently, though, so if you're looking for an Android app, you'd need to do some custom work on that end.
 
Patuba
Lost but trying
Profile
Posts: 13
Reg: Apr 14, 2013
Lincoln
5,330
like
05/01/13 06:54 PM (12 years ago)
Thanks for all of the suggestions. I am curious, if I were to use JSON, what kind of files would I store the information in? Does anyone have a link has more information on JSON? From my understanding, it is like XML, is that right? Also, what else do you get with Buzztouch if you self host it?
 
SheriDee
Code is Art
Profile
Posts: 1094
Reg: Sep 23, 2011
location unknow...
22,840
like
05/01/13 07:42 PM (12 years ago)
As a retired nurse, I am interested in your creation idea. I would encourage you to look at some great api's that government sites have to help you with your app. http://www.nlm.nih.gov/api/. @Patuba there are so many ways to do this. I would also recommend self-hosted server because you can supply your own secure certificate as buzztouch.com has theirs. You might want to consider something that just recently came out that the DOD has authorized use of android and ipad tablets...bye bye blackberry! Meaning HUGE market to start thinking seriously about your app business....not just one app. http://9to5mac.com/2013/05/01/dod-to-grant-apples-ios-6-samsung-galaxy-devices-security-approval-for-widespread-use-by-us-government-agencies/
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
05/01/13 08:03 PM (12 years ago)
The biggest advantage 'I' recognize with self hosting, is the ability to easily modify plugins to do my bidding. Well, do most of my bidding, while I learn new stuff. Folks are trying to stock the plugin market as fast as possible, but the fact remains that there is a process to that, and it takes time. Also, not everyone needs the same functionality that I do, and the plugins 'I' need are either a long way out, or just plain non-existant. So I end up creating my own plugins. This is something you cannot do unless you're self hosting. Well, not without a bit more work. Plus, I've modified some existing plugins to extend their functionality to 'my' tastes. I have two 'versions' of the menu with image plugin; one 'stock' and one I've modified so that I can have different image sizes depending on the 'version' I use. This is another thing you can't do without self hosting. Developers have to test their plugins, and you can sometimes get 'early' releases for test. Self hosted only. There are some free hosting sites out there, and more than a few BT'ers use them. But choose your host wisely; sometimes the server config needs modification depending on your host's configuration, which is something you may not always have control of, and may not be able to have changed for you in a timely fashion, if at all. There are other reasons why you'd want to self host, but in my mind, 'plugin versatility' is the deal maker for me. Cheers! -- Smug
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/01/13 08:09 PM (12 years ago)
@Smug - I'm with you. There's lots of reasons to self-host, but my top reasons are: 1) Custom plugins - sometimes you need a plugin that's just too customized for sale on the open market 2) Custom branding 3) Give clients access to push notifications (I'm just venturing into this, but it will be a huge selling point) 4) Modify control panel to suit my needs
 
Patuba
Lost but trying
Profile
Posts: 13
Reg: Apr 14, 2013
Lincoln
5,330
like
05/05/13 10:47 AM (12 years ago)
Thanks for the all the ideas. Can anyone help me point me the right direction on how to do this with JSON? Are there any good web tutorials or references anyone can recommend?
 
Patuba
Lost but trying
Profile
Posts: 13
Reg: Apr 14, 2013
Lincoln
5,330
like
05/05/13 11:01 AM (12 years ago)
Thanks for the all the ideas. Can anyone help me point me the right direction on how to do this with JSON? Are there any good web tutorials or references anyone can recommend?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/05/13 11:26 AM (12 years ago)
Well like I said, you'll need custom plugins to make this happen. If you understand objective-c, it's not hard. If not, I can build them for you if you like. You'll want to be self-hosted if possible.
 
Patuba
Lost but trying
Profile
Posts: 13
Reg: Apr 14, 2013
Lincoln
5,330
like
05/05/13 11:53 AM (12 years ago)
I am the beginning stage of learning objective-c so I would help needing plugins. This app will be a lot of text and more like a reference app as it will be based on a reference book/ebook. I am wondering if JSON will be the best approach versus several HTML files that hold the data. Any thoughts about me using just HTML?
 
Patuba
Lost but trying
Profile
Posts: 13
Reg: Apr 14, 2013
Lincoln
5,330
like
05/05/13 12:00 PM (12 years ago)
I am the beginning stage of learning objective-c so I would help needing plugins. This app will be a lot of text and more like a reference app as it will be based on a reference book/ebook. I am wondering if JSON will be the best approach versus several HTML files that hold the data. Any thoughts about me using just HTML?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/05/13 01:11 PM (12 years ago)
You can certainly use HTML, although keep in mind Apple tends to reject apps that look just like a mobile website. Also the loading will be much slower than if you used native screens and fed in just the content.
 
Patuba
Lost but trying
Profile
Posts: 13
Reg: Apr 14, 2013
Lincoln
5,330
like
05/05/13 01:51 PM (12 years ago)
That is good to know. What is a "native screen"?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/05/13 01:55 PM (12 years ago)
Something built from code, not a HTML doc loaded from the web
 

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.