Android - How to get data from a server? - android

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.

Related

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.

Can you use the database on a website for android?

I'm developing an app and a website simultaneously. The website will be done in django and using Google' app engine, so therefore Google's database. IS there anyway i can download and use the database for an android app? Preferably I would like it to download and make it available offline to the users.
use a REST api like django tastypie on the server side, and consume the rest resources for the models you need with your android app. After you get the Json/xml messages on your android just save it to the local sqllite db
Android does provide a SQLite interface for you to read and write to a local db. You could fetch the db through a web request and save it locally, yes. Being on Google App Engine does not help / hinder your ability to do this.

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 remote database

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.

Categories

Resources