I'm developing an app that inserts data into database without using any webservies. I've created a database on my notebook with MySQL workbench. I am able to insert data into the database using emulator, but I cannot insert data into the database using my phone.
I have changed the path from
jdbc:mysql://10.0.2.2:3306/ with jdbc:mysql://xx.xx.xx.xx:3306/
xx.xx.xx.xx is from ipconfig of my localhost machine. I've tried again with emulator and I'm still able to insert data, but when I try with phone I cannot. What could be the reason?
You can't access a MySQL DB from Android natively. EDIT: Actually you may be able to use JDBC, but it is not recommended (or may not work?) ... see
Android JDBC not working: ClassNotFoundException on driver
Android cannot connect directly to the database server. Therefore we need to create a simple web service that will pass the requests to the database and will return the response.
See this tutorial:
how-to-connect-android-with-php-mysql
Related
i have a database in my laptop. i want to access it from an android application. since i am new in this field, i don't have a least idea about connection android with oracle. please suggest me how to do it?
i am using oracle 10g express edition. i want to retrieve a table data to my android app from my database.
please give me the codes that i will need to perform this task.
what files do i need to perform the connection.
Thank you
You should put a rest or soap service in front of your rdbms and let your mobile app communicate with it.
For php webservice (on a windows based machine) you can setup xampp with php oci8 drivers and oracle instant client.
You can use http post or get method from your android app to transfer data from your app to your webservice and vice versa. You can execute your sql queries from your php script(webservice).
If you don't want to build up you're own web service, then you can use oracle database mobile server
http://www.oracle.com/technetwork/products/database-mobile-server/overview/index.html
You need simple java util see attach
https://docs.oracle.com/javase/tutorial/jdbc/basics/processingsqlstatements.html
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/
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.
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
I'm developing an application in android. I use an sqlite3 database. But I need to implement in mysql database using wamp server.
You'll have to use PHP scripts which handle all the database things on your WAMP.
This script will react as a bridge between your MySql and Android.
After this, make network requests to this script from your Android device and get data returned by the database.
You must understand that MySql isn't available to Android devices locally, thus you can't access it the way you access sqlite on a device. To get this, you'll have to implement something like a webservice.