Clean up WaypointsColumns.java.

This commit is contained in:
Jimmy Shih
2012-06-14 15:54:52 -07:00
parent 984521b034
commit 7d5ec3b043
16 changed files with 373 additions and 361 deletions
@@ -13,14 +13,18 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.android.apps.mytracks.content;
/**
* Utilities for serializing primitive types.
*
*
* @author Rodrigo Damazio
*/
public class ContentTypeIds {
private ContentTypeIds() {}
public static final byte BOOLEAN_TYPE_ID = 0;
public static final byte LONG_TYPE_ID = 1;
public static final byte INT_TYPE_ID = 2;
@@ -28,6 +32,4 @@ public class ContentTypeIds {
public static final byte DOUBLE_TYPE_ID = 4;
public static final byte STRING_TYPE_ID = 5;
public static final byte BLOB_TYPE_ID = 6;
private ContentTypeIds() { /* Not instantiable */ }
}
@@ -143,8 +143,28 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
values.put(WaypointsColumns.STARTID, waypoint.getStartId());
values.put(WaypointsColumns.STOPID, waypoint.getStopId());
TripStatistics stats = waypoint.getStatistics();
Location location = waypoint.getLocation();
if (location != null) {
values.put(WaypointsColumns.LONGITUDE, (int) (location.getLongitude() * 1E6));
values.put(WaypointsColumns.LATITUDE, (int) (location.getLatitude() * 1E6));
values.put(WaypointsColumns.TIME, location.getTime());
if (location.hasAltitude()) {
values.put(WaypointsColumns.ALTITUDE, location.getAltitude());
}
if (location.hasAccuracy()) {
values.put(WaypointsColumns.ACCURACY, location.getAccuracy());
}
if (location.hasSpeed()) {
values.put(WaypointsColumns.SPEED, location.getSpeed());
}
if (location.hasBearing()) {
values.put(WaypointsColumns.BEARING, location.getBearing());
}
}
TripStatistics stats = waypoint.getTripStatistics();
if (stats != null) {
values.put(WaypointsColumns.STARTTIME, stats.getStartTime());
values.put(WaypointsColumns.TOTALDISTANCE, stats.getTotalDistance());
values.put(WaypointsColumns.TOTALTIME, stats.getTotalTime());
values.put(WaypointsColumns.MOVINGTIME, stats.getMovingTime());
@@ -156,30 +176,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
values.put(WaypointsColumns.ELEVATIONGAIN, stats.getTotalElevationGain());
values.put(WaypointsColumns.MINGRADE, stats.getMinGrade());
values.put(WaypointsColumns.MAXGRADE, stats.getMaxGrade());
values.put(WaypointsColumns.STARTTIME, stats.getStartTime());
}
Location location = waypoint.getLocation();
if (location != null) {
values.put(WaypointsColumns.LATITUDE,
(int) (location.getLatitude() * 1E6));
values.put(WaypointsColumns.LONGITUDE,
(int) (location.getLongitude() * 1E6));
values.put(WaypointsColumns.TIME, location.getTime());
if (location.hasAltitude()) {
values.put(WaypointsColumns.ALTITUDE, location.getAltitude());
}
if (location.hasBearing()) {
values.put(WaypointsColumns.BEARING, location.getBearing());
}
if (location.hasAccuracy()) {
values.put(WaypointsColumns.ACCURACY, location.getAccuracy());
}
if (location.hasSpeed()) {
values.put(WaypointsColumns.SPEED, location.getSpeed());
}
}
return values;
}
@@ -369,8 +366,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
public Waypoint createWaypoint(Cursor cursor) {
int idxId = cursor.getColumnIndexOrThrow(WaypointsColumns._ID);
int idxName = cursor.getColumnIndexOrThrow(WaypointsColumns.NAME);
int idxDescription =
cursor.getColumnIndexOrThrow(WaypointsColumns.DESCRIPTION);
int idxDescription = cursor.getColumnIndexOrThrow(WaypointsColumns.DESCRIPTION);
int idxCategory = cursor.getColumnIndexOrThrow(WaypointsColumns.CATEGORY);
int idxIcon = cursor.getColumnIndexOrThrow(WaypointsColumns.ICON);
int idxTrackId = cursor.getColumnIndexOrThrow(WaypointsColumns.TRACKID);
@@ -381,28 +377,23 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
int idxStartId = cursor.getColumnIndexOrThrow(WaypointsColumns.STARTID);
int idxStopId = cursor.getColumnIndexOrThrow(WaypointsColumns.STOPID);
int idxTotalDistance =
cursor.getColumnIndexOrThrow(WaypointsColumns.TOTALDISTANCE);
int idxTotalTime = cursor.getColumnIndexOrThrow(WaypointsColumns.TOTALTIME);
int idxMovingTime =
cursor.getColumnIndexOrThrow(WaypointsColumns.MOVINGTIME);
int idxMaxSpeed = cursor.getColumnIndexOrThrow(WaypointsColumns.MAXSPEED);
int idxMinElevation =
cursor.getColumnIndexOrThrow(WaypointsColumns.MINELEVATION);
int idxMaxElevation =
cursor.getColumnIndexOrThrow(WaypointsColumns.MAXELEVATION);
int idxElevationGain =
cursor.getColumnIndexOrThrow(WaypointsColumns.ELEVATIONGAIN);
int idxMinGrade = cursor.getColumnIndexOrThrow(WaypointsColumns.MINGRADE);
int idxMaxGrade = cursor.getColumnIndexOrThrow(WaypointsColumns.MAXGRADE);
int idxLatitude = cursor.getColumnIndexOrThrow(WaypointsColumns.LATITUDE);
int idxLongitude = cursor.getColumnIndexOrThrow(WaypointsColumns.LONGITUDE);
int idxAltitude = cursor.getColumnIndexOrThrow(WaypointsColumns.ALTITUDE);
int idxLatitude = cursor.getColumnIndexOrThrow(WaypointsColumns.LATITUDE);
int idxTime = cursor.getColumnIndexOrThrow(WaypointsColumns.TIME);
int idxBearing = cursor.getColumnIndexOrThrow(WaypointsColumns.BEARING);
int idxAltitude = cursor.getColumnIndexOrThrow(WaypointsColumns.ALTITUDE);
int idxAccuracy = cursor.getColumnIndexOrThrow(WaypointsColumns.ACCURACY);
int idxSpeed = cursor.getColumnIndexOrThrow(WaypointsColumns.SPEED);
int idxBearing = cursor.getColumnIndexOrThrow(WaypointsColumns.BEARING);
int idxTotalDistance = cursor.getColumnIndexOrThrow(WaypointsColumns.TOTALDISTANCE);
int idxTotalTime = cursor.getColumnIndexOrThrow(WaypointsColumns.TOTALTIME);
int idxMovingTime = cursor.getColumnIndexOrThrow(WaypointsColumns.MOVINGTIME);
int idxMaxSpeed = cursor.getColumnIndexOrThrow(WaypointsColumns.MAXSPEED);
int idxMinElevation = cursor.getColumnIndexOrThrow(WaypointsColumns.MINELEVATION);
int idxMaxElevation = cursor.getColumnIndexOrThrow(WaypointsColumns.MAXELEVATION);
int idxElevationGain = cursor.getColumnIndexOrThrow(WaypointsColumns.ELEVATIONGAIN);
int idxMinGrade = cursor.getColumnIndexOrThrow(WaypointsColumns.MINGRADE);
int idxMaxGrade = cursor.getColumnIndexOrThrow(WaypointsColumns.MAXGRADE);
Waypoint waypoint = new Waypoint();
@@ -440,73 +431,74 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
waypoint.setStopId(cursor.getLong(idxStopId));
}
TripStatistics stats = new TripStatistics();
boolean hasStats = false;
if (!cursor.isNull(idxStartTime)) {
stats.setStartTime(cursor.getLong(idxStartTime));
hasStats = true;
}
if (!cursor.isNull(idxTotalDistance)) {
stats.setTotalDistance(cursor.getFloat(idxTotalDistance));
hasStats = true;
}
if (!cursor.isNull(idxTotalTime)) {
stats.setTotalTime(cursor.getLong(idxTotalTime));
hasStats = true;
}
if (!cursor.isNull(idxMovingTime)) {
stats.setMovingTime(cursor.getLong(idxMovingTime));
hasStats = true;
}
if (!cursor.isNull(idxMaxSpeed)) {
stats.setMaxSpeed(cursor.getFloat(idxMaxSpeed));
hasStats = true;
}
if (!cursor.isNull(idxMinElevation)) {
stats.setMinElevation(cursor.getFloat(idxMinElevation));
hasStats = true;
}
if (!cursor.isNull(idxMaxElevation)) {
stats.setMaxElevation(cursor.getFloat(idxMaxElevation));
hasStats = true;
}
if (!cursor.isNull(idxElevationGain)) {
stats.setTotalElevationGain(cursor.getFloat(idxElevationGain));
hasStats = true;
}
if (!cursor.isNull(idxMinGrade)) {
stats.setMinGrade(cursor.getFloat(idxMinGrade));
hasStats = true;
}
if (!cursor.isNull(idxMaxGrade)) {
stats.setMaxGrade(cursor.getFloat(idxMaxGrade));
hasStats = true;
}
if (hasStats) {
waypoint.setStatistics(stats);
}
Location location = new Location("");
if (!cursor.isNull(idxLatitude) && !cursor.isNull(idxLongitude)) {
location.setLatitude(1. * cursor.getInt(idxLatitude) / 1E6);
if (!cursor.isNull(idxLongitude) && !cursor.isNull(idxLatitude)) {
location.setLongitude(1. * cursor.getInt(idxLongitude) / 1E6);
}
if (!cursor.isNull(idxAltitude)) {
location.setAltitude(cursor.getFloat(idxAltitude));
location.setLatitude(1. * cursor.getInt(idxLatitude) / 1E6);
}
if (!cursor.isNull(idxTime)) {
location.setTime(cursor.getLong(idxTime));
}
if (!cursor.isNull(idxBearing)) {
location.setBearing(cursor.getFloat(idxBearing));
}
if (!cursor.isNull(idxSpeed)) {
location.setSpeed(cursor.getFloat(idxSpeed));
if (!cursor.isNull(idxAltitude)) {
location.setAltitude(cursor.getFloat(idxAltitude));
}
if (!cursor.isNull(idxAccuracy)) {
location.setAccuracy(cursor.getFloat(idxAccuracy));
}
if (!cursor.isNull(idxSpeed)) {
location.setSpeed(cursor.getFloat(idxSpeed));
}
if (!cursor.isNull(idxBearing)) {
location.setBearing(cursor.getFloat(idxBearing));
}
waypoint.setLocation(location);
TripStatistics tripStatistics = new TripStatistics();
boolean hasTripStatistics = false;
if (!cursor.isNull(idxStartTime)) {
tripStatistics.setStartTime(cursor.getLong(idxStartTime));
hasTripStatistics = true;
}
if (!cursor.isNull(idxTotalDistance)) {
tripStatistics.setTotalDistance(cursor.getFloat(idxTotalDistance));
hasTripStatistics = true;
}
if (!cursor.isNull(idxTotalTime)) {
tripStatistics.setTotalTime(cursor.getLong(idxTotalTime));
hasTripStatistics = true;
}
if (!cursor.isNull(idxMovingTime)) {
tripStatistics.setMovingTime(cursor.getLong(idxMovingTime));
hasTripStatistics = true;
}
if (!cursor.isNull(idxMaxSpeed)) {
tripStatistics.setMaxSpeed(cursor.getFloat(idxMaxSpeed));
hasTripStatistics = true;
}
if (!cursor.isNull(idxMinElevation)) {
tripStatistics.setMinElevation(cursor.getFloat(idxMinElevation));
hasTripStatistics = true;
}
if (!cursor.isNull(idxMaxElevation)) {
tripStatistics.setMaxElevation(cursor.getFloat(idxMaxElevation));
hasTripStatistics = true;
}
if (!cursor.isNull(idxElevationGain)) {
tripStatistics.setTotalElevationGain(cursor.getFloat(idxElevationGain));
hasTripStatistics = true;
}
if (!cursor.isNull(idxMinGrade)) {
tripStatistics.setMinGrade(cursor.getFloat(idxMinGrade));
hasTripStatistics = true;
}
if (!cursor.isNull(idxMaxGrade)) {
tripStatistics.setMaxGrade(cursor.getFloat(idxMaxGrade));
hasTripStatistics = true;
}
if (hasTripStatistics) {
waypoint.setTripStatistics(tripStatistics);
}
return waypoint;
}
@@ -543,7 +535,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
if (nextWaypoint != null) {
Log.d(TAG, "Correcting marker " + nextWaypoint.getId()
+ " after deleted marker " + deletedWaypoint.getId());
nextWaypoint.getStatistics().merge(deletedWaypoint.getStatistics());
nextWaypoint.getTripStatistics().merge(deletedWaypoint.getTripStatistics());
nextWaypoint.setDescription(
descriptionGenerator.generateWaypointDescription(nextWaypoint));
if (!updateWaypoint(nextWaypoint)) {
@@ -59,7 +59,8 @@ public interface TrackPointsColumns extends BaseColumns {
+ ACCURACY + " FLOAT, "
+ SPEED + " FLOAT, "
+ BEARING + " FLOAT, "
+ SENSOR + " BLOB);";
+ SENSOR + " BLOB"
+ ");";
public static final String[] COLUMNS = {
_ID,
@@ -13,6 +13,7 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.android.apps.mytracks.content;
import com.google.android.apps.mytracks.stats.TripStatistics;
@@ -22,51 +23,13 @@ import android.os.Parcel;
import android.os.Parcelable;
/**
* A way point. It has a location, meta data such as name, description,
* category, and icon, plus it can store track statistics for a "sub-track".
*
* TODO: hashCode and equals
*
* A waypoint.
*
* @author Leif Hendrik Wilden
* @author Rodrigo Damazio
*/
public final class Waypoint implements Parcelable {
/**
* Creator for a Waypoint object
*/
public static class Creator implements Parcelable.Creator<Waypoint> {
public Waypoint createFromParcel(Parcel source) {
ClassLoader classLoader = getClass().getClassLoader();
Waypoint waypoint = new Waypoint();
waypoint.id = source.readLong();
waypoint.name = source.readString();
waypoint.description = source.readString();
waypoint.category = source.readString();
waypoint.icon = source.readString();
waypoint.trackId = source.readLong();
waypoint.type = source.readInt();
waypoint.startId = source.readLong();
waypoint.stopId = source.readLong();
byte hasStats = source.readByte();
if (hasStats > 0) {
waypoint.stats = source.readParcelable(classLoader);
}
byte hasLocation = source.readByte();
if (hasLocation > 0) {
waypoint.location = source.readParcelable(classLoader);
}
return waypoint;
}
public Waypoint[] newArray(int size) {
return new Waypoint[size];
}
}
public static final Creator CREATOR = new Creator();
public static final int TYPE_WAYPOINT = 0;
public static final int TYPE_STATISTICS = 1;
@@ -77,22 +40,45 @@ public final class Waypoint implements Parcelable {
private String icon = "";
private long trackId = -1;
private int type = 0;
private Location location;
/** Start track point id */
private double length = 0.0;
private long duration = 0;
private long startId = -1;
/** Stop track point id */
private long stopId = -1;
private Location location = null;
private TripStatistics tripStatistics = null;
private TripStatistics stats;
public Waypoint() {}
private Waypoint(Parcel source) {
id = source.readLong();
name = source.readString();
description = source.readString();
category = source.readString();
icon = source.readString();
trackId = source.readLong();
type = source.readInt();
length = source.readDouble();
duration = source.readLong();
startId = source.readLong();
stopId = source.readLong();
ClassLoader classLoader = getClass().getClassLoader();
byte hasLocation = source.readByte();
if (hasLocation > 0) {
location = source.readParcelable(classLoader);
}
byte hasStats = source.readByte();
if (hasStats > 0) {
tripStatistics = source.readParcelable(classLoader);
}
}
/** The length of the track, without smoothing. */
private double length;
/** The total duration of the track (not from the last waypoint) */
private long duration;
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(id);
dest.writeString(name);
@@ -101,40 +87,31 @@ public final class Waypoint implements Parcelable {
dest.writeString(icon);
dest.writeLong(trackId);
dest.writeInt(type);
dest.writeDouble(length);
dest.writeLong(duration);
dest.writeLong(startId);
dest.writeLong(stopId);
dest.writeByte(stats == null ? (byte) 0 : (byte) 1);
if (stats != null) {
dest.writeParcelable(stats, 0);
}
dest.writeByte(location == null ? (byte) 0 : (byte) 1);
if (location != null) {
dest.writeParcelable(location, 0);
}
dest.writeByte(tripStatistics == null ? (byte) 0 : (byte) 1);
if (tripStatistics != null) {
dest.writeParcelable(tripStatistics, 0);
}
}
// Getters and setters:
//---------------------
public static final Parcelable.Creator<Waypoint> CREATOR = new Parcelable.Creator<Waypoint>() {
@Override
public Waypoint createFromParcel(Parcel in) {
return new Waypoint(in);
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public Location getLocation() {
return location;
}
public void setTrackId(long trackId) {
this.trackId = trackId;
}
public int describeContents() {
return 0;
}
@Override
public Waypoint[] newArray(int size) {
return new Waypoint[size];
}
};
public long getId() {
return id;
@@ -152,34 +129,6 @@ public final class Waypoint implements Parcelable {
this.name = name;
}
public long getTrackId() {
return trackId;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public long getStartId() {
return startId;
}
public void setStartId(long startId) {
this.startId = startId;
}
public long getStopId() {
return stopId;
}
public void setStopId(long stopId) {
this.stopId = stopId;
}
public String getDescription() {
return description;
}
@@ -196,20 +145,29 @@ public final class Waypoint implements Parcelable {
this.category = category;
}
public void setLocation(Location location) {
this.location = location;
public String getIcon() {
return icon;
}
public TripStatistics getStatistics() {
return stats;
public void setIcon(String icon) {
this.icon = icon;
}
public void setStatistics(TripStatistics stats) {
this.stats = stats;
public long getTrackId() {
return trackId;
}
// WARNING: These fields are used for internal state keeping. You probably
// want to look at getStatistics instead.
public void setTrackId(long trackId) {
this.trackId = trackId;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public double getLength() {
return length;
@@ -226,4 +184,36 @@ public final class Waypoint implements Parcelable {
public void setDuration(long duration) {
this.duration = duration;
}
public long getStartId() {
return startId;
}
public void setStartId(long startId) {
this.startId = startId;
}
public long getStopId() {
return stopId;
}
public void setStopId(long stopId) {
this.stopId = stopId;
}
public Location getLocation() {
return location;
}
public void setLocation(Location location) {
this.location = location;
}
public TripStatistics getTripStatistics() {
return tripStatistics;
}
public void setTripStatistics(TripStatistics tripStatistics) {
this.tripStatistics = tripStatistics;
}
}
@@ -13,57 +13,160 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.android.apps.mytracks.content;
import static com.google.android.apps.mytracks.content.ContentTypeIds.FLOAT_TYPE_ID;
import static com.google.android.apps.mytracks.content.ContentTypeIds.INT_TYPE_ID;
import static com.google.android.apps.mytracks.content.ContentTypeIds.LONG_TYPE_ID;
import static com.google.android.apps.mytracks.content.ContentTypeIds.STRING_TYPE_ID;
import android.net.Uri;
import android.provider.BaseColumns;
/**
* Defines the URI for the tracks provider and the available column names
* and content types.
*
* Constants for waypoints table.
*
* @author Leif Hendrik Wilden
*/
public interface WaypointsColumns extends BaseColumns {
public static final 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 TABLE_NAME = "waypoints";
public static final 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";
/* All columns */
public static final String NAME = "name";
public static final String DESCRIPTION = "description";
public static final String CATEGORY = "category";
public static final String ICON = "icon";
public static final String TRACKID = "trackid";
public static final String TYPE = "type";
public static final String LENGTH = "length";
public static final String DURATION = "duration";
public static final String STARTTIME = "starttime";
public static final String STARTID = "startid";
public static final String STOPID = "stopid";
// 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
public static final String LATITUDE = "latitude";
public static final String LONGITUDE = "longitude";
public static final String ALTITUDE = "elevation";
public static final String BEARING = "bearing";
public static final String TIME = "time";
public static final String ACCURACY = "accuracy";
public static final String SPEED = "speed";
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 TOTALDISTANCE = "totaldistance";
public static final String TOTALTIME = "totaltime";
public static final String MOVINGTIME = "movingtime";
public static final String AVGSPEED = "avgspeed";
public static final String AVGMOVINGSPEED = "avgmovingspeed";
public static final String MAXSPEED = "maxspeed";
public static final String MINELEVATION = "minelevation";
public static final String MAXELEVATION = "maxelevation";
public static final String ELEVATIONGAIN = "elevationgain";
public static final String MINGRADE = "mingrade";
public static final String MAXGRADE = "maxgrade";
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 CREATE_TABLE = "CREATE TABLE " + TABLE_NAME + " ("
+ _ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ NAME + " STRING, "
+ DESCRIPTION + " STRING, "
+ CATEGORY + " STRING, "
+ ICON + " STRING, "
+ TRACKID + " INTEGER, "
+ TYPE + " INTEGER, "
+ LENGTH + " FLOAT, "
+ DURATION + " INTEGER, "
+ STARTTIME + " INTEGER, "
+ STARTID + " INTEGER, "
+ STOPID + " INTEGER, "
+ LONGITUDE + " INTEGER, "
+ LATITUDE + " INTEGER, "
+ TIME + " INTEGER, "
+ ALTITUDE + " FLOAT, "
+ ACCURACY + " FLOAT, "
+ SPEED + " FLOAT, "
+ BEARING + " FLOAT, "
+ TOTALDISTANCE + " FLOAT, "
+ TOTALTIME + " INTEGER, "
+ MOVINGTIME + " INTEGER, "
+ AVGSPEED + " FLOAT, "
+ AVGMOVINGSPEED + " FLOAT, "
+ MAXSPEED + " FLOAT, "
+ MINELEVATION + " FLOAT, "
+ MAXELEVATION + " FLOAT, "
+ ELEVATIONGAIN + " FLOAT, "
+ MINGRADE + " FLOAT, "
+ MAXGRADE + " FLOAT"
+ ");";
public static final String[] COLUMNS = {
_ID,
NAME,
DESCRIPTION,
CATEGORY,
ICON,
TRACKID,
TYPE,
LENGTH,
DURATION,
STARTTIME,
STARTID,
STOPID,
LONGITUDE,
LATITUDE,
TIME,
ALTITUDE,
ACCURACY,
SPEED,
BEARING,
TOTALDISTANCE,
TOTALTIME,
MOVINGTIME,
AVGSPEED,
AVGMOVINGSPEED,
MAXSPEED,
MINELEVATION,
MAXELEVATION,
ELEVATIONGAIN,
MINGRADE,
MAXGRADE
};
public static final byte[] COLUMN_TYPES = {
LONG_TYPE_ID, // id
STRING_TYPE_ID, // name
STRING_TYPE_ID, // description
STRING_TYPE_ID, // category
STRING_TYPE_ID, // icon
LONG_TYPE_ID, // track id
INT_TYPE_ID, // type
FLOAT_TYPE_ID, // length
LONG_TYPE_ID, // duration
LONG_TYPE_ID, // start time
LONG_TYPE_ID, // start id
LONG_TYPE_ID, // stop id
INT_TYPE_ID, // longitude
INT_TYPE_ID, // latitude
LONG_TYPE_ID, // time
FLOAT_TYPE_ID, // altitude
FLOAT_TYPE_ID, // accuracy
FLOAT_TYPE_ID, // speed
FLOAT_TYPE_ID, // bearing
FLOAT_TYPE_ID, // total distance
LONG_TYPE_ID, // total time
LONG_TYPE_ID, // moving time
FLOAT_TYPE_ID, // average speed
FLOAT_TYPE_ID, // average moving speed
FLOAT_TYPE_ID, // max speed
FLOAT_TYPE_ID, // min elevation
FLOAT_TYPE_ID, // max elevation
FLOAT_TYPE_ID, // elevation gain
FLOAT_TYPE_ID, // min grade
FLOAT_TYPE_ID // max grade
};
}