Merged with 1.1.7

This commit is contained in:
Sandor Dornbush
2011-06-21 21:19:01 -07:00
parent 17c1c81b4e
commit be219bbee6
10 changed files with 35 additions and 16 deletions
+1
View File
@@ -5,6 +5,7 @@
<classpathentry kind="lib" path="libs/google-common.jar"/>
<classpathentry kind="lib" path="libs/accounts.jar"/>
<classpathentry kind="lib" path="libs/google-api-client-1.2.2-alpha.jar"/>
<classpathentry kind="lib" path="libs/libGoogleAnalytics.jar"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="lib" path="/MyTracksLib/libs/protobuf-java-2.3.0-lite.jar"/>
+3 -2
View File
@@ -17,8 +17,8 @@ limitations under the License.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.maps.mytracks"
android:installLocation="auto"
android:versionCode="29"
android:versionName="1.1.6">
android:versionCode="30"
android:versionName="1.1.7">
<application android:icon="@drawable/arrow_icon"
android:label="@string/app_name"
android:backupAgent="com.google.android.apps.mytracks.io.backup.MyTracksBackupAgent">
@@ -125,6 +125,7 @@ limitations under the License.
<!-- Permissions for recording tracks and showing maps -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.BLUETOOTH" />
Binary file not shown.
+5
View File
@@ -170,6 +170,11 @@ limitations under the License.
<item>inline skating</item>
<item>skate boarding</item>
<item>roller skiing (classic)</item>
<item>roller skiing (skate)</item>
<item>cross-country skiing (classic)</item>
<item>cross-country skiing (skate)</item>
<item>snow shoeing</item>
<item>skiing</item>
<item>snow boarding</item>
@@ -38,16 +38,6 @@ limitations under the License.
<item>100</item>
</string-array>
<string-array name="min_recording_distance_values">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>10</item>
<item>100</item>
</string-array>
<string-array name="max_recording_distance_values">
<item>50</item>
<item>100</item>
+3
View File
@@ -39,4 +39,7 @@ limitations under the License.
<string name="sendtogoogle_google_fusiontables_url">google.com/fusiontables</string>
<string name="sendtogoogle_google_mymaps_url">maps.google.com</string>
<string name="sendtogoogle_google_docs_url">docs.google.com</string>
<!-- ID for Google Analytics -->
<string name="google_analytics_id">UA-7222692-2</string>
</resources>
+1 -1
View File
@@ -42,7 +42,7 @@ limitations under the License.
android:summary="@string/settings_announcement_frequency_summary"
android:entries="@array/task_frequency_options"
android:entryValues="@array/task_frequency_values"
android:defaultValue="-1" />
android:defaultValue="0" />
<com.google.android.apps.mytracks.IntegerListPreference
android:key="@string/split_frequency_key"
@@ -21,6 +21,7 @@ import static com.google.android.apps.mytracks.DialogManager.DIALOG_PROGRESS;
import static com.google.android.apps.mytracks.DialogManager.DIALOG_SEND_TO_GOOGLE;
import com.google.android.accounts.Account;
import com.google.android.apps.analytics.GoogleAnalyticsTracker;
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
import com.google.android.apps.mytracks.content.Track;
import com.google.android.apps.mytracks.content.TrackDataHub;
@@ -159,6 +160,11 @@ public class MyTracks extends TabActivity implements OnTouchListener,
private SharedPreferences sharedPreferences;
/**
* Google Analytics tracker
*/
private GoogleAnalyticsTracker tracker;
/**
* The connection to the track recording service.
*/
@@ -250,6 +256,13 @@ public class MyTracks extends TabActivity implements OnTouchListener,
apiFeatures.getApiPlatformAdapter().enableStrictMode();
}
tracker = GoogleAnalyticsTracker.getInstance();
// Start the tracker in manual dispatch mode...
tracker.start(this.getString(R.string.google_analytics_id), this.getApplicationContext());
tracker.setProductVersion("android-mytracks", SystemUtils.getMyTracksVersion(this));
tracker.trackPageView("/appstart");
tracker.dispatch();
providerUtils = MyTracksProviderUtils.Factory.get(this);
sharedPreferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
dataHub = new TrackDataHub(this, sharedPreferences, providerUtils);
@@ -325,6 +338,8 @@ public class MyTracks extends TabActivity implements OnTouchListener,
dataHub.destroy();
tryUnbindTrackRecordingService();
tracker.dispatch();
tracker.stop();
super.onDestroy();
}
@@ -931,6 +946,7 @@ public class MyTracks extends TabActivity implements OnTouchListener,
}
private void sendToGoogleMapsOrPickMap(SendDialog sendToGoogleDialog) {
tracker.trackPageView("/send/maps");
if (!sendToGoogleDialog.getCreateNewMap()) {
// Ask the user to choose a map to upload into
Intent listIntent = new Intent(this, MyMapsList.class);
@@ -1010,6 +1026,7 @@ public class MyTracks extends TabActivity implements OnTouchListener,
}
private void sendToFusionTables(final long trackId) {
tracker.trackPageView("/send/fusion_tables");
OnSendCompletedListener onCompletion = new OnSendCompletedListener() {
@Override
public void onSendCompleted(String tableId, boolean success,
@@ -1078,6 +1095,7 @@ public class MyTracks extends TabActivity implements OnTouchListener,
private void sendToGoogleDocs(final long trackId) {
Log.d(TAG, "Sending to Docs....");
tracker.trackPageView("/send/docs");
setProgressValue(50);
setProgressMessage(R.string.progress_message_sending_docs);
final SendToDocs sender = new SendToDocs(this,
@@ -1103,6 +1121,7 @@ public class MyTracks extends TabActivity implements OnTouchListener,
}
private void onSendToGoogleDone() {
tracker.dispatch();
SendDialog sendToGoogleDialog = dialogManager.getSendToGoogleDialog();
final boolean sentToMyMaps = sendToGoogleDialog.getSendToMyMaps();
final boolean sentToFusionTables = sendToGoogleDialog.getSendToFusionTables();
@@ -187,7 +187,7 @@ public class TcxTrackWriter implements TrackFormatWriter {
&& sensorData.getCadence().getState() == Sensor.SensorState.SENDING
&& sensorData.getCadence().hasValue()) {
pw.print(" <Cadence>");
pw.print(Math.min(255, sensorData.getCadence().getValue()));
pw.print(Math.min(254, sensorData.getCadence().getValue()));
pw.println("</Cadence>");
}
}
@@ -846,7 +846,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
@Override
public Cursor getLocationsCursor(long trackId, long minTrackPointId,
int maxLocations, boolean descending) {
if (trackId < 0 || maxLocations < 1) {
if (trackId < 0) {
return null;
}
@@ -870,7 +870,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
@Override
public Cursor getWaypointsCursor(long trackId, long minWaypointId,
int maxWaypoints) {
if (trackId < 0 || maxWaypoints < 1) {
if (trackId < 0) {
return null;
}