Get Latitude and Longitude from SQLite database for use in Android MapOverlay -
How do I get these values if I store the latitude and longitude of a bunch of locations in the SQLite database And will I move them into an OverlayItem class for use in Google's map code?
Database Name: Table Name: How do I get latitude and longitude data for each location And add it to an Arrayite item overlay? Do you have any ideas or an example? Thank you very much You want to do a query like this: This can be done in Android: You have to multiply values up to 1E6 because Android uses an integer representation of latitude / long values if you already take care of it, then when you create a database, multiply Skip and Database
Location Location Table:
id
title
details
latitude
longitude
< Code> Choose from title, description, latitude, location
/ * databaseObject = yourDbHelper #getReadableDatabase (); * / Arrestist & lt; Overlayem & gt; Item = new arreelist & lt; Overlayem & gt; (); Cursor space casser = database object.query ("location", new string [] {"title", "description", "latitude", "longitude"}, empty, empty, empty, null, blank); LocationCursor.moveToFirst (); Do {String Title = Location Kansas. String (location cursor .getColumnIndex ("title")); String description = locationCursor.String (location cursor .getColumnIndex ("description")); Int latitude = (int) (place cursor gate (location cursor .getColumnIndex ("latitude")) * 1a6); Int longitude = (int) (space cursor gate (location cursor .getColumnIndex ("longitude")) * 1a6); Items.add (new overlayem (new GeoPoint (latitude, longitude), title, description)); } While (locationCursor.moveToNext ());
locationCursor.getInt (...) .
Comments
Post a Comment