This is from another thread, but I am trying desperately to store GPS latitude and longitude data within an SQLite database.
I have created a SQLite database in a separate class to my main activity and I am using this below when the location updates:
Using java Syntax Highlighting
- public void onLocationChanged(Location loc) {
- Log.e(TAG, loc.toString());
- ContentValues values = new ContentValues();
- Double lon = loc.getLongitude();
- Long time = loc.getTime();
- values.put(GPSData.GPSPoint.LONGITUDE, loc.getLongitude());
- values.put(GPSData.GPSPoint.LATITUDE, loc.getLatitude());
- values.put(GPSData.GPSPoint.TIME, loc.getTime());
- getContentResolver().insert(GPSDataContentProvider.CONTENT_URI, values);
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
Apparently this line is throwing an error:
and the Double long and long time are not being read? does this matter?



). But I am unable to store the gps co-ordinates in a variable/array/object or anything like that. The app crashes. Could you please tell me how do I save and then send it through the socket.
