I have a lot of nice ideas to develop into Web and Mobile applications, most of them need an online DB communication. However, I don't know nothing how to configure a fresh DB server from the scratch and start queries and requesting it. Even with DB basis acquired during my graduation.
What I don't know is what to use. If I need a DBMS or build my own server from scratch (which I would like to avoid to save time).
So, I don't want to develop a DB server (back-end, such as PhP, Java, etc...). I need a ready-to-use back-end to send my queries and request to it.
Any suggestion, or tutorial how to configure it? Like deploying on AWS...
many thanks, in advance!!!
I've developed some card game apps that use databases for leaderboards and multiplayer data. I found that using http to access php scripts which in turn access mySQL databases and json encode the result certainly works and is reliable. You will need to write a bit of php and set up the databases but other than that it's quite straightforward. If you keep your http access in a seperate thread in the app you can do visual and input processing whilst waiting for the result.
You don't have to build database server yourself. Database services are available from some companies. Some are:
Amazon Relational Database Service (Amazon RDS)
Google Cloud SQL
Windows Azure SQL Database (SQL Azure)
Clear DB
Related
I am developing an android application. I want to update the local SQLite database with MySQL database on server. I am not able to figure out that what is the most appropriate and standardized way to do so?
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 may want to take a look at fyrecloud.com/amsler This is source code for a demonstration Android application that implements MySQL replication between a MySQL server and the SQLite db on an Android device.
Amsler rests on two pillars:
It communicates with the MySQL server using the MySQL Client/Server protocol in order to connect to the server for authentication and for receiving replication events as they occur.
It uses the Antlr lex and parse software in order to lex and parse incoming replication events and then to translate the MySQL commands into equivalent SQLite commands.
This is great for one-way replication. You can simulate two-way replication by modifying the MySQL server indirectly via RESTful type methods and then watching while MySQL sends a new replication event back.
Accessing a server via REST is easy enough. However, modifying an existing MySQL installation in order to support serialization presents too many headaches to enumerate here. Amsler takes advantage of pre-existing replication services. REST also depends upon some polling strategy in order to keep the local device reasonably up-to-date. Again, many problems with this approach. Amsler maintains a TCP/IP connection to the server which enables server-push notification of updates.
The most difficult part of Amsler is in figuring out the lexing/parsing. The Syntax between MySQL, SQLite, and the various versions of the same have many subtle differences. So many differences that it's impractical to provide a shrink-wrap translator and instead you must resort to modifying the grammar yourself.
Nevertheless, good, bad, or ugly, here it is. Take a look and maybe the glove fits.
This is probably going to be helpful: sync databases Mysql SQLite
The real answer is that there is no standard or built in magic way to just copy a MySQL database that lives on a server somewhere to a device. You will have to implement either a webservice or somehow convert the MySQL db on the server to the android sqlite implementation and download that file into your app's data directory (not a route I'd recommend taking).
Late to the party, but http://www.symmetricds.org/ is a good solution.
Java, runs on Android too.
LGPL.
Can handle 10,000's of clients.
There is no standard way. Depending on your needs you can e.g. use webservices in REST or SOAP protocols or more binary data exchange.
I've created a pre-made database in SQLite for an Android app I'm developing. The app should interact and pull data from the database and display it on different 'Intents'. For now I just want to set up a local server on my Windows Computer for the database.
I was wondering what is the best way of doing so? I have little to no experience with setting up local servers or anything with regards to servers.
Thanks for any help!
There is no such thing as an SQLite "server". SQLite runs locally only through libraries. Also, Android database connections can not simply connect to anything on a server.
If you need a database on a server and an Android client to manipulate the data, you need to implement some kind of client-server architecture, for example using (RESTful) WEB services or any other client-server-communication.
my application needs to store data locally on sqlite DB and user can upload data on server once the internet connection is available.
I assume I need to do some DB replication, how to accomplish that?
Is there any android built in facility?
Or I need to use some third party tool for that?
I read many answers on this but I am still not clear about it, I will use KSOAP2 web service for communicating with server.
Using KSOAP2 how can I Sync my sqlite data on SQL Server?
below are few links I read.
https://stackoverflow.com/questions/18207021/opensource-replication-tool-for-sqlite
Regarding sqlite replication
Does SQLite support replication?
Thanks in advance.
You shouldn't use dumps to copy the whole database back and forth. Android is running on mobile devices and datatransfer is likely to cost money or to be limited by speed or volumne or other means.
Therefore you should build your own webserver and upload/download only the changed entries. This means you will probably have to implement your own replication-logic, since I don't know any tools for that.
For example you can send a timestamp and the server replies with a set of changed data.
I'd recommend building a Restful-Webservice and using HttpUrlConnection to build POST, PUT, GET and DELETE requests.
GreenDao proposes a project for client/server-synchronization. But there is no estimation on when it will be available. If you do something yourself, you could try doing it as greendao-feature. A lot of people will thank you for that (myself included :D).
You can also have a look at symmetricDS, which should work on android.
Im developing an android app, and would like to have a database stored somewhere online. My app is a native app. I checked the android development page and it just shows how to store to the SQLite database.
Are there any resources out there that would help with this? Are there any framework such as the ADO.net entity framework that can with with doing databasing?
The safest and easiest way I know of, is using a webservice which would interact with the online DB (PHP and MySQL works great together, and also many free web host provides them.
Then you can perform POST or GET requests from your app to the webservice, which will query the DB (update it, read from it, etc)
https://www.google.com/search?q=php+mysql+webservice
http://www.androidsnippets.com/executing-a-http-post-request-with-httpclient
Links to get you started...
I have experience building android applications but now I would like to start building applications that interact with some sort of web database to push and pull data.
What type of database should i set up on a remote server for my application to interact with? From what i understand I need a database on the remote server and some service that my android app can communicate with?
What can i read that will clear up how this works and how i can get started?
The easiest (and often most flexible) combination in my opinion is PHP and MySQL. PHP as the scripting language which is called (via http) from the app, and handles all the database access. MySQL as the database. PostgreSQL is also an option for the database, of course. And if you have access to .NET, JSP or something like that, that's also an option. But a web server with Apache, PHP and MySQL is free, powerful and easy to maintain, and most/many web hosts have them.
The way it works (which is the same no matter what kind of webbased services/servers you chose), is this:
- The database is installed on the server
- You have a web area (on the web server) which has access to the database (this is how it will be with a typical web hotel solution)
- You place your scripts (f.ex. PHP) in the web area
- The web scripts access the databse, with functions for fetching and/or storing information
- Your app uses httpclient or something similar to send http GET or POST requests to the PHP scripts, either sending information or asking for information, or both
It's also quite possible to write database access code directly in your app (this is very easy in Java and C#, compared to languages like C og C++). However, most hosts don't allow remote access to their database servers, so you'd most likely have to set up a database server yourself. Also, accessing the database server directly is a security risk, and I wouldn't recommend it.
As to what you can read, there's lots and lots of tutorials, howtos and concrete examples on the net. Search for "php access mysql databse", f.ex., for ideas on how to write php scripts that handles the database transaction(s). If you have a more detailed decription, I might be able to point you to something more specific.
I strongly suggest adding web service layer between your application and database, using i.e. JSON or XML. Exposing DB directly ma be security risk and is rarely the way to go.