Вы хотели бы сделать запрос, подобный этому:
SELECT title, description, latitude, longitude
FROM place
Что можно сделать в Android следующим образом:
/*
databaseObject = YourDbHelper#getReadableDatabase();
*/
ArrayList<OverlayItem> items = new ArrayList<OverlayItem>();
Cursor locationCursor = databaseObject.query("place", new String[]{
"title", "description", "latitude", "longitude"}, null, null,
null, null, null);
locationCursor.moveToFirst();
do {
String title = locationCursor.String(locationCursor
.getColumnIndex("title"));
String description = locationCursor.String(locationCursor
.getColumnIndex("description"));
int latitude = (int) (locationCursor.getDouble(locationCursor
.getColumnIndex("latitude")) * 1E6);
int longitude = (int) (locationCursor.getDouble(locationCursor
.getColumnIndex("longitude")) * 1E6);
items.add(new OverlayItem(new GeoPoint(latitude, longitude), title,
description));
} while (locationCursor.moveToNext());
Вам необходимо умножить значения на 1E6, потому что Android использует целочисленное представление значений lat / long. Если вы уже позаботились об этом при заполнении базы данных, пропустите умножение и используйте locationCursor.getInt(...)
.