by qlimax » Sun Dec 06, 2009 3:57 pm
The following code works for me....
Using java Syntax Highlighting
TextView tv=(TextView)findViewById(R.id.results);
String[] proj={Media.LATITUDE,Media.LONGITUDE}; // from android.provider.MediaStore.Images.Media
Uri images=Media.EXTERNAL_CONTENT_URI;
Cursor cur=managedQuery(images, proj, null, null, null);
tv.append("Number of results: "+cur.getCount()+"n");
if (cur.moveToFirst()) {
int latCol = cur.getColumnIndex(Media.LATITUDE);
int lonCol = cur.getColumnIndex(Media.LONGITUDE);
do {
double lat = cur.getDouble(latCol);
double lon = cur.getDouble(lonCol);
tv.append(""+lat+" ; "+lon+"n");
} while (cur.moveToNext());
}
Parsed in 0.068 seconds, using
GeSHi 1.0.8.4
on the emulator i have take 3 shots.
and the result is that:
- Code: Select all
Number of results:3
0.0 ; 0.0
0.0 ; 0.0
0.0 ; 0.0
so, basically it works...
let me know.
bye

¯`·.¸¸.><((((º>¯`·.¸¸. ><((((º>