I'm creating an Android App that would have to access a database on my PC. I know how to program in Java and access a MySQL on my PC using JDBC ODBC. Could anyone lead me to the right place?
android don't support jdbc.
why don't you make a application-server?
the architecture is this.
Android <<--(using REST/JSON)-->>Application-Server(including JDBC or ODBC) <<-->> Database
using json or rest is good to reduce data traffic.
and generally the application server is faster than Android device.
Related
I am just a beginner in android app development and that's why I have many doubts. I am building one application where the user enters some data in editText. Now I want to save that data in my database. My database is running on my laptop. How would my app connect to the database? Do I need a web server in between? If yes then which web server is used for Android apps? Basically, i want to know the flow of data from app to the database.
Study more from Udacity.com, its free.
You may use a jdbc Connector to connect to database.
Connect your jdbc connector over local network ip\servername and database connection string
You can use REST Service when it comes to web Service on Android like this. You can either pass the values as parameters or an Object depending on your requirement. All the best
Wamp server is best option to play with server related utilities.You can use it even if you are offline. and it provides various option for data storage. It Mainly uses MySql and PHP scripts for fast performance.
For More details Click Here
I have a Microsoft SQL Server 2008 database on my local server and I want to create an Android application to send and receive data from this database.
Do I have to upload my database to the cloud first? Where should I start?
If you want to test your android application with localserver or local database you'll need to have an emulator device. (You can use Android Studio's provided default emulator, or you can also install Genymotion that is way better than default emulator of Android studio in terms of speed, performance etc).
If you wan to test the application on real device then you have to upload your php files and databases to a live server.
I'm learning Android development and mostly to retrieve data from the server side databases,I use Async tasks, to obtain data from PHP and MySQL.
I want to know whether is it possible to connect the android application directly to the MySQL database.What would be the adverse effects of doing so? And is there any example on how to perform CRUD operations using such direct MySQL connection?
According to: https://developer.android.com/reference/android/os/NetworkOnMainThreadException.html
you can't networking in main thread and according to:
Can an Android App connect directly to an online mysql database
Connecting to MySQL from Android with JDBC
Direct connection to MySQL in Android is not recommend/not possible.
If you anytime feel like using different Networking Calls. Use Volley, it is fast and better than Asynctask request. As per your question network calls are not possible on Main UI.
Try reading more about Volley which google introduced in 2013. A very good MySQL CRUD example on my blog. here
I'm new to android technology. Can anyone, please, suggest me some proven idea to connect an android application from my laptop to a remote sql database server (without using php). I got connected from my java file to the database. But the output is displayed in the console part. How to get it displayed on the android screen?
For using webservies in Android you will require Ksoap Library.
How can I connect my local database in my application? I have a database which contains a book. I have to display it in my application in J2ME
Basically, in JME, an app can create a database which is a file stored in the RMS. Actually, there are several APIs that can help you in creating a Java ME database: Is there any option for local database like Sqlite for j2me - CLDC devices?
Anyway, I think the data in a sqlite database is not easily accessible to a JME app. It is not impossible but it, maybe, is complicated. Honestly, I don't know anyway to do it.
You have to create a server application where you access to database. Also your J2ME has to communicate with your server application for getting Data you want to display (Use HttpConnection Class).
In Mobile Application, you can not directly make connection with local or remote database. To Make Connection with Database , you need a middle tier called a web service. You can create web service in any platform like Java-Servlet, .net or in PHP. See this is a very simple example to work with MySql Database.