android remote database - android

I'm novice in android. I'm writing an android application which requires the data like comments and scores to sync with the central database. I'm planning creating a simple web service and sync the data with the app.
Please suggest me some of the best methods and technologies which i should use. Thanks!

Have a central database on a remote server.
Develop a RESTful web service to access the data.
Store the data on your local device in a SQLite database.
Communicate between both sides with good old http.
Hard to be more precise with such a vague question.

Related

how to get app to consume web service

I have created my first android app on my phone that contains a SQLite database. I will be the only person whoever uses this app.
I also have a SQL server database on my home PC. The SQLite database contains 4 tables that are in my SQL server database.
So I want to be able to sync my SQLite database to my SQL server database from time to time.
I have been googling how to do this and read that I need to create a web service. I have read some tutorials on this and it seems that I will be able to do this without too much hassle in .net.
My question is how do I get my android app to consume my web service? Or am I barking up the wrong tree completely?
The best thing you could do is create a RESTful API.
A rest api basically functions as a controller between your database and the client which would be your app. Your app will basically 'talk' (request) to your rest api because it wants to retrieve data from the database. The rest api then talks to the database to get the data the app wants and sends this data in a http response to the client (your app). More info on restful api's here.
In order to let your app communicate with a rest api, you need a http client. The most popular and easy to use http client is retrofit, which you can find here.
There's alot of documentation and tutorials for retrofit out there, so the rest is up to your google-fu skills.
Good luck!

Shifting data from local android sqlite database to cloud.

I made an android application which is collecting data from a wearable device and storing it into a local sqlite database.
Now I want to sync the data of all android devices local sqlite databases to cloud and visualize the data and perform data analytics related operations on it.
Can anyone suggest me what to do?
I have looked around multiple clouds like AWS, GAE, AZURE, HEROKU, GoDadddy shared cloud etc for storing my data in a central database.
My question is that should I directly store data from android into mysql or some other database using jdbc or odbc driver or write a webservice or api for storing data in cloud?
I want to sync data after some time interval i.e. a day or so, between local android device and cloud.
According to your description, based on my understanding, you want to sync up the data from wearable device between all android devices and cloud.
Per my experience, the way to directly store data from android into database is not a good choice. The normal way is creating a web service or rest apis to communicate with mobile device for data synchronizing to cloud.
On Azure, the best practice for your needs is that creating an Azure Mobile App instance and enable the Offline Data Sync feature in Azure Mobile Apps to implement this. You can refer to the Azure offical document Offline Data Sync in Azure Mobile Apps to know the related concept.
You can get start with the tutorial for Android within Azure Mobile Apps, and then continous to the next tutorial to implement the feature of offline sync up data automatically.
As reference, the tutorial How to use the Android client library for Mobile Apps will shows you how to use the Android client SDK for Mobile Apps to access the data from SQL Azure table online.
Meanwhile, to visualize the data and perform data analytics related operations on the cloud data, Azure support more Intelligence + Analysis services which could be used for your future plan.

Connecting Android app to amazon RDS

I have an Android application and I want to move my local database in the cloud. I decided for a SQL database and not for a NoSQL, because I want to execute complex queries. I created a database instance in RDS from Amazon and I populated the database.
Now I want to connect my mobile app to my cloud database. I saw samples for NoSQL database connection, but I wasn't able to find examples for RDS. I saw that it is recommended to create a web service and connect to that web service, but it seems much more complicated than using a NoSQL and this doesn't feel right.
Does Amazon offer some API/service for Android - RDS connection? Do you know any sample code that handles this aspect?
Does Amazon offer some API/service for Android - RDS connection?
No. AWS does not currently have an API for interacting with an RDS instance.
Do you know any sample code that handles this aspect?
You may want to access your database with PHP and get a JSON response. If your RDS instance is using MySQL then you’re in luck. There is already a lot of documentation on connecting Android to MySQL using PHP. You can get great sample code and instructions on this blog post.
Here is a very popular reference for connecting Android and MySQL.

Server requirement

We are interested in purchasing a server for storing a MySQL database that is used by an Android application. Just to understand, does the server only need to support MySQL, or are other requirements for a server for mobile use?
Your Android application would probably not work directly with a remote MySQL database.
In general, you would use write a web service API to act as middleware, communicating with your Android application and the database. Your Android application would make HTTP requests to the web service, which would in turn perform CRUD on your database. In this case, your server would need both a web server (with support for Java or PHP or whatever language you choose to use for the web service) and a database server. See How to have Android app work with MySQL online database?
To access the database "directly" (like it was local), this could help: MySql remote database manipulation in Android
But you might need some additional server functionality, at least in the future. Then you could use a server which also offers PHP. PHP + MySQL are usually offered together, it's very common/popular and it's cheap. Since you don't seem to have any special requirements for the server functionality, PHP is probably suitable.

Android - How to get data from a server?

I've read lots about using local storage for android but how would I connect to an SQL database online to send and get data?
For example, if I was making a game and wanted to create a worldwide high score table, how would I store that online and make sure it was only available to that app?
I would recommend you to implement a Web Service on the server. And use The Web Service as a layer between your SQL Server database and your Android application.
Have a read about Three-tier architecture.

Categories

Resources