Server requirement - android

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.

Related

How to access postgreSQL database from android mobile using python

I wand to access the postgreSQL database from android using Pydroid3 application in my mobile phone. to access postgreSQL database i need to import psycopg2, but android doesn't support this.
can anyone please suggest the way to solve this issue.
With Android you typically don't make a hard database connection, unless its a local one.
psycopg2 doesn't work for the same reason you're not supposed to use JDBC . You should talk to a remote database via a RESTful API, meaning a server sends you data that it itself retrieves from the database.
So your next step would to create a web site/service that handles GET requests. So your app can talk to it, and it can talk to the database.

Web service for android social networking app?

I am developing social networking app on android.Rough idea of my app is that when user launches an app it will get all users of this app in near by location.So for storage purpose of users data I want to use web server. I don't have an idea what is best way to start with.Should i use Amazon web services ? (S3,Ec2) I was surfing internet got these buzz words.
Please guide me what is best approach for database storage ? Should i write my own server api ? or What ?
These are some general things you will have to do:
Buy some server space where you can host your server (this is the amazon ec2, etc). If you need a fancy domain name, buy that too, and map it to IP address of the server that you brought (optional).
Setup a db of some kind on this server to store your data (msql)
Write wrapper web services (php, jsp, etc) which will expose apis to access your data remotely. For security reasons, you should also have some authentication using some token passing mechanism.
Access the data on your server remotely using the APIs you created in the web service.
I personally favor using a MySQL database with PHP to interface between the app and the backend! Your app can send requests to PHP and then your PHP webservice would write/read to the database and then return JSON to your app.
I would say this is a very subjective question though as there as so many ways that you can write a web service.

Android application and Application server

I want to develop a basic form application which records datas into a sql server. However, it is commercial work so i need to use an application server for security reasons. I searched and discovered that android can connect to a sql server via a open source library but i'm not sure how to use an application server with these?
You should write a webservice layer on you application sever and consume these on the android client.
Connecting to DB directly is not advisable

Android database connection on a closed network

First time working with android. I'm look for a way that an android app can connect to a remote database. However, this is on a closed network with no internet connection. Just the phone and the server.
I wanted to know the best way to connect, if its through JDBC or if its possible through android's SQLite class, or something else?
The phone is running android 2.1 and the database is a MySQL database.
Any guidance is much appreciated.
Thanks,
As long as the device is connected to the network, which would have to be via wifi, you can access a MySQL database hosted somewhere on the network just like you normally would.
My advice would be to set up a RESTful web service on the server which hosts the database. Your Android client application can communicate with this web service using HTTP requests and the web service can talk directly to the database. I'd say this is the most common approach for working with remote databases when it comes to Android.
Android Client <==> RESTful Web Service <==> MySQL Database
Android has a couple different ways to communicate with a web service: HttpClient and HttpUrlConnection. I think the latter is generally the most preferred way nowadays.
As far as I know, JDBC is unsupported for Android, and the Android SQLite API is strictly for using an embedded SQLite database.

What to choose in terms of database for an Android app

I am trying to create an Android app similar to google latitude and I am not sure what to use in terms of databases. I thought of using SQLite (which is serverless), but I still need a server in order to make two clients communicate to each other. I am really new with connecting an app with a server or a database, so any help would be appreciated.
I dont believe there is a way to remote connect to any database from Android (could be wrong, but when I check it wasnt possible). Your going to have to use SQLite for your local, and i recommend using MySQL for the server side, and use JSON to retrieve information via a service page.
OK, what you want to do is a client-server architecture. You need to think about what kind of data you want to store, and where to do that.
Obviously, on the server side, you need to store data. It will depends what your server is, and what technology you use for it. This question has nothing to do with Android, as you'll probably communicate to your server using HTTP or another protocol that would allow it to communicate to your android app (the client) and maybe later on, to different kind of clients (web app, iOS, etc.). So you can use any database technology, Oracle, MySQL, Postgres, whatever. You can even build your server application using Microsoft .NET technology, or anything else. You're not tied to Java / Android (although my personal technology stack of choice would probably be a Jetty HTTP server, Oracle database or MySQL if you want lighter, and Java of course).
On the client side, you may also want some data storage, and in this case it depends on the size and complexity of what you want to store. For simple key-value pairs, use SharedPreferences. For more complex data structures, SQLite is your technology of choice.

Categories

Resources