connecting to mysql databsae with json on android map
does anyone have any json tutorials that are easy enough to understand for a complete beginner (or if possible someone to show mehow to do it :)?
what i'm attempting is to create and android application that retrieves longitude and lattitude coordinates from my mysql database then displays an image on the map where the coordinate matches up. when clicked an overlay appears and displays the event name and address for event.
what i've been able to achieve is the following: 1) create android map project 2)display a fixed coordinate that is saved within the source (not what i want to do but hey) 3)when 2 is clicked an overlay appears with some text that is saved within the source (again not what i want but a start) the long+lat and name + address of the event are lo开发者_StackOverflowcated within the database. i've been made aware that i will need to use json (as i don't know how to use it i'm asking for a noob proof tutorial)
i've had a look at connecting to mysql database the best i've been able to achieve on this is upto the php part. after this i don't understand what needs to be done (hence the request)
here is a good article to fetch data from mysql using json, http://blog.sptechnolab.com/2011/02/10/android/android-connecting-to-mysql-using-php/. and here is another link that used to display location on google map, http://blog.sptechnolab.com/2011/01/01/android/getting-started-with-android-map-view/.
no offense taken... you need to break down your big problem into smaller problems.
Phone <---magic----> server
the 3 keys parts are the phone stuff, the server stuff and the 'how they talk' stuff. Answering each of these here is a bit beyond the scope of the question but hopefully this will start you on the path enlightenment (of which there are many). The phone and the server where this data comes from need to communicate somehow. An easy way to this is using JSON (over http). The phone also needs to know what it can ask the server, which is handled (in very general terms) by using API of sorts. A good start would probably be look here (and on google) for things such as 'using a web service in an Android App'.
精彩评论