forked from upstream-mirrors/OpenTracks
Lint cleanup.
This commit is contained in:
+3
-3
@@ -35,13 +35,13 @@ public interface DescriptionGenerator {
|
||||
* @param elevations a vector of elevations to generate the elevation chart
|
||||
* @param html true to output html, false to output plain text
|
||||
*/
|
||||
public String generateTrackDescription(
|
||||
Track track, Vector<Double> distances, Vector<Double> elevations, boolean html);
|
||||
String generateTrackDescription(
|
||||
Track track, Vector<Double> distances, Vector<Double> elevations, boolean html);
|
||||
|
||||
/**
|
||||
* Generate a waypoint description from a trip statistics.
|
||||
*
|
||||
* @param tripStatistics the trip statistics
|
||||
*/
|
||||
public String generateWaypointDescription(TripStatistics tripStatistics);
|
||||
String generateWaypointDescription(TripStatistics tripStatistics);
|
||||
}
|
||||
|
||||
+43
-43
@@ -38,45 +38,45 @@ public interface MyTracksProviderUtils {
|
||||
* The authority (the first part of the URI) for the My Tracks content
|
||||
* provider.
|
||||
*/
|
||||
public static final String AUTHORITY = "com.google.android.maps.mytracks";
|
||||
String AUTHORITY = "com.google.android.maps.mytracks";
|
||||
|
||||
/**
|
||||
* Clears a track. Removes waypoints and trackpoints. Only keeps the track id.
|
||||
*
|
||||
* @param trackId the track id
|
||||
*/
|
||||
public void clearTrack(Context context, long trackId);
|
||||
void clearTrack(Context context, long trackId);
|
||||
|
||||
/**
|
||||
* Creates a {@link Track} from a cursor.
|
||||
*
|
||||
* @param cursor the cursor pointing to the track
|
||||
*/
|
||||
public Track createTrack(Cursor cursor);
|
||||
Track createTrack(Cursor cursor);
|
||||
|
||||
/**
|
||||
* Deletes all tracks (including waypoints and track points).
|
||||
*/
|
||||
public void deleteAllTracks(Context context);
|
||||
void deleteAllTracks(Context context);
|
||||
|
||||
/**
|
||||
* Deletes a track.
|
||||
*
|
||||
* @param trackId the track id
|
||||
*/
|
||||
public void deleteTrack(Context context, long trackId);
|
||||
void deleteTrack(Context context, long trackId);
|
||||
|
||||
/**
|
||||
* Gets all the tracks. If no track exists, an empty list is returned.
|
||||
* <p>
|
||||
* Note that the returned tracks do not have any track points attached.
|
||||
*/
|
||||
public List<Track> getAllTracks();
|
||||
List<Track> getAllTracks();
|
||||
|
||||
/**
|
||||
* Gets the last track. Returns null if doesn't exist.
|
||||
*/
|
||||
public Track getLastTrack();
|
||||
Track getLastTrack();
|
||||
|
||||
/**
|
||||
* Gets a track by a track id. Returns null if not found.
|
||||
@@ -85,7 +85,7 @@ public interface MyTracksProviderUtils {
|
||||
*
|
||||
* @param trackId the track id.
|
||||
*/
|
||||
public Track getTrack(long trackId);
|
||||
Track getTrack(long trackId);
|
||||
|
||||
/**
|
||||
* Gets a track cursor. The caller owns the returned cursor and is responsible
|
||||
@@ -95,7 +95,7 @@ public interface MyTracksProviderUtils {
|
||||
* @param selectionArgs the selection arguments. Can be null
|
||||
* @param sortOrder the sort order. Can be null
|
||||
*/
|
||||
public Cursor getTrackCursor(String selection, String[] selectionArgs, String sortOrder);
|
||||
Cursor getTrackCursor(String selection, String[] selectionArgs, String sortOrder);
|
||||
|
||||
/**
|
||||
* Inserts a track.
|
||||
@@ -105,7 +105,7 @@ public interface MyTracksProviderUtils {
|
||||
* @param track the track
|
||||
* @return the content provider URI of the inserted track.
|
||||
*/
|
||||
public Uri insertTrack(Track track);
|
||||
Uri insertTrack(Track track);
|
||||
|
||||
/**
|
||||
* Updates a track.
|
||||
@@ -114,14 +114,14 @@ public interface MyTracksProviderUtils {
|
||||
*
|
||||
* @param track the track
|
||||
*/
|
||||
public void updateTrack(Track track);
|
||||
void updateTrack(Track track);
|
||||
|
||||
/**
|
||||
* Creates a waypoint from a cursor.
|
||||
*
|
||||
* @param cursor the cursor pointing to the waypoint
|
||||
*/
|
||||
public Waypoint createWaypoint(Cursor cursor);
|
||||
Waypoint createWaypoint(Cursor cursor);
|
||||
|
||||
/**
|
||||
* Deletes a waypoint. If deleting a statistics waypoint, this will also
|
||||
@@ -132,7 +132,7 @@ public interface MyTracksProviderUtils {
|
||||
* @param descriptionGenerator the description generator. Can be null for
|
||||
* waypoint marker
|
||||
*/
|
||||
public void deleteWaypoint(Context context, long waypointId, DescriptionGenerator descriptionGenerator);
|
||||
void deleteWaypoint(Context context, long waypointId, DescriptionGenerator descriptionGenerator);
|
||||
|
||||
/**
|
||||
* Gets the first waypoint id for a track. The first waypoint is special as it
|
||||
@@ -140,7 +140,7 @@ public interface MyTracksProviderUtils {
|
||||
*
|
||||
* @param trackId the track id
|
||||
*/
|
||||
public long getFirstWaypointId(long trackId);
|
||||
long getFirstWaypointId(long trackId);
|
||||
|
||||
/**
|
||||
* Gets the last waypoint for a type. Returns null if it doesn't exist.
|
||||
@@ -148,7 +148,7 @@ public interface MyTracksProviderUtils {
|
||||
* @param trackId the track id
|
||||
* @param waypointType the waypoint type
|
||||
*/
|
||||
public Waypoint getLastWaypoint(long trackId, WaypointType waypointType);
|
||||
Waypoint getLastWaypoint(long trackId, WaypointType waypointType);
|
||||
|
||||
/**
|
||||
* Gets the next waypoint number for a type. Returns -1 if not able to get the
|
||||
@@ -157,14 +157,14 @@ public interface MyTracksProviderUtils {
|
||||
* @param trackId the track id
|
||||
* @param waypointType the waypoint type
|
||||
*/
|
||||
public int getNextWaypointNumber(long trackId, WaypointType waypointType);
|
||||
int getNextWaypointNumber(long trackId, WaypointType waypointType);
|
||||
|
||||
/**
|
||||
* Gets a waypoint from a waypoint id. Returns null if not found.
|
||||
*
|
||||
* @param waypointId the waypoint id
|
||||
*/
|
||||
public Waypoint getWaypoint(long waypointId);
|
||||
Waypoint getWaypoint(long waypointId);
|
||||
|
||||
/**
|
||||
* Gets a waypoint cursor. The caller owns the returned cursor and is
|
||||
@@ -176,8 +176,8 @@ public interface MyTracksProviderUtils {
|
||||
* @param maxWaypoints the maximum number of waypoints to return. -1 for no
|
||||
* limit
|
||||
*/
|
||||
public Cursor getWaypointCursor(
|
||||
String selection, String[] selectionArgs, String sortOrder, int maxWaypoints);
|
||||
Cursor getWaypointCursor(
|
||||
String selection, String[] selectionArgs, String sortOrder, int maxWaypoints);
|
||||
|
||||
/**
|
||||
* Gets a waypoint cursor for a track. The caller owns the returned cursor and
|
||||
@@ -188,14 +188,14 @@ public interface MyTracksProviderUtils {
|
||||
* @param maxWaypoints the maximum number of waypoints to return. -1 for no
|
||||
* limit
|
||||
*/
|
||||
public Cursor getWaypointCursor(long trackId, long minWaypointId, int maxWaypoints);
|
||||
Cursor getWaypointCursor(long trackId, long minWaypointId, int maxWaypoints);
|
||||
|
||||
/**
|
||||
* Gets the number of waypoints for a track.
|
||||
*
|
||||
* @param trackId the track id
|
||||
*/
|
||||
public int getWaypointCount(long trackId);
|
||||
int getWaypointCount(long trackId);
|
||||
|
||||
/**
|
||||
* Inserts a waypoint.
|
||||
@@ -203,14 +203,14 @@ public interface MyTracksProviderUtils {
|
||||
* @param waypoint the waypoint
|
||||
* @return the content provider URI of the inserted waypoint.
|
||||
*/
|
||||
public Uri insertWaypoint(Waypoint waypoint);
|
||||
Uri insertWaypoint(Waypoint waypoint);
|
||||
|
||||
/**
|
||||
* Updates a waypoint. Returns true if successful.
|
||||
*
|
||||
* @param waypoint the waypoint
|
||||
*/
|
||||
public boolean updateWaypoint(Waypoint waypoint);
|
||||
boolean updateWaypoint(Waypoint waypoint);
|
||||
|
||||
/**
|
||||
* Inserts multiple track points.
|
||||
@@ -221,28 +221,28 @@ public interface MyTracksProviderUtils {
|
||||
* @param trackId the track id
|
||||
* @return the number of points inserted
|
||||
*/
|
||||
public int bulkInsertTrackPoint(Location[] locations, int length, long trackId);
|
||||
int bulkInsertTrackPoint(Location[] locations, int length, long trackId);
|
||||
|
||||
/**
|
||||
* Creates a location object from a cursor.
|
||||
*
|
||||
* @param cursor the cursor pointing to the location
|
||||
*/
|
||||
public Location createTrackPoint(Cursor cursor);
|
||||
Location createTrackPoint(Cursor cursor);
|
||||
|
||||
/**
|
||||
* Gets the first location id for a track. Returns -1L if it doesn't exist.
|
||||
*
|
||||
* @param trackId the track id
|
||||
*/
|
||||
public long getFirstTrackPointId(long trackId);
|
||||
long getFirstTrackPointId(long trackId);
|
||||
|
||||
/**
|
||||
* Gets the last location id for a track. Returns -1L if it doesn't exist.
|
||||
*
|
||||
* @param trackId the track id
|
||||
*/
|
||||
public long getLastTrackPointId(long trackId);
|
||||
long getLastTrackPointId(long trackId);
|
||||
|
||||
/**
|
||||
* Gets the track point id of a location.
|
||||
@@ -251,7 +251,7 @@ public interface MyTracksProviderUtils {
|
||||
* @param location the location
|
||||
* @return track point id if the location is in the track. -1L otherwise.
|
||||
*/
|
||||
public long getTrackPointId(long trackId, Location location);
|
||||
long getTrackPointId(long trackId, Location location);
|
||||
|
||||
/**
|
||||
* Gets the first valid location for a track. Returns null if it doesn't
|
||||
@@ -259,20 +259,20 @@ public interface MyTracksProviderUtils {
|
||||
*
|
||||
* @param trackId the track id
|
||||
*/
|
||||
public Location getFirstValidTrackPoint(long trackId);
|
||||
Location getFirstValidTrackPoint(long trackId);
|
||||
|
||||
/**
|
||||
* Gets the last valid location for a track. Returns null if it doesn't exist.
|
||||
*
|
||||
* @param trackId the track id
|
||||
*/
|
||||
public Location getLastValidTrackPoint(long trackId);
|
||||
Location getLastValidTrackPoint(long trackId);
|
||||
|
||||
|
||||
/**
|
||||
* Gets the last valid location.
|
||||
*/
|
||||
public Location getLastValidTrackPoint();
|
||||
Location getLastValidTrackPoint();
|
||||
|
||||
/**
|
||||
* Creates a location cursor. The caller owns the returned cursor and is
|
||||
@@ -284,8 +284,8 @@ public interface MyTracksProviderUtils {
|
||||
* @param descending true to sort the result in descending order (latest
|
||||
* location first)
|
||||
*/
|
||||
public Cursor getTrackPointCursor(
|
||||
long trackId, long startTrackPointId, int maxLocations, boolean descending);
|
||||
Cursor getTrackPointCursor(
|
||||
long trackId, long startTrackPointId, int maxLocations, boolean descending);
|
||||
|
||||
/**
|
||||
* Creates a new read-only iterator over a given track's points. It provides a
|
||||
@@ -304,8 +304,8 @@ public interface MyTracksProviderUtils {
|
||||
* location first)
|
||||
* @param locationFactory the location factory
|
||||
*/
|
||||
public LocationIterator getTrackPointLocationIterator(
|
||||
long trackId, long startTrackPointId, boolean descending, LocationFactory locationFactory);
|
||||
LocationIterator getTrackPointLocationIterator(
|
||||
long trackId, long startTrackPointId, boolean descending, LocationFactory locationFactory);
|
||||
|
||||
/**
|
||||
* Inserts a track point.
|
||||
@@ -314,41 +314,41 @@ public interface MyTracksProviderUtils {
|
||||
* @param trackId the track id
|
||||
* @return the content provider URI of the inserted track point
|
||||
*/
|
||||
public Uri insertTrackPoint(Location location, long trackId);
|
||||
Uri insertTrackPoint(Location location, long trackId);
|
||||
|
||||
/**
|
||||
* A lightweight wrapper around the original {@link Cursor} with a method to
|
||||
* clean up.
|
||||
*/
|
||||
public interface LocationIterator extends Iterator<Location> {
|
||||
interface LocationIterator extends Iterator<Location> {
|
||||
|
||||
/**
|
||||
* Gets the most recently retrieved track point id by {@link #next()}.
|
||||
*/
|
||||
public long getLocationId();
|
||||
long getLocationId();
|
||||
|
||||
/**
|
||||
* Closes the iterator.
|
||||
*/
|
||||
public void close();
|
||||
void close();
|
||||
}
|
||||
|
||||
/**
|
||||
* A factory for creating new {@link Location}.
|
||||
*/
|
||||
public interface LocationFactory {
|
||||
interface LocationFactory {
|
||||
|
||||
/**
|
||||
* Creates a new {@link Location}. An implementation can create new
|
||||
* instances or reuse existing instances for optimization.
|
||||
*/
|
||||
public Location createLocation();
|
||||
Location createLocation();
|
||||
}
|
||||
|
||||
/**
|
||||
* The default {@link LocationFactory} which creates a location each time.
|
||||
*/
|
||||
public LocationFactory DEFAULT_LOCATION_FACTORY = new LocationFactory() {
|
||||
LocationFactory DEFAULT_LOCATION_FACTORY = new LocationFactory() {
|
||||
@Override
|
||||
public Location createLocation() {
|
||||
return new MyTracksLocation(LocationManager.GPS_PROVIDER);
|
||||
@@ -359,7 +359,7 @@ public interface MyTracksProviderUtils {
|
||||
* A factory which can produce instances of {@link MyTracksProviderUtils}, and
|
||||
* can be overridden for testing.
|
||||
*/
|
||||
public static class Factory {
|
||||
class Factory {
|
||||
|
||||
private static Factory instance = new Factory();
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public final class Sensor {
|
||||
|
||||
private final int index;
|
||||
private final int value;
|
||||
private SensorState(int index, int value) {
|
||||
SensorState(int index, int value) {
|
||||
this.index = index;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
+17
-17
@@ -31,25 +31,25 @@ import android.provider.BaseColumns;
|
||||
*/
|
||||
public interface TrackPointsColumns extends BaseColumns {
|
||||
|
||||
public static final String TABLE_NAME = "trackpoints";
|
||||
public static final Uri CONTENT_URI = Uri.parse(
|
||||
String TABLE_NAME = "trackpoints";
|
||||
Uri CONTENT_URI = Uri.parse(
|
||||
"content://com.google.android.maps.mytracks/trackpoints");
|
||||
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.google.trackpoint";
|
||||
public static final String CONTENT_ITEMTYPE = "vnd.android.cursor.item/vnd.google.trackpoint";
|
||||
public static final String DEFAULT_SORT_ORDER = "_id";
|
||||
String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.google.trackpoint";
|
||||
String CONTENT_ITEMTYPE = "vnd.android.cursor.item/vnd.google.trackpoint";
|
||||
String DEFAULT_SORT_ORDER = "_id";
|
||||
|
||||
// Columns
|
||||
public static final String TRACKID = "trackid"; // track id
|
||||
public static final String LONGITUDE = "longitude"; // longitude
|
||||
public static final String LATITUDE = "latitude"; // latitude
|
||||
public static final String TIME = "time"; // time
|
||||
public static final String ALTITUDE = "elevation"; // altitude
|
||||
public static final String ACCURACY = "accuracy"; // accuracy
|
||||
public static final String SPEED = "speed"; // speed
|
||||
public static final String BEARING = "bearing"; // bearing
|
||||
public static final String SENSOR = "sensor"; // sensor
|
||||
String TRACKID = "trackid"; // track id
|
||||
String LONGITUDE = "longitude"; // longitude
|
||||
String LATITUDE = "latitude"; // latitude
|
||||
String TIME = "time"; // time
|
||||
String ALTITUDE = "elevation"; // altitude
|
||||
String ACCURACY = "accuracy"; // accuracy
|
||||
String SPEED = "speed"; // speed
|
||||
String BEARING = "bearing"; // bearing
|
||||
String SENSOR = "sensor"; // sensor
|
||||
|
||||
public static final String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " ("
|
||||
String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " ("
|
||||
+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
|
||||
+ TRACKID + " INTEGER, "
|
||||
+ LONGITUDE + " INTEGER, "
|
||||
@@ -62,7 +62,7 @@ public interface TrackPointsColumns extends BaseColumns {
|
||||
+ SENSOR + " BLOB"
|
||||
+ ");";
|
||||
|
||||
public static final String[] COLUMNS = {
|
||||
String[] COLUMNS = {
|
||||
_ID,
|
||||
TRACKID,
|
||||
LONGITUDE,
|
||||
@@ -75,7 +75,7 @@ public interface TrackPointsColumns extends BaseColumns {
|
||||
SENSOR
|
||||
};
|
||||
|
||||
public static final byte[] COLUMN_TYPES = {
|
||||
byte[] COLUMN_TYPES = {
|
||||
LONG_TYPE_ID, // id
|
||||
LONG_TYPE_ID, // track id
|
||||
INT_TYPE_ID, // longitude
|
||||
|
||||
+39
-39
@@ -26,73 +26,73 @@ import android.provider.BaseColumns;
|
||||
*/
|
||||
public interface TracksColumns extends BaseColumns {
|
||||
|
||||
public static final String TABLE_NAME = "tracks";
|
||||
String TABLE_NAME = "tracks";
|
||||
|
||||
/**
|
||||
* Tracks provider uri.
|
||||
*/
|
||||
public static final Uri CONTENT_URI = Uri.parse(
|
||||
Uri CONTENT_URI = Uri.parse(
|
||||
"content://com.google.android.maps.mytracks/tracks");
|
||||
|
||||
/**
|
||||
* Track content type.
|
||||
*/
|
||||
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.google.track";
|
||||
String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.google.track";
|
||||
|
||||
/**
|
||||
* Track id content type.
|
||||
*/
|
||||
public static final String CONTENT_ITEMTYPE = "vnd.android.cursor.item/vnd.google.track";
|
||||
String CONTENT_ITEMTYPE = "vnd.android.cursor.item/vnd.google.track";
|
||||
|
||||
/**
|
||||
* Tracks table default sort order.
|
||||
*/
|
||||
public static final String DEFAULT_SORT_ORDER = "_id";
|
||||
String DEFAULT_SORT_ORDER = "_id";
|
||||
|
||||
// Columns
|
||||
public static final String NAME = "name"; // track name
|
||||
public static final String DESCRIPTION = "description"; // track description
|
||||
public static final String CATEGORY = "category"; // track activity type
|
||||
public static final String STARTID = "startid"; // first track point id
|
||||
public static final String STOPID = "stopid"; // last track point id
|
||||
public static final String STARTTIME = "starttime"; // track start time
|
||||
public static final String STOPTIME = "stoptime"; // track stop time
|
||||
public static final String NUMPOINTS = "numpoints"; // number of track points
|
||||
public static final String TOTALDISTANCE = "totaldistance"; // total distance
|
||||
public static final String TOTALTIME = "totaltime"; // total time
|
||||
public static final String MOVINGTIME = "movingtime"; // moving time
|
||||
public static final String MINLAT = "minlat"; // minimum latitude
|
||||
public static final String MAXLAT = "maxlat"; // maximum latitude
|
||||
public static final String MINLON = "minlon"; // minimum longitude
|
||||
public static final String MAXLON = "maxlon"; // maximum longitude
|
||||
public static final String AVGSPEED = "avgspeed"; // average speed
|
||||
String NAME = "name"; // track name
|
||||
String DESCRIPTION = "description"; // track description
|
||||
String CATEGORY = "category"; // track activity type
|
||||
String STARTID = "startid"; // first track point id
|
||||
String STOPID = "stopid"; // last track point id
|
||||
String STARTTIME = "starttime"; // track start time
|
||||
String STOPTIME = "stoptime"; // track stop time
|
||||
String NUMPOINTS = "numpoints"; // number of track points
|
||||
String TOTALDISTANCE = "totaldistance"; // total distance
|
||||
String TOTALTIME = "totaltime"; // total time
|
||||
String MOVINGTIME = "movingtime"; // moving time
|
||||
String MINLAT = "minlat"; // minimum latitude
|
||||
String MAXLAT = "maxlat"; // maximum latitude
|
||||
String MINLON = "minlon"; // minimum longitude
|
||||
String MAXLON = "maxlon"; // maximum longitude
|
||||
String AVGSPEED = "avgspeed"; // average speed
|
||||
|
||||
// average moving speed
|
||||
public static final String AVGMOVINGSPEED = "avgmovingspeed";
|
||||
public static final String MAXSPEED = "maxspeed"; // maximum speed
|
||||
public static final String MINELEVATION = "minelevation"; // minimum elevation
|
||||
public static final String MAXELEVATION = "maxelevation"; // maximum elevation
|
||||
public static final String ELEVATIONGAIN = "elevationgain"; // elevation gain
|
||||
public static final String MINGRADE = "mingrade"; // minimum grade
|
||||
public static final String MAXGRADE = "maxgrade"; // maximum grade
|
||||
public static final String MAPID = "mapid"; // Google Maps id
|
||||
public static final String TABLEID = "tableid"; // Google Fusion Tables id
|
||||
public static final String ICON = "icon"; // track activity type icon
|
||||
public static final String DRIVEID = "driveid"; // Google Drive file id
|
||||
String AVGMOVINGSPEED = "avgmovingspeed";
|
||||
String MAXSPEED = "maxspeed"; // maximum speed
|
||||
String MINELEVATION = "minelevation"; // minimum elevation
|
||||
String MAXELEVATION = "maxelevation"; // maximum elevation
|
||||
String ELEVATIONGAIN = "elevationgain"; // elevation gain
|
||||
String MINGRADE = "mingrade"; // minimum grade
|
||||
String MAXGRADE = "maxgrade"; // maximum grade
|
||||
String MAPID = "mapid"; // Google Maps id
|
||||
String TABLEID = "tableid"; // Google Fusion Tables id
|
||||
String ICON = "icon"; // track activity type icon
|
||||
String DRIVEID = "driveid"; // Google Drive file id
|
||||
|
||||
// Google drive file modified time
|
||||
public static final String MODIFIEDTIME = "modifiedtime";
|
||||
String MODIFIEDTIME = "modifiedtime";
|
||||
|
||||
// 1 if the Google Drive file is from the "Shared with me" directory
|
||||
public static final String SHAREDWITHME = "sharedwithme";
|
||||
String SHAREDWITHME = "sharedwithme";
|
||||
|
||||
// The owner of the shared with me track
|
||||
public static final String SHAREDOWNER = "sharedOwner";
|
||||
String SHAREDOWNER = "sharedOwner";
|
||||
|
||||
// Calorie burned of the track
|
||||
public static final String CALORIE = "calorie";
|
||||
String CALORIE = "calorie";
|
||||
|
||||
public static final String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " (" // table
|
||||
String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " (" // table
|
||||
+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " // id
|
||||
+ NAME + " STRING, " // name
|
||||
+ DESCRIPTION + " STRING, " // description
|
||||
@@ -126,7 +126,7 @@ public interface TracksColumns extends BaseColumns {
|
||||
+ SHAREDOWNER + " STRING, " // shared owner
|
||||
+ CALORIE + " FLOAT);"; // calorie
|
||||
|
||||
public static final String[] COLUMNS = { _ID, // id
|
||||
String[] COLUMNS = { _ID, // id
|
||||
NAME, // name
|
||||
DESCRIPTION, // description
|
||||
CATEGORY, // category
|
||||
@@ -159,7 +159,7 @@ public interface TracksColumns extends BaseColumns {
|
||||
SHAREDOWNER,// shared owner
|
||||
CALORIE }; // calorie
|
||||
|
||||
public static final byte[] COLUMN_TYPES = { ContentTypeIds.LONG_TYPE_ID, // id
|
||||
byte[] COLUMN_TYPES = { ContentTypeIds.LONG_TYPE_ID, // id
|
||||
ContentTypeIds.STRING_TYPE_ID, // name
|
||||
ContentTypeIds.STRING_TYPE_ID, // description
|
||||
ContentTypeIds.STRING_TYPE_ID, // category
|
||||
|
||||
@@ -30,8 +30,8 @@ import android.os.Parcelable;
|
||||
*/
|
||||
public final class Waypoint implements Parcelable {
|
||||
|
||||
public static enum WaypointType {
|
||||
WAYPOINT, STATISTICS;
|
||||
public enum WaypointType {
|
||||
WAYPOINT, STATISTICS
|
||||
}
|
||||
|
||||
private long id = -1L;
|
||||
|
||||
+1
-2
@@ -62,7 +62,7 @@ public class WaypointCreationRequest implements Parcelable {
|
||||
|
||||
@Override
|
||||
public WaypointCreationRequest createFromParcel(Parcel source) {
|
||||
WaypointCreationRequest request = new WaypointCreationRequest(
|
||||
return new WaypointCreationRequest(
|
||||
WaypointType.values()[source.readInt()],
|
||||
source.readByte() == 1,
|
||||
source.readString(),
|
||||
@@ -70,7 +70,6 @@ public class WaypointCreationRequest implements Parcelable {
|
||||
source.readString(),
|
||||
source.readString(),
|
||||
source.readString());
|
||||
return request;
|
||||
}
|
||||
|
||||
public WaypointCreationRequest[] newArray(int size) {
|
||||
|
||||
+39
-39
@@ -31,50 +31,50 @@ import android.provider.BaseColumns;
|
||||
*/
|
||||
public interface WaypointsColumns extends BaseColumns {
|
||||
|
||||
public static final String TABLE_NAME = "waypoints";
|
||||
public static final Uri CONTENT_URI = Uri.parse(
|
||||
String TABLE_NAME = "waypoints";
|
||||
Uri CONTENT_URI = Uri.parse(
|
||||
"content://com.google.android.maps.mytracks/waypoints");
|
||||
public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.google.waypoint";
|
||||
public static final String CONTENT_ITEMTYPE = "vnd.android.cursor.item/vnd.google.waypoint";
|
||||
public static final String DEFAULT_SORT_ORDER = "_id";
|
||||
String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.google.waypoint";
|
||||
String CONTENT_ITEMTYPE = "vnd.android.cursor.item/vnd.google.waypoint";
|
||||
String DEFAULT_SORT_ORDER = "_id";
|
||||
|
||||
// Columns
|
||||
public static final String NAME = "name"; // waypoint name
|
||||
public static final String DESCRIPTION = "description"; // waypoint description
|
||||
public static final String CATEGORY = "category"; // waypoint category
|
||||
public static final String ICON = "icon"; // waypoint icon
|
||||
public static final String TRACKID = "trackid"; // track id
|
||||
public static final String TYPE = "type"; // type
|
||||
public static final String LENGTH = "length"; // length of the track (without smoothing)
|
||||
public static final String DURATION = "duration"; // total duration of the track (not from last waypoint)
|
||||
public static final String STARTTIME = "starttime"; // start time of the trip statistics
|
||||
public static final String STARTID = "startid"; // start track point id
|
||||
public static final String STOPID = "stopid"; // stop track point id
|
||||
String NAME = "name"; // waypoint name
|
||||
String DESCRIPTION = "description"; // waypoint description
|
||||
String CATEGORY = "category"; // waypoint category
|
||||
String ICON = "icon"; // waypoint icon
|
||||
String TRACKID = "trackid"; // track id
|
||||
String TYPE = "type"; // type
|
||||
String LENGTH = "length"; // length of the track (without smoothing)
|
||||
String DURATION = "duration"; // total duration of the track (not from last waypoint)
|
||||
String STARTTIME = "starttime"; // start time of the trip statistics
|
||||
String STARTID = "startid"; // start track point id
|
||||
String STOPID = "stopid"; // stop track point id
|
||||
|
||||
public static final String LONGITUDE = "longitude"; // longitude
|
||||
public static final String LATITUDE = "latitude"; // latitude
|
||||
public static final String TIME = "time"; // time
|
||||
public static final String ALTITUDE = "elevation"; // altitude
|
||||
public static final String ACCURACY = "accuracy"; // accuracy
|
||||
public static final String SPEED = "speed"; // speed
|
||||
public static final String BEARING = "bearing"; // bearing
|
||||
String LONGITUDE = "longitude"; // longitude
|
||||
String LATITUDE = "latitude"; // latitude
|
||||
String TIME = "time"; // time
|
||||
String ALTITUDE = "elevation"; // altitude
|
||||
String ACCURACY = "accuracy"; // accuracy
|
||||
String SPEED = "speed"; // speed
|
||||
String BEARING = "bearing"; // bearing
|
||||
|
||||
public static final String TOTALDISTANCE = "totaldistance"; // total distance
|
||||
public static final String TOTALTIME = "totaltime"; // total time
|
||||
public static final String MOVINGTIME = "movingtime"; // moving time
|
||||
public static final String AVGSPEED = "avgspeed"; // average speed
|
||||
public static final String AVGMOVINGSPEED = "avgmovingspeed"; // average moving speed
|
||||
public static final String MAXSPEED = "maxspeed"; // max speed
|
||||
public static final String MINELEVATION = "minelevation"; // min elevation
|
||||
public static final String MAXELEVATION = "maxelevation"; // max elevation
|
||||
public static final String ELEVATIONGAIN = "elevationgain"; // elevation gain
|
||||
public static final String MINGRADE = "mingrade"; // min grade
|
||||
public static final String MAXGRADE = "maxgrade"; // max grade
|
||||
public static final String CALORIE = "calorie"; // calorie
|
||||
String TOTALDISTANCE = "totaldistance"; // total distance
|
||||
String TOTALTIME = "totaltime"; // total time
|
||||
String MOVINGTIME = "movingtime"; // moving time
|
||||
String AVGSPEED = "avgspeed"; // average speed
|
||||
String AVGMOVINGSPEED = "avgmovingspeed"; // average moving speed
|
||||
String MAXSPEED = "maxspeed"; // max speed
|
||||
String MINELEVATION = "minelevation"; // min elevation
|
||||
String MAXELEVATION = "maxelevation"; // max elevation
|
||||
String ELEVATIONGAIN = "elevationgain"; // elevation gain
|
||||
String MINGRADE = "mingrade"; // min grade
|
||||
String MAXGRADE = "maxgrade"; // max grade
|
||||
String CALORIE = "calorie"; // calorie
|
||||
|
||||
public static final String PHOTOURL = "photoUrl"; // url for the photo
|
||||
String PHOTOURL = "photoUrl"; // url for the photo
|
||||
|
||||
public static final String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " ("
|
||||
String CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " ("
|
||||
+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
|
||||
+ NAME + " STRING, "
|
||||
+ DESCRIPTION + " STRING, "
|
||||
@@ -109,7 +109,7 @@ public interface WaypointsColumns extends BaseColumns {
|
||||
+ PHOTOURL + " STRING"
|
||||
+ ");";
|
||||
|
||||
public static final String[] COLUMNS = {
|
||||
String[] COLUMNS = {
|
||||
_ID,
|
||||
NAME,
|
||||
DESCRIPTION,
|
||||
@@ -144,7 +144,7 @@ public interface WaypointsColumns extends BaseColumns {
|
||||
PHOTOURL
|
||||
};
|
||||
|
||||
public static final byte[] COLUMN_TYPES = {
|
||||
byte[] COLUMN_TYPES = {
|
||||
LONG_TYPE_ID, // id
|
||||
STRING_TYPE_ID, // name
|
||||
STRING_TYPE_ID, // description
|
||||
|
||||
@@ -106,7 +106,7 @@ public class FileUtils {
|
||||
}
|
||||
|
||||
public static File getPhotoDir(long trackId) {
|
||||
return new File(getPath(PICTURES_DIR, "MyTracks" + Long.toString(trackId)));
|
||||
return new File(getPath(PICTURES_DIR, "MyTracks" + trackId));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -197,7 +197,7 @@ public class FileUtils {
|
||||
File directory, String base, String extension, int suffix) {
|
||||
String suffixName = "";
|
||||
if (suffix > 0) {
|
||||
suffixName += "(" + Integer.toString(suffix) + ")";
|
||||
suffixName += "(" + suffix + ")";
|
||||
}
|
||||
suffixName += "." + extension;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user