I'm new developing android and web apps, I would like to know if is it possible to connect a mySQL DB already hosted in a website provide by phpmyadmin plataform just creating an interface to the android app? 'cause I just want to host the DB on the DNS to acess inside the app and don't want to show any interface if someone try to acess my DNS
if possible please explain details how am I able to get this, thank you very much
you can use Mysql Database which is in hosted in your website by using Php progrmamming.
For this Read How to connect Android with PHP, MySQL.
or otherwise you just do the following.
1) create db file
2) host the db file in database.
3) download the db file to the device and you can use that db file.
Have a good luck..
Related
I need to make a app that adds data to local SQLite database and uploads data to a database so other people that use the app can download that data. I thought about loading SQLite database to online storage but I do not know how to do that or what the best way is.
This is one of the simple approach:
Your app <--->PHP webpage <----> sqlite (on server) --->url of SQLite to download
Your app need to connect to a web api, such as PHP, that can handle sqlite. You can perform sql operators via the api and then get the sqlite file by simply using its URL.
Tutorial
1.First create sqlite database
2.then create oracle database
Setup Apache server like xampp. After setup open php.ini. then delete ; before oci8.dll. then save.
C:xampp/htdocs create php webservice .
5.Call php webservice from android for download upload data.
If you can't I will help you
Is it possible to connect to a mysql database using android service and asynctask without using any server site scripts such as php??
My application needs to create an offline replica database, and synchronize if updated by user.
Please give suggestion and possible links, references or code.
Thanks in advance.
be aware of this :
if you connect to a remote DataBase without using a webService you will store the database login credentials inside your app. so it'll be easy to extract your login for that database and access and edit it even destroy it by decompiling your app.
I have a web application on Android and iOS which uses html and javascript for the project. I now have local values and app works fine. now I want to use a mysql database for my inputs, are there any good tutorial or sample codes on how to do that.
I'll appreciate if you can help me with this.
Thanks
For web app and mysql communication need a scripting language like php and for database you need a database like mysql there is simple tutorial fo mysql connectivity
http://www.androidhive.info/2013/12/android-populating-spinner-data-from-mysql-database/
You need to choose a language that will operate server side to manage the database of your web app, e.g. you could use PHP as a language and MYSQL as a database software (it's free and awesome), for examples you could use http://php.net/ and search how to use specific mysql commands in PHP, or use a framework like CodeIgniter which has built in functions for database management and you can view some of them here https://ellislab.com/codeigniter/user-guide/database/active_record.html, but make sure you use the whole user guide on how to use it and how to set up your database configuration properly!
EDIT. If you don't want to use PHP for the actual app then you can use it server side, i.e. use it as part of a server file which connect to database, handle data, send it back, then send it back to your remote app where you can handle it with Javascript.
I'm new to android and I've created sample application that retrieve data from MySql DB (through PHP script) ..and its working fine on android simulator but my problem is when i tested the application on my mobile device there is no data retrieved !
I think this is because my DB on localhost so what is the correct way to retrieve data from my database to real device ? Is there specific IP should i use for this purpose ?
knowing that I've used WAMP server to create mysql database.
Any help is highly appreciated .
I think the easiest way is to host your database on a free database hosting site and connect to that.
You can try http://www.000webhost.com/free-mysql-hosting (Havent tried it but have heard it works)
Other free services:
http://www.frihost.com/
http://www.freesql.org/
How can I connect MySQL and Android?
I have MySQL db in remote I want get the values from that database and display those content in Androidlist view. I have tried many web service samples, but I have met some problems.
I have tried this using json and php from this link http://blog.sptechnolab.com/2011/02/10/android/android-connecting-to-mysql-using-php/ , but my app quits
There is no JDBC driver for android / MySQL. So you can't connect to your database as a desktop application or a web server would.
You then have to write a small interface, typically a web server to make your mysql data available, and then write a small android client, usually parsing xml stuff from your server.
That's the way to go, the very big picture, but your question is vast and fuzzy, that's the best answer I can give you.
There are various way to access mysql database from android.
You can access data from web services for ksoap2-android lib is good fro that. Click for web services example web-services example
You can also use Http connection or socket programming.
This have been repeatedly in SO, here a i leave you with some samples
SO
Connect MySQL database from Android
Get data to android app from mysql server
How to connect to a MySQL Database from an Android App?
android remote database connection trouble
mysql db connection
Connect MySQL database from Android
And also in other places,
AndDev
[TUTORIAL] Connecting to MySQL database
HELP with a Tutorial for connection using MySql
More
But wait there is more :D, on google