diff --git a/MyTracks/.classpath b/MyTracks/.classpath index 7c5cb8f1e..43ae28c20 100644 --- a/MyTracks/.classpath +++ b/MyTracks/.classpath @@ -6,5 +6,6 @@ + diff --git a/MyTracks/.project b/MyTracks/.project index 03e694b1f..ef19912e8 100644 --- a/MyTracks/.project +++ b/MyTracks/.project @@ -30,4 +30,11 @@ com.android.ide.eclipse.adt.AndroidNature org.eclipse.jdt.core.javanature + + + MyTracksLib_src + 2 + _android_MyTracksLib_e2802071/src + + diff --git a/MyTracks/AndroidManifest.xml b/MyTracks/AndroidManifest.xml index 41802e870..fea420b11 100755 --- a/MyTracks/AndroidManifest.xml +++ b/MyTracks/AndroidManifest.xml @@ -1,4 +1,19 @@ + + + + + + + diff --git a/MyTracksLib/.project b/MyTracksLib/.project new file mode 100644 index 000000000..1fefe8898 --- /dev/null +++ b/MyTracksLib/.project @@ -0,0 +1,33 @@ + + + MyTracksLib + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/MyTracksLib/.settings/org.eclipse.jdt.core.prefs b/MyTracksLib/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..a46c35996 --- /dev/null +++ b/MyTracksLib/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +#Sun Nov 28 01:17:12 PST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/MyTracksLib/AndroidManifest.xml b/MyTracksLib/AndroidManifest.xml new file mode 100644 index 000000000..ce3f0ea4b --- /dev/null +++ b/MyTracksLib/AndroidManifest.xml @@ -0,0 +1,30 @@ + + + + + + + + \ No newline at end of file diff --git a/MyTracksLib/default.properties b/MyTracksLib/default.properties new file mode 100644 index 000000000..948be06ed --- /dev/null +++ b/MyTracksLib/default.properties @@ -0,0 +1,12 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "build.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-8 +android.library=true diff --git a/MyTracks/res/drawable/arrow_icon.png b/MyTracksLib/res/drawable/arrow_icon.png similarity index 100% rename from MyTracks/res/drawable/arrow_icon.png rename to MyTracksLib/res/drawable/arrow_icon.png diff --git a/MyTracksLib/res/values/strings.xml b/MyTracksLib/res/values/strings.xml new file mode 100644 index 000000000..a3c7af5b8 --- /dev/null +++ b/MyTracksLib/res/values/strings.xml @@ -0,0 +1,19 @@ + + + + My Tracks Base Library + diff --git a/MyTracks/res/values/third_party.xml b/MyTracksLib/res/values/third_party.xml similarity index 100% rename from MyTracks/res/values/third_party.xml rename to MyTracksLib/res/values/third_party.xml diff --git a/MyTracks/src/com/google/android/apps/mytracks/content/DescriptionGenerator.java b/MyTracksLib/src/com/google/android/apps/mytracks/content/DescriptionGenerator.java similarity index 100% rename from MyTracks/src/com/google/android/apps/mytracks/content/DescriptionGenerator.java rename to MyTracksLib/src/com/google/android/apps/mytracks/content/DescriptionGenerator.java diff --git a/MyTracks/src/com/google/android/apps/mytracks/content/MyTracksProviderUtils.java b/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtils.java similarity index 100% rename from MyTracks/src/com/google/android/apps/mytracks/content/MyTracksProviderUtils.java rename to MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtils.java diff --git a/MyTracks/src/com/google/android/apps/mytracks/content/MyTracksProviderUtilsImpl.java b/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtilsImpl.java similarity index 95% rename from MyTracks/src/com/google/android/apps/mytracks/content/MyTracksProviderUtilsImpl.java rename to MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtilsImpl.java index 1e814f102..c3d8a5233 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/content/MyTracksProviderUtilsImpl.java +++ b/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtilsImpl.java @@ -15,6 +15,7 @@ */ package com.google.android.apps.mytracks.content; +import static com.google.android.apps.mytracks.lib.MyTracksLibConstants.*; import com.google.android.apps.mytracks.stats.TripStatistics; import android.content.ContentResolver; @@ -475,17 +476,16 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { final Waypoint nextWaypoint = getNextStatisticsWaypointAfter(deletedWaypoint); if (nextWaypoint != null) { - Log.d(MyTracksProvider.TAG, "Correcting marker " + nextWaypoint.getId() + Log.d(TAG, "Correcting marker " + nextWaypoint.getId() + " after deleted marker " + deletedWaypoint.getId()); nextWaypoint.getStatistics().merge(deletedWaypoint.getStatistics()); nextWaypoint.setDescription( descriptionGenerator.generateWaypointDescription(nextWaypoint)); if (!updateWaypoint(nextWaypoint)) { - Log.w(MyTracksProvider.TAG, "Update of marker was unsuccessful."); + Log.w(TAG, "Update of marker was unsuccessful."); } } else { - Log.d(MyTracksProvider.TAG, - "No statistics marker after the deleted one was found."); + Log.d(TAG, "No statistics marker after the deleted one was found."); } } contentResolver.delete( @@ -510,7 +510,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { return createWaypoint(cursor); } } catch (RuntimeException e) { - Log.w(MyTracksProvider.TAG, "Caught unexpected exception.", e); + Log.w(TAG, "Caught unexpected exception.", e); } finally { if (cursor != null) { cursor.close(); @@ -529,7 +529,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { null /*selectionArgs*/); return rows == 1; } catch (RuntimeException e) { - Log.e(MyTracksProvider.TAG, "Caught unexpected exception.", e); + Log.e(TAG, "Caught unexpected exception.", e); } return false; } @@ -549,7 +549,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { return createLocation(cursor); } } catch (RuntimeException e) { - Log.w(MyTracksProvider.TAG, "Caught an unexpeceted exception.", e); + Log.w(TAG, "Caught an unexpeceted exception.", e); } finally { if (cursor != null) { cursor.close(); @@ -573,7 +573,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { return createTrack(cursor); } } catch (RuntimeException e) { - Log.w(MyTracksProvider.TAG, "Caught unexpected exception.", e); + Log.w(TAG, "Caught unexpected exception.", e); } finally { if (cursor != null) { cursor.close(); @@ -601,7 +601,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { return createWaypoint(cursor); } } catch (RuntimeException e) { - Log.w(MyTracksProvider.TAG, "Caught an unexpected exception.", e); + Log.w(TAG, "Caught an unexpected exception.", e); } finally { cursor.close(); } @@ -623,7 +623,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { return createWaypoint(cursor); } } catch (RuntimeException e) { - Log.w(MyTracksProvider.TAG, "Caught an unexpected exception.", e); + Log.w(TAG, "Caught an unexpected exception.", e); } finally { cursor.close(); } @@ -647,7 +647,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { cursor.getColumnIndexOrThrow(TrackPointsColumns._ID)); } } catch (RuntimeException e) { - Log.w(MyTracksProvider.TAG, "Caught an unexpected exception.", e); + Log.w(TAG, "Caught an unexpected exception.", e); } finally { cursor.close(); } @@ -671,7 +671,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { cursor.getColumnIndexOrThrow(WaypointsColumns._ID)); } } catch (RuntimeException e) { - Log.w(MyTracksProvider.TAG, "Caught an unexpected exception.", e); + Log.w(TAG, "Caught an unexpected exception.", e); } finally { cursor.close(); } @@ -695,7 +695,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { cursor.getColumnIndexOrThrow(WaypointsColumns._ID)); } } catch (RuntimeException e) { - Log.w(MyTracksProvider.TAG, "Caught an unexpected exception.", e); + Log.w(TAG, "Caught an unexpected exception.", e); } finally { cursor.close(); } @@ -714,7 +714,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { return createTrack(cursor); } } catch (RuntimeException e) { - Log.w(MyTracksProvider.TAG, "Caught an unexpected exception.", e); + Log.w(TAG, "Caught an unexpected exception.", e); } finally { if (cursor != null) { cursor.close(); @@ -818,7 +818,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { long lastId = -1; Cursor cursor = getLocationsCursor(track.getId(), -1, maxPoints, true); if (cursor == null) { - Log.w(MyTracksProvider.TAG, "Cannot get a locations cursor!"); + Log.w(TAG, "Cannot get a locations cursor!"); return lastId; } try { @@ -835,7 +835,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { } while (cursor.moveToPrevious()); } } catch (RuntimeException e) { - Log.w(MyTracksProvider.TAG, "Caught unexpected exception.", e); + Log.w(TAG, "Caught unexpected exception.", e); } finally { cursor.close(); } @@ -851,14 +851,14 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { @Override public Uri insertTrack(Track track) { - Log.d(MyTracksProvider.TAG, "MyTracksProviderUtilsImpl.insertTrack"); + Log.d(TAG, "MyTracksProviderUtilsImpl.insertTrack"); return contentResolver.insert(TracksColumns.CONTENT_URI, createContentValues(track)); } @Override public Uri insertTrackPoint(Location location, long trackId) { - Log.d(MyTracksProvider.TAG, "MyTracksProviderUtilsImpl.insertTrackPoint"); + Log.d(TAG, "MyTracksProviderUtilsImpl.insertTrackPoint"); return contentResolver.insert(TrackPointsColumns.CONTENT_URI, createContentValues(location, trackId)); } @@ -877,7 +877,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { @Override public Uri insertWaypoint(Waypoint waypoint) { - Log.d(MyTracksProvider.TAG, "MyTracksProviderUtilsImpl.insertWaypoint"); + Log.d(TAG, "MyTracksProviderUtilsImpl.insertWaypoint"); waypoint.setId(-1); return contentResolver.insert(WaypointsColumns.CONTENT_URI, createContentValues(waypoint)); @@ -907,7 +907,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils { @Override public void updateTrack(Track track) { - Log.d(MyTracksProvider.TAG, "MyTracksProviderUtilsImpl.updateTrack"); + Log.d(TAG, "MyTracksProviderUtilsImpl.updateTrack"); contentResolver.update(TracksColumns.CONTENT_URI, createContentValues(track), "_id=" + track.getId(), null); } diff --git a/MyTracks/src/com/google/android/apps/mytracks/content/Track.java b/MyTracksLib/src/com/google/android/apps/mytracks/content/Track.java similarity index 99% rename from MyTracks/src/com/google/android/apps/mytracks/content/Track.java rename to MyTracksLib/src/com/google/android/apps/mytracks/content/Track.java index f881c966b..fe4c19453 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/content/Track.java +++ b/MyTracksLib/src/com/google/android/apps/mytracks/content/Track.java @@ -34,7 +34,7 @@ import java.util.ArrayList; public class Track implements Parcelable { /** - * Creator for a Track object + * Creator for a Track object. */ public static class Creator implements Parcelable.Creator { diff --git a/MyTracks/src/com/google/android/apps/mytracks/content/TrackPointsColumns.java b/MyTracksLib/src/com/google/android/apps/mytracks/content/TrackPointsColumns.java similarity index 76% rename from MyTracks/src/com/google/android/apps/mytracks/content/TrackPointsColumns.java rename to MyTracksLib/src/com/google/android/apps/mytracks/content/TrackPointsColumns.java index 36701db40..206fd0eb8 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/content/TrackPointsColumns.java +++ b/MyTracksLib/src/com/google/android/apps/mytracks/content/TrackPointsColumns.java @@ -15,8 +15,6 @@ */ package com.google.android.apps.mytracks.content; -import static com.google.android.apps.mytracks.content.ContentTypeIds.*; - import android.net.Uri; import android.provider.BaseColumns; @@ -44,14 +42,4 @@ public interface TrackPointsColumns extends BaseColumns { public static final String TIME = "time"; public static final String ACCURACY = "accuracy"; public static final String SPEED = "speed"; - - /** Columns that go into the backup. */ - public static final String[] BACKUP_COLUMNS = - { _ID, TRACKID, LATITUDE, LONGITUDE, ALTITUDE, BEARING, TIME, - ACCURACY, SPEED }; - - /** Types of the columns that go into the backup. */ - public static final byte[] BACKUP_COLUMN_TYPES = - { LONG_TYPE_ID, LONG_TYPE_ID, INT_TYPE_ID, INT_TYPE_ID, FLOAT_TYPE_ID, - FLOAT_TYPE_ID, LONG_TYPE_ID, FLOAT_TYPE_ID, FLOAT_TYPE_ID }; } diff --git a/MyTracks/src/com/google/android/apps/mytracks/content/TracksColumns.java b/MyTracksLib/src/com/google/android/apps/mytracks/content/TracksColumns.java similarity index 75% rename from MyTracks/src/com/google/android/apps/mytracks/content/TracksColumns.java rename to MyTracksLib/src/com/google/android/apps/mytracks/content/TracksColumns.java index 5e22926c9..6fb122b89 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/content/TracksColumns.java +++ b/MyTracksLib/src/com/google/android/apps/mytracks/content/TracksColumns.java @@ -15,8 +15,6 @@ */ package com.google.android.apps.mytracks.content; -import static com.google.android.apps.mytracks.content.ContentTypeIds.*; - import android.net.Uri; import android.provider.BaseColumns; @@ -61,16 +59,4 @@ public interface TracksColumns extends BaseColumns { public static final String MINLON = "minlon"; public static final String MAXLON = "maxlon"; public static final String MAPID = "mapid"; - - public static final String[] BACKUP_COLUMNS = { - _ID, NAME, DESCRIPTION, CATEGORY, STARTID, STOPID, STARTTIME, STOPTIME, - NUMPOINTS, TOTALDISTANCE, TOTALTIME, MOVINGTIME, AVGSPEED, AVGMOVINGSPEED, - MAXSPEED, MINELEVATION, MAXELEVATION, ELEVATIONGAIN, MINGRADE, MAXGRADE, - MINLAT, MAXLAT, MINLON, MAXLON }; - public static final byte[] BACKUP_COLUMN_TYPES = { - LONG_TYPE_ID, STRING_TYPE_ID, STRING_TYPE_ID, STRING_TYPE_ID, - LONG_TYPE_ID, LONG_TYPE_ID, LONG_TYPE_ID, LONG_TYPE_ID, INT_TYPE_ID, - FLOAT_TYPE_ID, LONG_TYPE_ID, LONG_TYPE_ID, FLOAT_TYPE_ID, FLOAT_TYPE_ID, - FLOAT_TYPE_ID, FLOAT_TYPE_ID, FLOAT_TYPE_ID, FLOAT_TYPE_ID, FLOAT_TYPE_ID, - FLOAT_TYPE_ID, INT_TYPE_ID, INT_TYPE_ID, INT_TYPE_ID, INT_TYPE_ID }; } diff --git a/MyTracks/src/com/google/android/apps/mytracks/content/Waypoint.aidl b/MyTracksLib/src/com/google/android/apps/mytracks/content/Waypoint.aidl similarity index 100% rename from MyTracks/src/com/google/android/apps/mytracks/content/Waypoint.aidl rename to MyTracksLib/src/com/google/android/apps/mytracks/content/Waypoint.aidl diff --git a/MyTracks/src/com/google/android/apps/mytracks/content/Waypoint.java b/MyTracksLib/src/com/google/android/apps/mytracks/content/Waypoint.java similarity index 100% rename from MyTracks/src/com/google/android/apps/mytracks/content/Waypoint.java rename to MyTracksLib/src/com/google/android/apps/mytracks/content/Waypoint.java diff --git a/MyTracks/src/com/google/android/apps/mytracks/content/WaypointsColumns.java b/MyTracksLib/src/com/google/android/apps/mytracks/content/WaypointsColumns.java similarity index 73% rename from MyTracks/src/com/google/android/apps/mytracks/content/WaypointsColumns.java rename to MyTracksLib/src/com/google/android/apps/mytracks/content/WaypointsColumns.java index 08c57c179..8184bd583 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/content/WaypointsColumns.java +++ b/MyTracksLib/src/com/google/android/apps/mytracks/content/WaypointsColumns.java @@ -15,8 +15,6 @@ */ package com.google.android.apps.mytracks.content; -import static com.google.android.apps.mytracks.content.ContentTypeIds.*; - import android.net.Uri; import android.provider.BaseColumns; @@ -68,19 +66,4 @@ public interface WaypointsColumns extends BaseColumns { public static final String ELEVATIONGAIN = "elevationgain"; public static final String MINGRADE = "mingrade"; public static final String MAXGRADE = "maxgrade"; - - public static final String[] BACKUP_COLUMNS = { - _ID, TRACKID, NAME, DESCRIPTION, CATEGORY, ICON, TYPE, LENGTH, DURATION, - STARTTIME, STARTID, STOPID, LATITUDE, LONGITUDE, ALTITUDE, BEARING, TIME, - ACCURACY, SPEED, TOTALDISTANCE, TOTALTIME, MOVINGTIME, AVGSPEED, - AVGMOVINGSPEED, MAXSPEED, MINELEVATION, MAXELEVATION, ELEVATIONGAIN, - MINGRADE, MAXGRADE }; - public static final byte[] BACKUP_COLUMN_TYPES = { - LONG_TYPE_ID, LONG_TYPE_ID, STRING_TYPE_ID, STRING_TYPE_ID, - STRING_TYPE_ID, STRING_TYPE_ID, INT_TYPE_ID, FLOAT_TYPE_ID, LONG_TYPE_ID, - LONG_TYPE_ID, LONG_TYPE_ID, LONG_TYPE_ID, INT_TYPE_ID, INT_TYPE_ID, - FLOAT_TYPE_ID, FLOAT_TYPE_ID, LONG_TYPE_ID, FLOAT_TYPE_ID, FLOAT_TYPE_ID, - FLOAT_TYPE_ID, LONG_TYPE_ID, LONG_TYPE_ID, FLOAT_TYPE_ID, FLOAT_TYPE_ID, - FLOAT_TYPE_ID, FLOAT_TYPE_ID, FLOAT_TYPE_ID, FLOAT_TYPE_ID, FLOAT_TYPE_ID, - FLOAT_TYPE_ID }; } diff --git a/MyTracksLib/src/com/google/android/apps/mytracks/lib/MyTracksLibConstants.java b/MyTracksLib/src/com/google/android/apps/mytracks/lib/MyTracksLibConstants.java new file mode 100644 index 000000000..739cf79f1 --- /dev/null +++ b/MyTracksLib/src/com/google/android/apps/mytracks/lib/MyTracksLibConstants.java @@ -0,0 +1,28 @@ +/* + * Copyright 2010 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.google.android.apps.mytracks.lib; + +/** + * Constants for the My Tracks common library. + * These constants should ideally not be used by third-party applications. + * + * @author Rodrigo Damazio + */ +public class MyTracksLibConstants { + public static final String TAG = "MyTracksLib"; + + private MyTracksLibConstants() {} +} diff --git a/MyTracks/src/com/google/android/apps/mytracks/services/ITrackRecordingService.aidl b/MyTracksLib/src/com/google/android/apps/mytracks/services/ITrackRecordingService.aidl similarity index 100% rename from MyTracks/src/com/google/android/apps/mytracks/services/ITrackRecordingService.aidl rename to MyTracksLib/src/com/google/android/apps/mytracks/services/ITrackRecordingService.aidl diff --git a/MyTracks/src/com/google/android/apps/mytracks/stats/ExtremityMonitor.java b/MyTracksLib/src/com/google/android/apps/mytracks/stats/ExtremityMonitor.java similarity index 100% rename from MyTracks/src/com/google/android/apps/mytracks/stats/ExtremityMonitor.java rename to MyTracksLib/src/com/google/android/apps/mytracks/stats/ExtremityMonitor.java diff --git a/MyTracks/src/com/google/android/apps/mytracks/stats/TripStatistics.aidl b/MyTracksLib/src/com/google/android/apps/mytracks/stats/TripStatistics.aidl similarity index 100% rename from MyTracks/src/com/google/android/apps/mytracks/stats/TripStatistics.aidl rename to MyTracksLib/src/com/google/android/apps/mytracks/stats/TripStatistics.aidl diff --git a/MyTracks/src/com/google/android/apps/mytracks/stats/TripStatistics.java b/MyTracksLib/src/com/google/android/apps/mytracks/stats/TripStatistics.java similarity index 99% rename from MyTracks/src/com/google/android/apps/mytracks/stats/TripStatistics.java rename to MyTracksLib/src/com/google/android/apps/mytracks/stats/TripStatistics.java index 286158ead..e0a7dac76 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/stats/TripStatistics.java +++ b/MyTracksLib/src/com/google/android/apps/mytracks/stats/TripStatistics.java @@ -26,7 +26,7 @@ import android.os.Parcelable; * * @author Rodrigo Damazio */ -public class TripStatistics implements Parcelable { +public class TripStatistics implements Parcelable { /** * The start time for the trip. This is system time which might not match gps diff --git a/SignalStrengthSampler/.classpath b/SignalStrengthSampler/.classpath index 609aa00eb..efe4c9c16 100644 --- a/SignalStrengthSampler/.classpath +++ b/SignalStrengthSampler/.classpath @@ -3,5 +3,6 @@ + diff --git a/SignalStrengthSampler/.project b/SignalStrengthSampler/.project index cb1013e1b..80fb1802d 100644 --- a/SignalStrengthSampler/.project +++ b/SignalStrengthSampler/.project @@ -30,4 +30,11 @@ com.android.ide.eclipse.adt.AndroidNature org.eclipse.jdt.core.javanature + + + MyTracksLib_src + 2 + _android_MyTracksLib_e2802071/src + + diff --git a/SignalStrengthSampler/default.properties b/SignalStrengthSampler/default.properties index 420db56e3..45aae789b 100644 --- a/SignalStrengthSampler/default.properties +++ b/SignalStrengthSampler/default.properties @@ -9,3 +9,4 @@ # Project target. target=Google Inc.:Google APIs:8 +android.library.reference.1=../MyTracksLib/ diff --git a/SignalStrengthSampler/src/com/google/android/apps/mytracks/content/Waypoint.aidl b/SignalStrengthSampler/src/com/google/android/apps/mytracks/content/Waypoint.aidl deleted file mode 100644 index fece6fd44..000000000 --- a/SignalStrengthSampler/src/com/google/android/apps/mytracks/content/Waypoint.aidl +++ /dev/null @@ -1,2 +0,0 @@ -package com.google.android.apps.mytracks.content; -parcelable Waypoint; \ No newline at end of file diff --git a/SignalStrengthSampler/src/com/google/android/apps/mytracks/content/Waypoint.java b/SignalStrengthSampler/src/com/google/android/apps/mytracks/content/Waypoint.java deleted file mode 100644 index 93cdc0e4b..000000000 --- a/SignalStrengthSampler/src/com/google/android/apps/mytracks/content/Waypoint.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright 2009 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.android.apps.mytracks.content; - -import android.location.Location; -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 - * - * @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 { - - 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(); - if (source.readByte() > 0) { - throw new UnsupportedOperationException( - "No support for reading waypoints with stats"); - } - 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; - - private long id = -1; - private String name = ""; - private String description = ""; - private String category = ""; - private String icon = ""; - private long trackId = -1; - private int type = 0; - - private Location location; - - /** Start track point id */ - private long startId = -1; - /** Stop track point id */ - private long stopId = -1; - - public void writeToParcel(Parcel dest, int flags) { - dest.writeLong(id); - dest.writeString(name); - dest.writeString(description); - dest.writeString(category); - dest.writeString(icon); - dest.writeLong(trackId); - dest.writeInt(type); - dest.writeLong(startId); - dest.writeLong(stopId); - dest.writeByte((byte) 0); // No stats - dest.writeByte(location == null ? (byte) 0 : (byte) 1); - if (location != null) { - dest.writeParcelable(location, 0); - } - } - - // Getters and setters: - //--------------------- - - 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; - } - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - 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; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getCategory() { - return category; - } - - public void setCategory(String category) { - this.category = category; - } - - public void setLocation(Location location) { - this.location = location; - } -} diff --git a/SignalStrengthSampler/src/com/google/android/apps/mytracks/services/ITrackRecordingService.aidl b/SignalStrengthSampler/src/com/google/android/apps/mytracks/services/ITrackRecordingService.aidl deleted file mode 100644 index d0e492563..000000000 --- a/SignalStrengthSampler/src/com/google/android/apps/mytracks/services/ITrackRecordingService.aidl +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2008 Google Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.google.android.apps.mytracks.services; - -import com.google.android.apps.mytracks.content.Waypoint; - -/** - * MyTracks service. - * This service is the process that actually records and manages tracks. - */ -interface ITrackRecordingService { - - /** - * Starts recording a new track. - * - * @return the track ID of the new track - */ - long startNewTrack(); - - /** - * Checks and returns whether we're currently recording a track. - */ - boolean isRecording(); - - /** - * Returns the track ID of the track currently being recorded, or -1 if none - * is being recorded. This ID can then be used to read track data from the - * content source. - */ - long getRecordingTrackId(); - - /** - * Inserts a waypoint marker in the track being recorded. - * - * @param waypoint the waypoint to insert - * @return the unique ID of the inserted marker - */ - long insertWaypointMarker(in Waypoint waypoint); - - /** - * Inserts a statistics marker in the track being recorded. - * - * @param location the location at which to insert the marker - * @return the unique ID of the inserted marker - */ - long insertStatisticsMarker(in Location location); - - /** - * Inserts a location in the track being recorded. - * - * When recording, locations detected by the GPS are already automatically - * added to the track, so this should be used only for adding special points - * or for testing. - * - * @param loc the location to insert - */ - void recordLocation(in Location loc); - - /** - * Stops recording the current track. - */ - void endCurrentTrack(); - - /** - * Returns whether at least one track has been or is being recorded (and was - * not deleted). - */ - boolean hasRecorded(); - - /** - * Deletes all the stored tracks. - */ - void deleteAllTracks(); -} diff --git a/SignalStrengthSamplerTest/.settings/org.eclipse.jdt.core.prefs b/SignalStrengthSamplerTest/.settings/org.eclipse.jdt.core.prefs index db1e1ea37..0906c3632 100644 --- a/SignalStrengthSamplerTest/.settings/org.eclipse.jdt.core.prefs +++ b/SignalStrengthSamplerTest/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,12 @@ -#Fri Nov 26 22:23:21 PST 2010 +#Sun Nov 28 01:19:10 PST 2010 eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/SignalStrengthSamplerTest/AndroidManifest.xml b/SignalStrengthSamplerTest/AndroidManifest.xml index 81a878083..b9dbff3a8 100644 --- a/SignalStrengthSamplerTest/AndroidManifest.xml +++ b/SignalStrengthSamplerTest/AndroidManifest.xml @@ -3,7 +3,7 @@ package="com.google.android.apps.mytracks.signalstrength.test" android:versionCode="1" android:versionName="1.0"> - + diff --git a/SignalStrengthSamplerTest/res/values/strings.xml b/SignalStrengthSamplerTest/res/values/strings.xml deleted file mode 100644 index 1d9464eb2..000000000 --- a/SignalStrengthSamplerTest/res/values/strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - Hello World! -