connecting android with mysql - php

hey guys i am developing a final year location-based project(gps) in android.I have to create a server using php and mysql which contains name and location(in latitude and longitude) of important hospitals in Mumbai.The android client should be able to retrieve the the latitude and longitude of locations in mysql(external) database and then plot it on a google map.
Could u plzz tell me whether this is possible?If yes, then how?
Any help would be appreciated....cheers

Your projject would in fact consist of two application. A client running on android, and a server php-mysql application. The client would most likely talk to server using standard http requests.

What is the reason for using the PHP/MySQL combination to achieve this? Unless the list of hospitals is very dynamic it would be far more convenient to just but the data in an SQLite database that Android comes with.
If this is no an option I would put up a simple web service from where you could retrieve your data.

Try this method out. I will be using this method for the current project i am working on.
You basically create a php script on a server and use http posts to send the data to the script, read the tutorial linked below for better explanation.
mysql/android tutorial

Related

Database updates from web host in android

i have a Application with a database and i want update the database from net
i used downloading whole database and extract file in database folder but some time get wrong I'd like some advice if there is a better way to do it
You need to create a webservice. This can be done in PHP (I also use RESTful Api's). These services will return JSON which you can parse through.
Try this out:
http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/

Android - showing events nearby to user

I will take events from some websites. Then will record them to database and show the user when runs the app according to her location.
Using wamp sql database is an old and deprecated way? Like this
http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/
I will only record event names, location.
Should i use a database, right? I will record longitude and latitude. When user runs app, i only retrieve the events according to her locations? For example +100 - 100 meters to the location, calculating longitude latitude.
I am parsing the information from websites. I already did this in java eclipse. I used Phantomjs and jsoup. So, can i migrate them to android without changing or do you suggest anything different?
I really searched those questions but could not find such satisfying answers.
I guess there is no need to use database. You could just get the location of the device. Make a http query to your website. Parse the data by using some method and then you could show to the users.
For parsing i always use OKHTTP with jackson for parsing json data. It will be very convenient assuming your response data will be in json.
You can use jsoup in android. But not phantomjs.

Passing data between forms in different applications

I have a situation here, I want data passed from application developed with PHP and MySQL to my ASP.Net Application. There is this application developed in PHP with MySQL database which was developed by another developer. I have a application or rather I am developing an application in ASP.net and I dont have access source of this application or the database. I want some data from that PHP application to passed to my ASP.net application. What I can do Is colaborate or ask that PHP developer to supply the data in the format I want (XML or Json or any other technology) but I dont think that is secured way to do so. So I want to ask here what is my option here. What should I ask the PHP developer so that I get data into my application using best and secured way.
If my question is not clear
Option 1: Create API to share the needed data across the 2 system
Option 2: Create Link servers to query from mySQL to MS SQL
You don't say how collaboratively you both work, but it sounds like the other developer will provide the data if you have a solution.
So, ask her to create a mySQL user that has read-only access to the database, then you can query it directly.

How to display the values into Android Client from MySQL using PHP Web Service

I have question regarding on how to display the values into the Android Client from online database in MySQL using the PHP Web Service. The idea is such that initially when the activity is displayed, the first record must be displayed in the textview. There would be a button called Next which would display the next record and move the cursor to the next record in the database. My question is that the move to next record logic should be written in which place? That means should I write the move-to-next-record code in the Android client or should I write in the PHP code?
For the basic understanding of how to connect to an online db in Android Client I had referred to the question in this forum itself:
Connect to Remote DB which gave me a good understanding on how to connect to remote db. But here my idea is kind of different which is event based and has to move to the next record and display in the textview. Any hints and suggesstions? Very grateful if you help me! Thank you.
It is really bad idea to connect directly to database. AFAIK, you can create a PHP/MySQL Service to return data in such a format that clients can parse, like popular JSON.
Have a look at this: http://blog.sptechnolab.com/2011/02/10/android/android-connecting-to-mysql-using-php/
Hope it helps!

Upload Device Information to MySQL Database

I would like to submit information about the device in my iphone application. i.e what device is using the application and the date. I would really appreciate it if you could tell me/point me towards how I can upload this information via php to my MySQL database hosted on my website. I would also need to know how to set up this database assumably via php too so that the columns would contain the correct information.
Instead of cooking up your own implementation, have you thought of using something like Flurry? Besides the things you listed above that you'd like to track, Flurry helps you track other useful data. Another analytics service to consider is Google Analytics for Mobile (though it seems a bit rough right now...).
Hope this helps!

Categories