2

I'm about to build a GPS Spot Finder application with Android and I am trying to decide what requirements are feasible and what aren't. The app would enable users to essentially add different spots on a Google Map. One of the problems would be fetching the data, adding new spots, etc, etc. This, of course would mean the database would have to be online and it would have to be central. My question is, what kind technologies would I need to make this happen? I am mostly familiar with XAMPP, PHPMyAdmin and the like. Can I just use that and connect Android to the database? I assume I would not need to create a website...just the database?

What different approaches can I take with this? Be great if people can point me in the right direction.

Sorry if I don't make any sense and if this type of question is inappropriate for Stackoverflow :S

Johnathan Au
  • 5,244
  • 18
  • 70
  • 128

4 Answers4

5

Create a website to access the database locally, and have Android send requests to the website.

mbeckish
  • 10,485
  • 5
  • 30
  • 55
  • Ahh, i'm trying to avoid creating a website. I'll be essentially creating two applications ... =/ – Johnathan Au Oct 10 '12 at 19:14
  • Yes, but you don't ever want to have a phone, or even a remote PC, trying to communicate directly with a DBMS. Web servers are much better suited to robustly handle this type of remote communication. If you must, check out this post about using JDBC from Android, http://stackoverflow.com/q/4447692/21727, but in my experience, remote connections directly to a DBMS are very slow. I think the protocol is much chattier than HTTP. – mbeckish Oct 10 '12 at 19:34
4

If users are adding spots to a map that only they see, then it makes sense to keep the data local to Android using a built-in database (SQLite). That looks like

ANDROID -> DATABASE

You can read up about SQLite options here.

If users need to see all the spots added by all other users, or even a subset of spots added by users, then you need a web service to handle queries to the database: Connect to a remote database...online database

ANDROID -> HTTP -> APPLICATION SERVER -> DATABASE

Not only is trying to interface directly to a database less stable, but it may pose risks in terms of security and accessibility.

Never never use a database driver across an Internet connection, for any database, for any platform, for any client, anywhere. That goes double for mobile. Database drivers are designed for LAN operations and are not designed for flaky/intermittent connections or high latency.

Additionally, Android does not come with built in clients to access databases such as MySQL. So while it may seem like more work to run a web service somewhere, you will actually be way better off than trying to do things directly with a database. Here is a tutorial showing how to interface these two.

There is a hidden benefit to using html routes. You will need a programming mindset to think through what type of data is being sent in the POST and what is being retrieved in the GET. This alone will improve your application architecture and results.

Community
  • 1
  • 1
mrchampe
  • 452
  • 3
  • 12
0

Why not try using something that is already built into android like SQLite? Save the coordinates of these "spots" into a database through there. This way, everything is local, and should be speedy. Unless, one of your features is to share spots with other users? You can still send these "spots" through different methods other than having a central database.

And yes, you just need an open database, not a website, exactly. You could technically host a database from your home computer, but I do not suggest it.

Zerkz
  • 686
  • 1
  • 6
  • 25
  • Yeah, I'm going to pay for some server space somewhere. I guess the main question is, would I need to build a website or can I by pass that completely and just use the PHPMyAdmin interface? – Johnathan Au Oct 10 '12 at 19:15
0

If you are looking at storing the data in your users mobile nothing better than built in SQLLite.

If you are looking at centralized database to store information, Parse.com is a easy and better way to store your user application data in centralized repository.

Parse.com is not exactly a SQL based database, However you can create table , insert / update and retrieve rows from android.

Best part is it is free upto 1GB. They claim 400,000 apps are built on Parse.com. I have used few of my application typically for user management worked great for me.

Android Rao
  • 157
  • 1
  • 10
  • This is very very interesting indeed. Can you think of any cons with this? Would I need any software to install from Parse? I'll be spending the majority of my time on university's PCs and installing applications is restricted... – Johnathan Au Oct 30 '12 at 14:26