Using a database in an android app - android

I'm new to android development. I've started with an app on eclipse using java which uses a database of locations. My question is, how would I be able to connect my android app which to the database. Also suggest a suitable way of creating the database. Can I create it in mysql and then import in eclipse?

Look here.
I hope this will help you.
If you want to use MySQL to insert the data then use web service to send data in XML format from android to web service.

This link should explain everything that you need!
http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
If you're just using this database for your application to store data, sqlite is a much better choice than mysql and integrates simply into android. I used the very same link above awhile back when I was getting into this stuff. The tutorial is structured in a very easy to read manner and explains everything as it goes. Good luck.

Related

How to setup a mongoDB server and use it for an android application?

We are developing an android application that needs to communicate with a remote database, in order to sync some Strings. After some research it seems that mongoDB fits all the requirements.
However we are new to back-end and are clueless as to how things actually work. Google wasn't of much help as I couldn't find anything that explains this stuff clearly enough.
From my understanding we need a mongoDB and a REST API server. How do we go about setting these things up to use with android?
A step by step guide and a brief explanation as to what we need would be extremely be helpful.
You can go through following link and use step by step.I think it will be helpful.
Click here A simple CRUD application using Express and MongoDB

How to make an android app work in offline mode in android

I want to know how i can make my app work in offline mode and store the data on a local database on the android device.
I am using mongodb database and fetching the data by using JSON Parsing.
What should i use to make my app run in offline mode and also update the changes made on the server ?
Which tools should i use ,also which is the best and easy method to implement this?
Thanks in advance.
first you create local SQLite Date Base
in that create one extra column like "noNet" ...
In this column you save your data when phone in offline mode and then send data to web server when phone is online
This question is a bit older now, but I'd like to add what I believe is a good architecture approach to solving this.
Take a look at the tech talk given by Yigit and Adam at the Android Dev summit. https://plus.google.com/+AndroidDevelopers/posts/3C4GPowmWLb
Seems the core components are:
Job Scheduler/Queue, via https://github.com/yigit/android-priority-jobqueue
DBFlow to make interaction with the SQLite database easier: https://github.com/Raizlabs/DBFlow
And an EventBus https://github.com/greenrobot/EventBus to easily broadcast when the actual jobs complete (so the UI and other components can be notified).
Those 3 together get you most of what you will probably need. Their tech talk (first link above) really details these things better, and there's a final example application you can take a look at as well: https://github.com/yigit/dev-summit-architecture-demo
If you have an option, you can go for couchdb or couchbase which provide couchlite for android and sync is taken care by itself.
you can also refer this thread here SQLite on Android and MongoDB with synchronization

Android and iPhone

I am creating an android application for the first time and learning.
When I updated something to a website, could those updated one reflected on the android automatically?
And another question is, are Android and iPhone related? or they have their own software to design individually?
Thanks, your responds are appreciated.
As far as i understand your question you would need a webservice of some sort to provide this data to your app.
This can be done using PHP, C# or any other webtechnique.
You would than have to parse the JSON or XML on the client side (in the app).
This is the basic Server-Client structure that most apps use.

Android App with SQL server

I have a few questions regarding sql server in android.
Essentially, I am tring to create an app that communicates to a SQL server, runs queries, creates new tables, rows, etc. I have been doing a lot of research recently about getting a connection to a SQL server in android. I've seen the tutorial on using a php file and it seems that isn't quite what I am looking for.
My questions:
Is it possible to create an app like the one I described above?
Do I need to do it using a php file? (like the tutorials)
Is there another way to do what I am looking to do?
Should I create a webservice to do the database portion of it? If so, are there any tutorials out there about that?
I apologize for my noob-y questions. Thanks for your help
You should definitely create a webservice, because otherwise any malicious user who has access to your app (downloads it) could easily trash your DB. But allowing insertion and creation privileges to users seems like a bad idea already.
If your users need a personal db, why don't you use sqlite which is stored locally and has no access delays, and no internet connection requirements? Why do you want a single db that is completely exposed to everyone?
It is not a good idea to communicate directly to SQL server from Android Phones. You might hit so many technical constraints when you keep going with the development. I am not sure about he end result as well. It would be great to go ahead with the service that way you might have lot of controls inside the application and design it efficiently... Just a thoughts :)

Whats the best solution for a database used in conjunction with Maps in Android?

Could someone please point me in the right direction. My project involves a database where users enter their address and other info from my website. This database is then referenced in my android application to show the locations of these addresses in my database.
I have yet to start and just came up with this idea. My question is, what would be the best method to create a database easily modified through my website (mySQL, php, etc), and also easily referenced easily through Android and the Google Maps API? I need some ideas on the languages I will need to use to create this database and website so I can go buy the necessary books to start reading up.
Thanks so much
I believe the best way for you to go with this one is:
a database cache on the device
that means you can use XML if you don't have many complicated requirements from storing the address
or SQLite if you want to be able to query the database and do more fancy things
on the server side
if you only need to get the data from your server on the device, then a simple XML with a unique address per user should do it
if you need to push addresses from your device to the server then a REST system needs to be implemented
So, now you just need to figure out exactly what you need from your system and then start googleing on one of the solutions I gave you! Good luck! :)
Google App Engine would probably work for that. GAE supports Java and Python. Maybe use the Restlet framework (compatible with GAE) to implement a REST architecture.

Categories

Resources