How to connect the live database in android? if anyone know pls tell me how?
You should either use web services or implement an HTTP handler and transfer in a RESTful manner
you use the webservice (url) like php,.net,python.then data stored in the database using the webservice.and response from the server like xml and json.you make the connection to the sever through the get and post request from the server.
Related
I want to read and update data from server (using Apache) to my Android App.
I`m new at the Apache part.can anyone give me a guide for this kind of operation? I already download "XAMPP", and my main goal is to read a JSON into my App, but I believe I can manage also with php .
I know that this is general question but I don't understand at this subject.
Thanks.
the most basic way is to make sure your web server is listening on an open port(usually 80). in your android app send a request to your webserver (url request). on your server hava a script that echos or prints JSON data...
Apache is a web server. You need to connect to it using HTTP. There is an HttpClient and other ways to get http server data, as long as you have a network connection.
I created a small app and with this app I want to send the data (over wifi or bluetooth) to a PC/server.
I am thinking of creating a webservice that will run on the PC and will be listening constantly to any incoming client requests.
Once it receives request from client, the data transfer takes place.And after the webservice receives the data it should automatically open an application/GUI window showing the data received.
My question is Can I create a webservice using TCP/IP in JAVA and have it constantly run in background and listening to client request?
Also how do I start a GUI as soon as the webservice detects a client request and receives the data?
Use SQL Server to manage the data on your desktop and create a web-service in .NET on Visual Studio.
Then connect to the web-service in your application and set/get data from the DB, using web-services.
Links which might be useful :
How to make a web-service in .NET (does not include the implementation in Android) : http://srikanthtechnologies.com/blog/dotnet/wsdaljava.aspx
How to connect your service with Android :
http://seesharpgears.blogspot.in/2010/11/basic-ksoap-android-tutorial.html
http://www.codeproject.com/Articles/304302/Calling-Asp-Net-Webservice-ASMX-From-an-Android-Ap
http://adrianandroid.blogspot.in/2012/05/access-c-net-web-service-in.html
the best way is to create a web service and connect your application to the web service, you can use the tool http://www.wsdl2code.com that create all the needed code for connecting and parsing the data :)
I recommend to use WS on the server-side and you can use Ksoap android library on the client-side. Create a background thread which updates the UI with the new data with. Use AsyncTask, Loader or Handler which is fit for your solution. (Read the official reference for more info).
you can easily achieve this by creating an end-points/routes using node.js or php then host it on the cloud. I think I like firebase for hosting for now, u might wonna try that it really cool. after creating those endpoint which will be connected to ur database then u use http get or post request depending on what u want from ur database in ur mobile app.
if u are creating for android use Retrofit for http connection.
I want to read and write data on my server database from android UI.
I have a host which has MySQL.
any suggestion for me?
Create php to create json for your data on the server.
Use RoboSpice for aysnc loading your json via the network.
See https://github.com/octo-online/robospice
This is your friend. On server side you should create php pages (or another ones) and make requests from your app to these pages.
I want create a android application and i need to connect to a webservice and this web service should have connection to a database.
How is the simple way and free to implement this solution?
How about a PHP server which is (managing a database and) handling HTML POST requests? You could use JSON as communication format. On client side you could even use GSON to hide the JSON handling.
I'm in urgent need of help with a project.
I need to develop an android client, and I don't know how to get data from a database through the internet.
Could I use a socket or maybe send a http request?
Can I query the database on the client directly?
Do you mean a raw MySQL database? If you want to connect over a raw socket you would need a MySQL client on the android, I suggest looking up libraries in whatever language you are using.
Depending on what you're doing, an alternative is creating a web server that will query the database and format some results for you. You could fetch this over http and display it directly. Or you could have the server encode it into json and manipulate that on the android device.