feat(map): add GPS point downsampling and UI density control

This commit is contained in:
n0tst3v3
2026-08-18 23:57:46 -06:00
parent a3587d8720
commit c15dd28f3b
3 changed files with 532 additions and 114 deletions
@@ -17,10 +17,25 @@ public class TrackerDatabase extends SQLiteOpenHelper {
super(context, DB_NAME, null, DB_VERSION);
}
public List<LocationPoint> history(String address, long historyFrom, long historyTo)
public synchronized List<LocationPoint> history(String address, long historyFrom, long historyTo)
{
// TODO: Implement this method
return null;
ArrayList<LocationPoint> result = new ArrayList<LocationPoint>();
if (address == null) return result;
Cursor cursor = getReadableDatabase().query("location_history", null,
"address=? AND logged_at>=? AND logged_at<=?",
new String[] { address, String.valueOf(historyFrom), String.valueOf(historyTo) },
null, null, "logged_at ASC");
try {
while (cursor.moveToNext()) {
LocationPoint point = new LocationPoint();
point.latitude = cursor.getDouble(cursor.getColumnIndex("latitude"));
point.longitude = cursor.getDouble(cursor.getColumnIndex("longitude"));
point.accuracy = cursor.getFloat(cursor.getColumnIndex("accuracy"));
point.timestamp = cursor.getLong(cursor.getColumnIndex("logged_at"));
result.add(point);
}
} finally { cursor.close(); }
return result;
}
public void onCreate(SQLiteDatabase db) {