Setting up a local server for SQLite database - Android - android

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.

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.

DB communication suggestion for web/mobile apps

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

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.

How to create a very small data source (1 or 2 tables) for an Android App on a server, not locally?

I am new in this field, so I know that Google's app engine is useful for me. But I do not quite get how to build the database and which data source should be used ?
I need 2 tables for my database to store my data, and I want to connect with that from the Android App, So how does this work ?
I would recommend a NoSQL database like CouchDB or MongoDB.
When using CouchDB you could even have one CouchDB instance running on your server and another one locally on your phone. Your app would work offline and synchronize wiht the server, when connection available.
SQLite is the solution and here is a nice and clean tutorial to refer for the SQLite database.

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