Accessing external database from Android app - android

I have a sqlite database with about 15MB of data (too large to store on each device). I am building an app to interact with this data. How to go about accessing the database from wherever the app is being stored. I'm not asking someone to do it for me, but where do I go about researching how to do this. Is there an android module that does just this after being passed an ip address (or FTP Server IP?). Where do I start researching the best way to host my database and then link it to my app? What's the high level brief of how this is accomplished? Thanks!

Two ways
You can send a query to the web server and retrieve the result (you need the web server URL that received your query and send the result through HTTP).
You can download the database and put it in the app database directory and then you can query this database.

Related

How to make changes to sqlite database for app that is installed in multiple devices?

I started developing an app that uses sqlite that is to be installed on multiple devices and any updates done on sqlite database from any device are to be reflected in other devices as well. I have researched a little and found that Sqlite DB is local to a device and changes done in one device are not reflected in others and for that I have to use external server. Is there any way around it?
Is it optimal to directly store data in external server or use sqlite and sync it regularly with external database?
Thanks in advance
As far as I know, there isn't a way without an external database. I would recommend you to sync it regularly with an external database.
Checkout this question for more information how to do that:
How to sync SQLite database on Android phone with MySQL database on server?
Answer of Andrew White
Create a webservice (REST is probably best) and serialize your SQLite/MySQL data and PUT/POST/GET it to/from your web service. This will give you a nice layer of abstraction in case you decide to switch from MySQL to something else server side.
You will achieve your goal using external server. It's not necessary to create your own server, just use data store services like Parse. For more look here.
You can use data directly from external server or cache them on your device first (sqlite, prefs, json etc.) – it's up to you.

Storing and fetching data in database

What I need the app to do is to store data in a database and let any user fetch the data. I am not sure how SQLite works but from what I know is that it is server-less. With the database being serverless, how do multiple users, other users, access the same data if it is not stored on a server?
look for backend and a service - parse.com or similar.
SQLite is installed on all android systems, and any app which wishes to create and use a database may do so. This however, is only stored locally on the device.
If you wish to share and synchronize data across multiple devices, that is a different issue all to itself. Indeed it will very likely involve a central server somewhere along the line.
Perhaps start your reading at d.android.com

android database to oracle database

Can someone give me an idea or point me in the right direction about following matter:
I need to make android app that will do some things with remote oracle database (take some data, insert some data, ...).
I can do that, but the trick is, app owner needs to be able to do that offline (because he doesn't have internet everywhere), then when user connects to internet, somehow transfer those offline changes in local android database to oracle database.
I never did something like that.Any pointers?
Should I make same database structure in android database like that remote oracle database?Then somehow synchronize changes?
Or is it done some other way?
Thanks for any help.
If you have the ability, it would be best to create a RESTful application on the server that listens for your app to contact it. Then it would take the data (send it from your app via JSON, XML or any of several other popular formats) and operate directly on the Oracle database by doing the adds/inserts/deletes there.
You can do the same thing on the way down - your app contacts the server, the server provides data from the database in the form of JSON, XML, etc and your app can then operate on it's own internal JAVA objects of data.

Android SQLite to My MySQL Web Server?

I have been learning SQLite on Android and have done some tutorials on how to use it.
There is a question that I want to ask.
Is there a way to make my app connect to my MySQL database in a remote web server of mine so that it can read data and also write data to the database?
From what I've researched, SQLite cannot be used remotely and I would need some kind of Web service in between?
It's not easy to create a connection to MySQL from Android, if it's not impossible. With that, it's also not safe if for example someone decompiles your app they have access to your whole MySQL database if you don't limit it enough.
For those reasons, you can better use a (for example) PHP webservice to which the Android application sends all their requests. An example is available at http://www.helloandroid.com/tutorials/connecting-mysql-database.
I also suggest you use Android Asynchronous Http Client so you don't have to deal with connectivity issues and AsyncTasks yourself.
You can refer to this tutorial but you do need a web-server for it.
Request mechanism
Android App ----> webserver ------> database (mysql)
Respond mechanism
Android App <---- webserver <------ database (mysql)
Android App will use JSON or other to get the data and display it
You have to use Sqlite database and web Services both. First you have to save the data in local database i.e. SQLite database and then send this data to your server using web services and vice versa.
this link for web services
and this link for SQlite will help you understand.
Thanks.

Android: Connect to Oracle database via username and password and present data from the database to user?

I'm developing a web app with Java Servlets that can access an oracle database through the Tomcat server. I am also developing an android app that I want to use to be able to display the information that is stored on this database, so I will need to provide the user with the ability to log on and access the data from the database. The information will then also have GPS coordinates to display the items on a map.
Any ideas of the method or process involved in achieving something like this? Thank you!!
One really easy way to solve this problem involves using another product from Oracle, Database Mobile Server.
Having your Android devices connect to Oracle Database over the network has serious security and other implications.
Instead, you can just use the local SQLite database that is built into Android. Database Mobile Server provides a sync client that runs on each Android device, and synchronizes the local database with the remote Oracle Database in the background.
You can read more about the product and download an eval copy here:
http://bit.ly/tLjaF7
Good luck with your project.
Regards
Eric, Oracle PM

Categories

Resources