forked from upstream-mirrors/OpenTracks
Merge to head
This commit is contained in:
@@ -168,6 +168,7 @@ limitations under the License.
|
||||
</activity>
|
||||
|
||||
<activity android:name="com.google.android.apps.mytracks.io.file.ImportActivity"
|
||||
android:label="@string/my_tracks_importer"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
||||
android:noHistory="true">
|
||||
<intent-filter>
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>My Tracks Welcome</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<img src="file:///android_asset/welcome.png" />
|
||||
|
||||
<p>
|
||||
<b>What is My Tracks?</b><br>
|
||||
<i>My Tracks</i> is an application for your Android powered phone. With <i>My Tracks</i> you can record GPS tracks and visualize your hiking, running, biking or any other activity while watching live performance statistics. <i>My Tracks</i> makes it easy to archive your training history with <i>Google Docs</i> and <i>Google My Maps</i>, and share your activities with friends and the world.<br><br>
|
||||
|
||||
<b>How do I see the map, statistics and elevation profile?</b><br>
|
||||
Touch the map. Left and right arrows will appear. Tap on these arrows to cycle between the map view, the track statistics view, and the elevation profile.<br> <br>
|
||||
|
||||
<b>Why does the application sometimes display <i>Waiting for a better GPS fix. Make sure the sky is visible</i>?</b><br>
|
||||
For <i>My Tracks</i> to work, your phone needs to be in line-of-sight contact with the GPS satellites orbiting the earth. If line-of-sight is obstructed by trees, buildings or canyon walls, you may not get an accurate fix. If you see the message Waiting for a better GPS fix, wait a minute or two. If your device does not achieve a fix, move to an area clear of obstructions and try again.
|
||||
<br> <br>
|
||||
|
||||
<b>How do I send my tracks to <i>Google My Maps</i> and <i>Google Docs</i>?</b><br>
|
||||
Tap the <i>Options</i> button located at the bottom right corner of the map and select <i>Send to Google...</i> Then choose to send the track to <i>Google My Maps</i> and/or <i>Google Docs</i>. The first time you do this, you may be prompted to log into your Google account. By default your track will be uploaded to a new <i>My Map</i> that will be created in your account. You can opt to add your track to an existing <i>My Map</i> if you prefer. In that case you will be asked to choose a <i>My Map</i> from your account. You can view and edit all of your <i>My Maps</i> by going to maps.google.com, signing in, and clicking on the <i>My Maps</i> tab.<br> <br>
|
||||
|
||||
<b>How do I share tracks with friends and the rest of the world? </b><br>
|
||||
After recording a track, press the <i>Options</i> button on the bottom right of the map and then select <i>Share with friends...</i> Select how you want to share the track: a) as a link to a <i>Google My Map</i> (you will be prompted to upload the track to <i>Google My Maps</i> if you have not already done so), b) as a GPX file in an e-mail attachment, or c) as a KML file in an e-mail attachment. You can also send an e-mail with a link to your <i>My Map</i> by going to maps.google.com on your computer. Select the map and then click <i>Link</i> on the right side of the Google Maps web site.<br> <br>
|
||||
|
||||
<b>Can I view other people's tracks on my Android phone?</b><br>
|
||||
Yes. Use the <i>Google My Maps Editor</i> application, available from the <i>Android Market</i>, to view tracks that have been uploaded to <a href="http://www.google.com/url?sa=D&q=http%3A%2F%2Fmaps.google.com">maps.google.com</a> by you or your friends. If you have received an e-mail invitation to view a map, you can click on the link contained in the e-mail to view the map on your Android phone, assuming that <i>Google My Maps Editor</i> is installed on the phone.<br> <br>
|
||||
|
||||
<b>What are way point markers?</b><br>
|
||||
Way point markers are used to annotate a place. For example if you are recording a track and you are close to an interesting place, let's say a mountain top, press <i>MENU | Markers | Insert Way point</i> to insert a way point marker at that location. Type a name and description for the place. Once you send your track to Google a place marker will show up on your map. People who view your maps can read your description and learn about this place.<br> <br>
|
||||
|
||||
<b>What are statistics markers?</b><br>
|
||||
Let's say you are recording a bike ride up a hill. You will be able to see the total time and distance for the trip, but wouldn't it be good to know how long the climbing part took and how much altitude has been gained? That's what statistics marker are for. Insert a statistics marker once at the bottom of the hill, and once at the top. Now you will be able to view track statistics for each segment of your ride. Each marker has the statistic for the segment up to the marker. Note: To insert a statistics marker simply press the track ball (while the <i>My Tracks</i> application is in the foreground), or use <i>MENU | Markers | Insert Statistics</i>.<br> <br>
|
||||
|
||||
<b>Do I need a cell signal and data connection to use <i>My Tracks</i>?</b><br>
|
||||
A cell signal or data connection is not required to record GPS tracks. However, if there is no data connection, you will not be able to see satellite imagery or a map. Instead, you will see a grey screen or partial map. Tracks, represented as simple lines, can still be recorded even if there is no data connection.<br> <br>
|
||||
|
||||
<b>How long does the battery last when recording tracks?</b><br>
|
||||
The GPS receiver draws a relatively high amount of power, so a fully charged battery typically survives less than 5 hours. Battery life depends on many factors, including signal strength, battery freshness, and tasks running in parallel. Switching off some or all of the phone's radios will lengthen battery life. Putting the phone into Airplane mode will yield the best results.<br> <br>
|
||||
|
||||
<b>What can I do with tracks after saving them as GPX or KML files to the SD card or sharing such files with friends?</b><br> GPX and KML are standard file formats for storing data from GPS receivers. You can use Google Earth or similar applications to visualize and edit GPS tracks. Go to http://earth.google.com to download the latest version of Google Earth for free.<br> <br>
|
||||
|
||||
<b>How precise are the recorded tracks?</b><br>
|
||||
Under optimal conditions the location error can be +/- 20 feet (6 meters). However, precision depends on the quality of the GPS signal. Your phone needs to be in line-of-sight contact with the GPS satellites orbiting the earth. The signal will be best in open areas free of trees, buildings, canyon walls and other obstructions. The blue circle around the orange location arrow indicates estimated precision. (You may need to zoom in or out to see the circle.) If the precision is too low, a message at the top of the screen will alert you and tracks will not be recorded. You can change the minimum required precision in the <i>My Tracks</i> Settings (See: <i>MENU | Settings | Pause recording if accuracy drops below</i>).<br> <br>
|
||||
|
||||
<b> How precise is the elevation measurement?</b><br>
|
||||
GPS receivers measure elevations much less precisely than latitude and longitude. Elevations can sometimes be off by a few hundred feet, though relative changes are tracked more precisely. To get a good elevation measurement make sure that you have a strong GPS signal (good sky visibility) and wait a few minutes for the elevation to settle to a stable value.<br> <br>
|
||||
|
||||
<b>Can I edit the tracks and correct them for inaccuracies?</b><br>
|
||||
Once you upload tracks to <i>Google My Maps</i>, you can move, delete or insert individual track points as desired.<br> <br>
|
||||
|
||||
<b>Why do very long tracks split into multiple segments upon sending them to <i>Google My Maps</i>? </b><br>
|
||||
Tracks on maps.google.com are limited to 500 points or less. As a result, long tracks are split into multiple pieces upon upload to <i>Google My Maps</i>.<br><br>
|
||||
|
||||
<b>How do I delete all tracks from my phone?</b><br> Press the MENU button and select List tracks. Tap the Delete all tracks button. This permanently deletes the recorded GPS tracks from memory. If you have saved tracks to the SD card, you must delete them separately. Tracks uploaded to <i>Google My Maps</i> and <i>Google Docs</i> must also be deleted separately.<br> <br>
|
||||
|
||||
<b>Who can see maps I send to maps.google.com?</b><br> By default new maps that you send to maps.google.com will be publicly visible. To prevent newly created maps from being public, go to the <i>My Tracks</i> settings screen and deselect the check box labeled <i>Make maps public on maps.google.com</i>. You can change the visibility of existing maps through the maps.google.com web site or using the <i>Google My Maps Editor</i> application from your Android phone.<br> <br> <br><br>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 23 KiB |
+73
-123
@@ -14,139 +14,89 @@ 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.
|
||||
-->
|
||||
<TableLayout
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:stretchColumns="2">
|
||||
<TableRow>
|
||||
<ImageView
|
||||
android:layout_column="1"
|
||||
android:src="@drawable/arrow_icon" />
|
||||
<LinearLayout
|
||||
android:layout_column="2"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content">
|
||||
<TableLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:paddingBottom="2dp"
|
||||
android:stretchColumns="1">
|
||||
<TableRow style="@style/AboutTableRow">
|
||||
<ImageView
|
||||
android:layout_column="0"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/arrow_icon"/>
|
||||
<LinearLayout
|
||||
android:layout_column="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/my_tracks_app_name"
|
||||
android:textSize="30sp" />
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/my_tracks_app_name"
|
||||
android:textSize="30sp" />
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_copyright_notice"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
<TableRow style="@style/AboutTableRow">
|
||||
<TextView
|
||||
android:text="@string/about_team"
|
||||
style="@style/AboutTextView.Column0"/>
|
||||
<LinearLayout
|
||||
android:layout_column="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_copyright_notice"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<View android:layout_height="2dip" />
|
||||
|
||||
<TableRow>
|
||||
<TextView
|
||||
android:paddingLeft="10dip"
|
||||
android:paddingRight="10dip"
|
||||
android:layout_column="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_team"
|
||||
android:textSize="20sp" />
|
||||
<LinearLayout
|
||||
android:layout_column="2"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:text="@string/about_bart"
|
||||
style="@style/AboutTextView"/>
|
||||
<TextView
|
||||
android:text="@string/about_dylan"
|
||||
style="@style/AboutTextView"/>
|
||||
<TextView
|
||||
android:text="@string/about_jimmy"
|
||||
style="@style/AboutTextView"/>
|
||||
<TextView
|
||||
android:text="@string/about_leif"
|
||||
style="@style/AboutTextView"/>
|
||||
<TextView
|
||||
android:text="@string/about_rodrigo"
|
||||
style="@style/AboutTextView"/>
|
||||
<TextView
|
||||
android:text="@string/about_sandor"
|
||||
style="@style/AboutTextView"/>
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
<TableRow style="@style/AboutTableRow">
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_bart"
|
||||
android:textSize="20sp" />
|
||||
android:text="@string/about_version"
|
||||
style="@style/AboutTextView.Column0"/>
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_dylan"
|
||||
android:textSize="20sp" />
|
||||
android:id="@+id/about_version"
|
||||
style="@style/AboutTextView"/>
|
||||
</TableRow>
|
||||
<TableRow style="@style/AboutTableRow">
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_jimmy"
|
||||
android:textSize="20sp" />
|
||||
android:text="@string/about_support"
|
||||
style="@style/AboutTextView.Column0"/>
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_leif"
|
||||
android:textSize="20sp" />
|
||||
android:text="@string/my_tracks_web_url"
|
||||
style="@style/AboutTextView.Url"/>
|
||||
</TableRow>
|
||||
<TableRow style="@style/AboutTableRow">
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_rodrigo"
|
||||
android:textSize="20sp" />
|
||||
android:text="@string/about_privacy"
|
||||
style="@style/AboutTextView.Column0"/>
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_sandor"
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
|
||||
<View android:layout_height="2dip" />
|
||||
|
||||
<TableRow>
|
||||
<TextView
|
||||
android:paddingLeft="10dip"
|
||||
android:paddingRight="10dip"
|
||||
android:layout_column="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_version"
|
||||
android:textSize="20sp" />
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/about_version_register"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/value_unknown"
|
||||
android:textSize="20sp" />
|
||||
</TableRow>
|
||||
|
||||
<View android:layout_height="2dip" />
|
||||
|
||||
<TableRow>
|
||||
<TextView
|
||||
android:paddingLeft="10dip"
|
||||
android:paddingRight="10dip"
|
||||
android:layout_column="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_support"
|
||||
android:textSize="20sp" />
|
||||
<TextView
|
||||
android:autoLink="web"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/my_tracks_web_url"
|
||||
android:textSize="18sp" />
|
||||
</TableRow>
|
||||
|
||||
<View android:layout_height="2dip" />
|
||||
|
||||
<TableRow>
|
||||
<TextView
|
||||
android:paddingLeft="10dip"
|
||||
android:paddingRight="10dip"
|
||||
android:layout_column="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_privacy"
|
||||
android:textSize="20sp" />
|
||||
<TextView
|
||||
android:autoLink="web"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/my_tracks_privacy_url"
|
||||
android:textSize="18sp" />
|
||||
</TableRow>
|
||||
|
||||
<View android:layout_height="4dip" />
|
||||
|
||||
</TableLayout>
|
||||
android:text="@string/my_tracks_privacy_url"
|
||||
style="@style/AboutTextView.Url"/>
|
||||
</TableRow>
|
||||
</TableLayout>
|
||||
</ScrollView>
|
||||
@@ -15,108 +15,118 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/screen"
|
||||
android:layout_width="200dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:minWidth="300dp"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:background="@drawable/list_bar"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/list_bar">
|
||||
android:layout_width="fill_parent">
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/menu_chart_view_chart_settings"
|
||||
android:textSize="20dip"
|
||||
android:textColor="#fff"
|
||||
android:layout_marginLeft="10dip"/>
|
||||
android:textSize="20sp"/>
|
||||
</LinearLayout>
|
||||
<ScrollView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="fill_parent">
|
||||
<TableLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:stretchColumns="1"
|
||||
android:layout_marginTop="5dip"
|
||||
android:layout_marginLeft="5dip">
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_width="fill_parent"
|
||||
android:stretchColumns="1">
|
||||
<TableRow>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="10dip">
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<ImageView android:src="@drawable/x_axis"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/chart_settings_x_axis"
|
||||
android:textSize="20dip" />
|
||||
</LinearLayout>
|
||||
<RadioGroup android:id="@+id/chart_settings_x"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<RadioButton android:id="@+id/chart_settings_by_distance"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="horizontal">
|
||||
<ImageView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:src="@drawable/x_axis"/>
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/chart_settings_x_axis"
|
||||
android:textSize="20sp"/>
|
||||
</LinearLayout>
|
||||
<RadioGroup
|
||||
android:id="@+id/chart_settings_x"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent">
|
||||
<RadioButton
|
||||
android:id="@+id/chart_settings_by_distance"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/chart_settings_by_distance"/>
|
||||
<RadioButton android:id="@+id/chart_settings_by_time"
|
||||
android:layout_width="fill_parent"
|
||||
<RadioButton
|
||||
android:id="@+id/chart_settings_by_time"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/chart_settings_by_time"/>
|
||||
</RadioGroup>
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="10dip">
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="horizontal">
|
||||
<ImageView android:src="@drawable/y_axis"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
<ImageView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:src="@drawable/y_axis"/>
|
||||
<TextView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/chart_settings_y_axis"
|
||||
android:textSize="20dip" />
|
||||
android:textSize="20sp" />
|
||||
</LinearLayout>
|
||||
<CheckBox android:id="@+id/chart_settings_elevation"
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_elevation"
|
||||
android:checked="true"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/stat_elevation"/>
|
||||
<CheckBox android:id="@+id/chart_settings_speed"
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_speed"
|
||||
android:checked="true"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/stat_speed"/>
|
||||
<CheckBox android:id="@+id/chart_settings_power"
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_power"
|
||||
android:checked="true"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/sensor_state_power"/>
|
||||
<CheckBox android:id="@+id/chart_settings_cadence"
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_cadence"
|
||||
android:checked="true"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/sensor_state_cadence"/>
|
||||
<CheckBox android:id="@+id/chart_settings_heart_rate"
|
||||
<CheckBox
|
||||
android:id="@+id/chart_settings_heart_rate"
|
||||
android:checked="true"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:text="@string/sensor_state_heart_rate"/>
|
||||
</LinearLayout>
|
||||
</TableRow>
|
||||
@@ -124,11 +134,13 @@ limitations under the License.
|
||||
</ScrollView>
|
||||
<LinearLayout style="@style/ButtonLayout">
|
||||
<LinearLayout style="@style/ButtonSpacer"/>
|
||||
<Button android:id="@+id/chart_settings_ok"
|
||||
<Button
|
||||
android:id="@+id/chart_settings_ok"
|
||||
android:layout_gravity="left"
|
||||
android:text="@string/generic_ok"
|
||||
style="@style/Button"/>
|
||||
<Button android:id="@+id/chart_settings_cancel"
|
||||
<Button
|
||||
android:id="@+id/chart_settings_cancel"
|
||||
android:layout_gravity="right"
|
||||
android:text="@string/generic_cancel"
|
||||
style="@style/Button"/>
|
||||
|
||||
@@ -48,10 +48,10 @@ limitations under the License.
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
style="@style/WidgetText.Register"
|
||||
style="@style/WidgetTextView.Value"
|
||||
android:id="@+id/appwidget_distance_text" />
|
||||
<TextView
|
||||
style="@style/WidgetText"
|
||||
style="@style/WidgetTextView"
|
||||
android:text="@string/stat_total_distance" />
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
@@ -64,10 +64,10 @@ limitations under the License.
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="2px">
|
||||
<TextView
|
||||
style="@style/WidgetText.Register"
|
||||
style="@style/WidgetTextView.Value"
|
||||
android:id="@+id/appwidget_time_text" />
|
||||
<TextView
|
||||
style="@style/WidgetText"
|
||||
style="@style/WidgetTextView"
|
||||
android:text="@string/stat_moving_time" />
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
@@ -79,10 +79,10 @@ limitations under the License.
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
style="@style/WidgetText.Register"
|
||||
style="@style/WidgetTextView.Value"
|
||||
android:id="@+id/appwidget_speed_text" />
|
||||
<TextView
|
||||
style="@style/WidgetText"
|
||||
style="@style/WidgetTextView"
|
||||
android:text="@string/stat_speed" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -16,21 +16,136 @@ limitations under the License.
|
||||
-->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<WebView
|
||||
android:id="@+id/welcome_web"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1" />
|
||||
<ScrollView
|
||||
android:background="@color/white"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="fill_parent">
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<ImageView
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:scaleType="fitStart"
|
||||
android:src="@drawable/arrow_icon"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_my_tracks_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_my_tracks_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_app_navigation_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_app_navigation_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_add_graph_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_add_graph_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_gps_fix_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_gps_fix_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_send_google_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_send_google_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_share_friends_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_share_friends_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_waypoint_marker_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_waypoint_marker_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_statistics_marker_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_statistics_marker_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_data_connection_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_data_connection_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_battery_life_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_battery_life_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_share_file_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_share_file_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_location_precision_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_location_precision_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_elevation_precision_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_elevation_precision_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_edit_accuracy_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_edit_accuracy_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_split_track_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_split_track_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_delete_all_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_delete_all_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_my_maps_sharing_question"
|
||||
style="@style/WelcomeTextView.Question"/>
|
||||
<TextView
|
||||
android:text="@string/welcome_my_maps_sharing_answer"
|
||||
style="@style/WelcomeTextView"/>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
<LinearLayout style="@style/ButtonLayout">
|
||||
<LinearLayout style="@style/ButtonSpacer"/>
|
||||
<Button android:id="@+id/welcome_ok"
|
||||
<Button
|
||||
android:id="@+id/welcome_ok"
|
||||
android:layout_gravity="left"
|
||||
android:text="@string/generic_ok"
|
||||
style="@style/Button"/>
|
||||
<Button android:id="@+id/welcome_about"
|
||||
<Button
|
||||
android:id="@+id/welcome_about"
|
||||
android:layout_gravity="right"
|
||||
android:text="@string/welcome_about"
|
||||
style="@style/Button"/>
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
End User License Agreement
|
||||
|
||||
By downloading, installing or using this application or any portion thereof ("Application"), you agree to the following terms and conditions (the "Terms and Conditions").
|
||||
|
||||
1. USE OF APPLICATION
|
||||
a. Google grants you the non-exclusive, non-transferable, limited right and license to install and use this Application solely and exclusively for your personal use.
|
||||
b. You may not use the Application in any manner that could damage, disable, overburden, or impair the Application (or servers or networks connected to the Application), nor may you use the Application in any manner that could interfere with any other party's use and enjoyment of the Application (or servers or networks connected to the Application).
|
||||
c. You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) your use of the Application, any breach of your obligations under the Terms and Conditions, and for the consequences (including any loss or damage which Google may suffer) of any such breach.
|
||||
|
||||
2. PROPRIETARY RIGHTS
|
||||
You acknowledge that (a) the Application contains proprietary and confidential information that is protected by applicable intellectual property and other laws, and (b) Google and/or third parties own all right, title and interest in and to the Application and content, excluding content provided by you, that may be presented or accessed through the Application, including without limitation all Intellectual Property Rights therein and thereto. "Intellectual Property Rights" means any and all rights existing from time to time under patent law, copyright law, trade secret law, trademark law, unfair competition law, and any and all other proprietary rights, and any and all applications, renewals, extensions and restorations thereof, now or hereafter in force and effect worldwide. You agree that you will not, and will not allow any third party to, (i) copy, sell, license, distribute, transfer, modify, adapt, translate, prepare derivative works from, decompile, reverse engineer, disassemble or otherwise attempt to derive source code from the Application or content that may be presented or accessed through the Application for any purpose, unless otherwise permitted, (ii) take any action to circumvent or defeat the security or content usage rules provided, deployed or enforced by any functionality (including without limitation digital rights management functionality) contained in the Application, (iii) use the Application to access, copy, transfer, transcode or retransmit content in violation of any law or third party rights, or (iv) remove, obscure, or alter Google's or any third party's copyright notices, trademarks, or other proprietary rights notices affixed to or contained within or accessed in conjunction with or through the Application.
|
||||
|
||||
3. GOOGLE TERMS OF SERVICE AND PRIVACY POLICY
|
||||
a. Google’s Privacy Policy (located at http://www.google.com/privacypolicy.html) explains how Google treats your information and protects your privacy when you use the Application. You agree to the use of your data in accordance with Google’s privacy policies.
|
||||
b. The Application may contain features that are used in conjunction with Google’s search and other services. Accordingly, your use of such features of the Application is also governed by Google’s Terms of Service located at http://www.google.com/terms_of_service.html, Google’s Privacy Policy located at http://www.google.com/privacypolicy.html, as well as any applicable Google Service-specific Terms of Service and Privacy Policy, which may be updated from time to time and without notice.
|
||||
|
||||
4. U.S. GOVERNMENT RESTRICTED RIGHTS
|
||||
This Application, related materials and documentation have been developed entirely with private funds. If the user of the Application is an agency, department, employee, or other entity of the United States Government, the use, duplication, reproduction, release, modification, disclosure, or transfer of the Application, including technical data or manuals, is restricted by the terms, conditions and covenants contained in these Terms and Conditions. In accordance with Federal Acquisition Regulation 12.212 for civilian agencies and Defense Federal Acquisition Regulation Supplement 227.7202 for military agencies, use of the Application is further restricted by these Terms and Conditions.
|
||||
|
||||
5. EXPORT RESTRICTIONS
|
||||
The Application may be subject to export controls or restrictions by the United States or other countries or territories. You agree to comply with all applicable U.S. and international export laws and regulations. These laws include restrictions on destinations, end users, and end use.
|
||||
|
||||
6. TERMINATION
|
||||
These Terms and Conditions will continue to apply until terminated by either you or Google as set forth below. You may terminate these Terms and Conditions at any time by permanently deleting the Application from your mobile device in its entirety. Your rights automatically and immediately terminate without notice from Google or any Third Party if you fail to comply with any provision of these Terms and Conditions. In such event, you must immediately delete the Application.
|
||||
|
||||
7. INDEMNITY
|
||||
To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from your use of the Application, including your downloading, installation, or use of the Application, or your violation of these Terms and Conditions.
|
||||
|
||||
8. DISCLAIMER OF WARRANTIES
|
||||
A. You expressly understand and agree that your use of the application is at your sole discretion and risk and that the application is provided “as is” and “as available” without warranty of any kind.
|
||||
B. You are solely responsible for any damage to your mobile device, or other device, or loss of data that results from such use.
|
||||
C. Google further expressly disclaims all warranties and conditions of any kind, whether express or implied, including, but not limited to the implied warranties and conditions of merchantability, fitness for a particular purpose and non-infringement, with respect to the application.
|
||||
D. The application is not intended for use in the operation of nuclear facilities, life support systems, emergency communications, aircraft navigation or communication systems, air traffic control systems, or any other activities in which the failure of the application could lead to death, personal injury, or severe physical or environmental damage.
|
||||
|
||||
9. LIMITATION OF LIABILITY
|
||||
You expressly understand and agree that google, its subsidiaries and affiliates, and its licensors are not liable to you under any theory of liability for any direct, indirect, incidental, special consequential or exemplary damages that may be incurred by you through your use of the application, including any loss of data or damage to your mobile device, whether or not google or its representatives have been advised of or should have been aware of the possibility of any such losses arising.
|
||||
|
||||
10. MISCELLANEOUS
|
||||
a. These Terms and Conditions constitute the entire Agreement between you and Google relating to the Application and govern your use of the Application, and completely replace any prior or contemporaneous agreements between you and Google regarding the Application.
|
||||
b. The failure of Google to exercise or enforce any right or provision of these Terms and Conditions does not constitute a waiver of such right or provision, which will still be available to Google.
|
||||
c. If any court of law, having the jurisdiction to decide on this matter, rules that any provision of these Terms and Conditions is invalid, then that provision will be removed from the Terms and Conditions without affecting the rest of the Terms and Conditions. The remaining provisions of these Terms and Conditions will continue to be valid and enforceable.
|
||||
d. The rights granted in these Terms and Conditions may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google are permitted to delegate their responsibilities or obligations under these Terms and Conditions without the prior written approval of the other party.
|
||||
e. These Terms and Conditions and your relationship with Google under these Terms and Conditions will be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from these Terms and Conditions. Notwithstanding this, you agree that Google will still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
|
||||
@@ -25,7 +25,6 @@ limitations under the License.
|
||||
<string name="eula_accept">Accepta</string>
|
||||
<string name="eula_decline">Rebutja</string>
|
||||
<string name="eula_title">Acord de llicencia d\'usuari final</string>
|
||||
<string name="export_progress_message">S\'està escrivint a la targeta SD. Això pot trigar una estona.</string>
|
||||
<string name="export_success">Exporta les finalitzades</string>
|
||||
<string name="generic_cancel">Cancel·la</string>
|
||||
<string name="generic_confirm_title">Esteu segur?</string>
|
||||
@@ -79,6 +78,7 @@ limitations under the License.
|
||||
<string name="sd_card_error_no_storage">No s\'ha trobat cap dispositiu d\'emmagatzematge extern. Assegureu-vos que la targeta SD està inserida i que el telèfon no està connectat a un ordinador.</string>
|
||||
<string name="sd_card_error_read_file">No es pot llegir des del fitxer.</string>
|
||||
<string name="sd_card_error_write_file">No es pot escriure a un fitxer.</string>
|
||||
<string name="sd_card_progress_write_file">S\'està escrivint a la targeta SD. Això pot trigar una estona.</string>
|
||||
<string name="sd_card_success_read_file">S\'ha finalitzat la lectura a la targeta SD.</string>
|
||||
<string name="sd_card_success_write_file">S\'ha finalitzat l\'escriptura a la targeta SD.</string>
|
||||
<string name="send_google_choose_account_title">Trieu un compte</string>
|
||||
@@ -197,20 +197,9 @@ limitations under the License.
|
||||
<string name="track_record_error">No es pot iniciar l\'enregistrament. Proveu de nou.</string>
|
||||
<string name="track_record_notification">S\'està enregistrant la ruta...</string>
|
||||
<string name="track_record_success">Ara s\'està enregistrant una ruta nova.</string>
|
||||
<string name="voice_hour">hora</string>
|
||||
<string name="voice_hours">hores</string>
|
||||
<string name="voice_kilometer_per_hour">kilòmetres per hora</string>
|
||||
<string name="voice_kilometers">kilòmetres</string>
|
||||
<string name="voice_mile_per_hour">milles per hora</string>
|
||||
<string name="voice_miles">milles</string>
|
||||
<string name="voice_minute">minut</string>
|
||||
<string name="voice_minutes">minuts</string>
|
||||
<string name="voice_no_distance">Sense distància My Tracks</string>
|
||||
<string name="voice_per_kilometer">per kilòmetre</string>
|
||||
<string name="voice_per_mile">per milla</string>
|
||||
<string name="voice_second">segon</string>
|
||||
<string name="voice_seconds">segons</string>
|
||||
<string name="voice_template">My Tracks %1$.2f %2$s en %3$s at %4$s %5$s</string>
|
||||
<string name="voice_total_distance_zero">Sense distància My Tracks</string>
|
||||
<string name="welcome_about">Quant a My Tracks</string>
|
||||
<string name="welcome_title">Benvingut</string>
|
||||
</resources>
|
||||
|
||||
@@ -25,7 +25,6 @@ limitations under the License.
|
||||
<string name="eula_accept">Akzeptieren</string>
|
||||
<string name="eula_decline">Ablehnen</string>
|
||||
<string name="eula_title">Lizenzvereinbarung für Endverbraucher</string>
|
||||
<string name="export_progress_message">Schreibe Datei auf SD-Karte. Das kann ein wenig dauern.</string>
|
||||
<string name="export_success">Exportieren beendet</string>
|
||||
<string name="generic_cancel">Abbrechen</string>
|
||||
<string name="generic_confirm_title">Bist Du Dir wirklich sicher?</string>
|
||||
@@ -82,6 +81,7 @@ limitations under the License.
|
||||
<string name="sd_card_error_no_storage">Keine externes Speichermedium verfügbar. Stelle sicher, dass eine SD-Karte vorhanden ist und nicht bereits von einem Computer darauf zugegriffen wird.</string>
|
||||
<string name="sd_card_error_read_file">Die Datei konnte nicht gelesen werden.</string>
|
||||
<string name="sd_card_error_write_file">Die Datei kann nicht geschrieben werden.</string>
|
||||
<string name="sd_card_progress_write_file">Schreibe Datei auf SD-Karte. Das kann ein wenig dauern.</string>
|
||||
<string name="sd_card_success_read_file">Lesen von der SD-Karte beendet.</string>
|
||||
<string name="sd_card_success_write_file">Der Track wurde auf die SD-Karte geschrieben.</string>
|
||||
<string name="send_google_choose_account_title">Wähle ein Konto</string>
|
||||
@@ -208,20 +208,9 @@ limitations under the License.
|
||||
<string name="unit_feet">Fuß</string>
|
||||
<string name="unit_hour">Std</string>
|
||||
<string name="unit_minute">Min</string>
|
||||
<string name="voice_hour">Stunde</string>
|
||||
<string name="voice_hours">Stunden</string>
|
||||
<string name="voice_kilometer_per_hour">Kilometer pro Stunde</string>
|
||||
<string name="voice_kilometers">Kilometer</string>
|
||||
<string name="voice_mile_per_hour">Meilen pro Stunde</string>
|
||||
<string name="voice_miles">Meilen</string>
|
||||
<string name="voice_minute">Minute</string>
|
||||
<string name="voice_minutes">Minuten</string>
|
||||
<string name="voice_no_distance">My Tracks keine Entfernung</string>
|
||||
<string name="voice_per_kilometer">pro Kilometer</string>
|
||||
<string name="voice_per_mile">pro Meile</string>
|
||||
<string name="voice_second">Sekunde</string>
|
||||
<string name="voice_seconds">Sekunden</string>
|
||||
<string name="voice_template">My Tracks %1$.2f %2$s in %3$s mit %4$s %5$s</string>
|
||||
<string name="voice_total_distance_zero">My Tracks keine Entfernung</string>
|
||||
<string name="welcome_about">Über My Tracks</string>
|
||||
<string name="welcome_title">Willkommen</string>
|
||||
</resources>
|
||||
|
||||
@@ -27,8 +27,6 @@ limitations under the License.
|
||||
<string name="eula_accept">Aceptar</string>
|
||||
<string name="eula_decline">Declinar</string>
|
||||
<string name="eula_title">Contrato de Licencia de Usuario Final</string>
|
||||
<string name="export_canceled">La operación fue cancelada.</string>
|
||||
<string name="export_progress_message">Escribiendo archivo a tarjeta SD. Esto puede tardar.</string>
|
||||
<string name="export_success">Exportación concluída</string>
|
||||
<string name="generic_cancel">Cancelar</string>
|
||||
<string name="generic_confirm_title">¿Está usted seguro?</string>
|
||||
@@ -41,7 +39,6 @@ limitations under the License.
|
||||
<string name="gps_wait_for_fix">Esperando una ubicación mas exacta del GPS. Asegúrese que el cielo sea visible.</string>
|
||||
<string name="import_error">Error importando el archivo %s</string>
|
||||
<string name="import_no_file">No se encontraron archivos GPX en %s. Es posible que la tarjeta SD no sea accesible o que el directorio no contenga archivos GPX.</string>
|
||||
<string name="import_success">Importados %1$d de %2$d archivos GPX de %3$s</string>
|
||||
<string name="marker_detail_marker_description">Descripción de señal</string>
|
||||
<string name="marker_detail_marker_name">Nombre de señal</string>
|
||||
<string name="marker_detail_marker_type">Tipo de señal (por ejemplo, edificio, bache, atracción...)</string>
|
||||
@@ -88,10 +85,12 @@ limitations under the License.
|
||||
<string name="permission_read_label">leer datos de recorridos grabados</string>
|
||||
<string name="permission_write_description">Poder escribir datos, como registrar o añadir puntos de interés.</string>
|
||||
<string name="permission_write_label">escribir datos de recorridos grabados, iniciar/detener recorridos</string>
|
||||
<string name="sd_card_canceled">La operación fue cancelada.</string>
|
||||
<string name="sd_card_error_create_dir">No es posible crear un directorio en su tarjeta SD.</string>
|
||||
<string name="sd_card_error_no_storage">Ningún almacenamiento externo fue encontrado. Asegúrese que la tarjeta SD se encuentre insertada y que su teléfono no este conectado a una computadora.</string>
|
||||
<string name="sd_card_error_read_file">No es posible leer el archivo.</string>
|
||||
<string name="sd_card_error_write_file">No es posible escribir al archivo.</string>
|
||||
<string name="sd_card_progress_write_file">Escribiendo archivo a tarjeta SD. Esto puede tardar.</string>
|
||||
<string name="sd_card_success_read_file">Lectura de tarjeta SD concluída.</string>
|
||||
<string name="sd_card_success_write_file">Grabación a tarjeta SD concluída.</string>
|
||||
<string name="send_google_choose_account_title">Elija una cuenta</string>
|
||||
@@ -250,20 +249,9 @@ limitations under the License.
|
||||
<string name="track_record_notification">Grabando su recorrido...</string>
|
||||
<string name="track_record_success">Grabando un nuevo recorrido.</string>
|
||||
<string name="unit_feet">pies</string>
|
||||
<string name="voice_hour">hora</string>
|
||||
<string name="voice_hours">horas</string>
|
||||
<string name="voice_kilometer_per_hour">kilómetros por hora</string>
|
||||
<string name="voice_kilometers">kilómetros</string>
|
||||
<string name="voice_mile_per_hour">millas por hora</string>
|
||||
<string name="voice_miles">millas</string>
|
||||
<string name="voice_minute">minuto</string>
|
||||
<string name="voice_minutes">minutos</string>
|
||||
<string name="voice_no_distance">My Tracks sin distancia</string>
|
||||
<string name="voice_per_kilometer">por kilómetro</string>
|
||||
<string name="voice_per_mile">por milla</string>
|
||||
<string name="voice_second">segundo</string>
|
||||
<string name="voice_seconds">segundos</string>
|
||||
<string name="voice_template">My Tracks %1$.2f %2$s en %3$s a %4$s %5$s</string>
|
||||
<string name="voice_total_distance_zero">My Tracks sin distancia</string>
|
||||
<string name="welcome_about">Sobre My Tracks</string>
|
||||
<string name="welcome_title">Bienvenido</string>
|
||||
</resources>
|
||||
|
||||
@@ -27,8 +27,6 @@ limitations under the License.
|
||||
<string name="eula_accept">Hyväksy</string>
|
||||
<string name="eula_decline">Hylkää</string>
|
||||
<string name="eula_title">End User License Agreement</string>
|
||||
<string name="export_canceled">Tapahtuma keskeytettiin.</string>
|
||||
<string name="export_progress_message">Kirjoitetaan tiedostoa SD-kortille. Odota.</string>
|
||||
<string name="export_success">Vienti tehty</string>
|
||||
<string name="generic_cancel">Peruuta</string>
|
||||
<string name="generic_confirm_title">Oletko varma?</string>
|
||||
@@ -44,7 +42,6 @@ limitations under the License.
|
||||
<string name="gps_wait_for_fix">Odotetaan parempaa GPS-yhteyttä. Varmista että taivas on näkyvissä.</string>
|
||||
<string name="import_error">Virhe tuotaessa tiedostoa %s</string>
|
||||
<string name="import_no_file">Lähteestä %s ei löytynyt GPX-tiedostoja. SD-kortti saattaa olla lukukelvoton tai hakemistossa ei ole GPX-tiedostoja.</string>
|
||||
<string name="import_success">Tuotu %1$d GPX-tiedostoa %2$d:sta lähteestä %3$s</string>
|
||||
<string name="marker_detail_marker_description">Merkinnän kuvaus</string>
|
||||
<string name="marker_detail_marker_name">Merkinnän nimi</string>
|
||||
<string name="marker_detail_marker_type">Merkinnän tyyppi (esim. rakennus, kuoppa, nähtävyys...)</string>
|
||||
@@ -91,10 +88,12 @@ limitations under the License.
|
||||
<string name="permission_read_label">lue tallennettua reittidataa</string>
|
||||
<string name="permission_write_description">Mahdollista reittidatan kirjoittaminen, kuten tallennuksen aloittaminen, merkintöjen lisääminen jne.</string>
|
||||
<string name="permission_write_label">kirjoita tallennettua reittidataa, aloita/pysäytä reitin tallennus</string>
|
||||
<string name="sd_card_canceled">Tapahtuma keskeytettiin.</string>
|
||||
<string name="sd_card_error_create_dir">Hakemistoa ei voitu luoda SD-kortille.</string>
|
||||
<string name="sd_card_error_no_storage">Ulkoista tallennusmediaa ei löytynyt. Varmista että SD-kortti on kytketty eikä puhelinta ole liitetty tietokoneeseen.</string>
|
||||
<string name="sd_card_error_read_file">Lukuvirhe.</string>
|
||||
<string name="sd_card_error_write_file">Kirjoitusvirhe.</string>
|
||||
<string name="sd_card_progress_write_file">Kirjoitetaan tiedostoa SD-kortille. Odota.</string>
|
||||
<string name="sd_card_success_read_file">SD-kortin luku valmis.</string>
|
||||
<string name="sd_card_success_write_file">SD-kortille kirjoitus valmis.</string>
|
||||
<string name="send_google_choose_account_title">Valitse tili</string>
|
||||
@@ -250,20 +249,9 @@ limitations under the License.
|
||||
<string name="unit_minute_per_mile">min/mi</string>
|
||||
<string name="unit_revolution_per_minute">rpm</string>
|
||||
<string name="unit_watt">W</string>
|
||||
<string name="voice_hour">tunti</string>
|
||||
<string name="voice_hours">tuntia</string>
|
||||
<string name="voice_kilometer_per_hour">kilometriä tunnissa</string>
|
||||
<string name="voice_kilometers">kilometriä</string>
|
||||
<string name="voice_mile_per_hour">mailia tunnissa</string>
|
||||
<string name="voice_miles">mailia</string>
|
||||
<string name="voice_minute">minuutti</string>
|
||||
<string name="voice_minutes">minuuttia</string>
|
||||
<string name="voice_no_distance">My Tracks ei etäisyyttä</string>
|
||||
<string name="voice_per_kilometer">per kilometri</string>
|
||||
<string name="voice_per_mile">per maili</string>
|
||||
<string name="voice_second">sekunti</string>
|
||||
<string name="voice_seconds">sekuntia</string>
|
||||
<string name="voice_template">My Tracks %1$.2f %2$s ajassa %3$s nopeudella %4$s %5$s</string>
|
||||
<string name="voice_total_distance_zero">My Tracks ei etäisyyttä</string>
|
||||
<string name="welcome_about">Tietoa My Tracksista</string>
|
||||
<string name="welcome_title">Tervetuloa</string>
|
||||
</resources>
|
||||
|
||||
@@ -23,7 +23,6 @@ limitations under the License.
|
||||
<string name="eula_accept">Accepter</string>
|
||||
<string name="eula_decline">Décliner</string>
|
||||
<string name="eula_title">Accord de licence utilisateur</string>
|
||||
<string name="export_progress_message">Enregistrement du fichier sur la carte SD. Patientez SVP.</string>
|
||||
<string name="generic_cancel">Annuler</string>
|
||||
<string name="generic_confirm_title">Êtes-vous sûr?</string>
|
||||
<string name="generic_error_title">Erreur</string>
|
||||
@@ -78,6 +77,7 @@ limitations under the License.
|
||||
<string name="sd_card_error_create_dir">Impossible de créer un dossier dans la carte SD.</string>
|
||||
<string name="sd_card_error_no_storage">Aucun emplacement externe de sauvegarde n\'a été trouvé. Assurez-vous qu\'une carte SD est insérée et que votre téléphone n\'est pas relié à un ordinateur.</string>
|
||||
<string name="sd_card_error_write_file">Impossible d\'écrire dans le fichier.</string>
|
||||
<string name="sd_card_progress_write_file">Enregistrement du fichier sur la carte SD. Patientez SVP.</string>
|
||||
<string name="sd_card_success_write_file">Parcours enregistré sur la carte SD.</string>
|
||||
<string name="send_google_choose_account_title">Choisissez un compte</string>
|
||||
<string name="send_google_no_account_message">Un compte Google est nécessaire pour télécharger le parcours.</string>
|
||||
@@ -198,18 +198,9 @@ limitations under the License.
|
||||
<string name="unit_feet">pied</string>
|
||||
<string name="unit_kilometer_per_hour">km/h</string>
|
||||
<string name="unit_mile_per_hour">mi/h</string>
|
||||
<string name="voice_hour">heure</string>
|
||||
<string name="voice_hours">heures</string>
|
||||
<string name="voice_kilometer_per_hour">kilomètres/heure</string>
|
||||
<string name="voice_kilometers">kilomètres</string>
|
||||
<string name="voice_mile_per_hour">miles/heure</string>
|
||||
<string name="voice_miles">milles</string>
|
||||
<string name="voice_no_distance">My Tracks pas de distance disponible</string>
|
||||
<string name="voice_per_kilometer">par kilomètre</string>
|
||||
<string name="voice_per_mile">per mile</string>
|
||||
<string name="voice_second">seconde</string>
|
||||
<string name="voice_seconds">secondes</string>
|
||||
<string name="voice_template">My Tracks %1$.2f %2$s en %3$s at %4$s %5$s</string>
|
||||
<string name="voice_total_distance_zero">My Tracks pas de distance disponible</string>
|
||||
<string name="welcome_about">À propos de My Tracks</string>
|
||||
<string name="welcome_title">Bienvenue</string>
|
||||
</resources>
|
||||
|
||||
@@ -25,7 +25,6 @@ limitations under the License.
|
||||
<string name="eula_accept">Accetto</string>
|
||||
<string name="eula_decline">Non accetto</string>
|
||||
<string name="eula_title">Termini di servizio</string>
|
||||
<string name="export_progress_message">Salvataggio del file sulla scheda SD in corso. Attendere prego...</string>
|
||||
<string name="export_success">Esportazione terminata.</string>
|
||||
<string name="generic_cancel">Annulla</string>
|
||||
<string name="generic_confirm_title">Sei sicuro?</string>
|
||||
@@ -76,6 +75,7 @@ limitations under the License.
|
||||
<string name="sd_card_error_create_dir">Impossibile creare directory sulla scheda SD.</string>
|
||||
<string name="sd_card_error_no_storage">Nessuna memoria esterna trovata. Assicurati che la scheda SD sia inserita e che il telefono no sia montato su un computer.</string>
|
||||
<string name="sd_card_error_write_file">Impossibile scrivere su file.</string>
|
||||
<string name="sd_card_progress_write_file">Salvataggio del file sulla scheda SD in corso. Attendere prego...</string>
|
||||
<string name="sd_card_success_write_file">Finito di salvare il percorso sulla scheda SD.</string>
|
||||
<string name="send_google_choose_account_title">Scegli un account</string>
|
||||
<string name="send_google_docs">Google Docs</string>
|
||||
@@ -170,20 +170,9 @@ limitations under the License.
|
||||
<string name="unit_minute">min</string>
|
||||
<string name="unit_minute_per_kilometer">min/km</string>
|
||||
<string name="unit_minute_per_mile">min/mi</string>
|
||||
<string name="voice_hour">ora</string>
|
||||
<string name="voice_hours">ore</string>
|
||||
<string name="voice_kilometer_per_hour">chilometri orari</string>
|
||||
<string name="voice_kilometers">chilometri</string>
|
||||
<string name="voice_mile_per_hour">miglia orarie</string>
|
||||
<string name="voice_miles">miglia</string>
|
||||
<string name="voice_minute">minuto</string>
|
||||
<string name="voice_minutes">minuti</string>
|
||||
<string name="voice_no_distance">Mai Tracks Distanza non disponibile</string>
|
||||
<string name="voice_per_kilometer">per chilometro</string>
|
||||
<string name="voice_per_mile">per miglio</string>
|
||||
<string name="voice_second">secondo</string>
|
||||
<string name="voice_seconds">secondi</string>
|
||||
<string name="voice_template">Mai Tracks %1$.2f %2$s in %3$s a %4$s %5$s</string>
|
||||
<string name="voice_total_distance_zero">Mai Tracks Distanza non disponibile</string>
|
||||
<string name="welcome_about">Informazioni su My Tracks</string>
|
||||
<string name="welcome_title">Benvenuto</string>
|
||||
</resources>
|
||||
|
||||
@@ -27,7 +27,6 @@ limitations under the License.
|
||||
<string name="eula_accept">同意する</string>
|
||||
<string name="eula_decline">拒否する</string>
|
||||
<string name="eula_title">エンドユーザライセンス契約書</string>
|
||||
<string name="export_progress_message">SDカードにデータを書き込んでいます.若干時間がかかります.</string>
|
||||
<string name="export_success">出力終了</string>
|
||||
<string name="generic_cancel">キャンセル</string>
|
||||
<string name="generic_confirm_title">よろしいですか?</string>
|
||||
@@ -42,7 +41,6 @@ limitations under the License.
|
||||
<string name="gps_wait_for_fix">GPS位置精度がよくなるまで待機しています.空が見えるところにいて下さい.</string>
|
||||
<string name="import_error">ファイル %s のインポートエラー</string>
|
||||
<string name="import_no_file">%s ではGPXファイルがありません.SDカードを読み込めないかディレクトリにGPXファイルが無いかも知れません.</string>
|
||||
<string name="import_success">%3$s からGPXファイル %2$d件のうち %1$d件をインポートしました</string>
|
||||
<string name="marker_detail_marker_description">マーカー説明</string>
|
||||
<string name="marker_detail_marker_name">マーカー名</string>
|
||||
<string name="marker_detail_marker_type">マーカータイプ(建物、洞穴、名所...)</string>
|
||||
@@ -93,6 +91,7 @@ limitations under the License.
|
||||
<string name="sd_card_error_no_storage">外部ストレージを発見できませんでした.SDカードが刺さっているか、端末がコンピュータにマウントされていないか確認してください.</string>
|
||||
<string name="sd_card_error_read_file">ファイルからの読み込みができません.</string>
|
||||
<string name="sd_card_error_write_file">ファイルへの書き込みができません.</string>
|
||||
<string name="sd_card_progress_write_file">SDカードにデータを書き込んでいます.若干時間がかかります.</string>
|
||||
<string name="sd_card_success_read_file">SDカードからの読み込み終了.</string>
|
||||
<string name="sd_card_success_write_file">SDカードへの書き込み終了.</string>
|
||||
<string name="send_google_choose_account_title">アカウント選択</string>
|
||||
@@ -226,20 +225,9 @@ limitations under the License.
|
||||
<string name="track_record_success">新しいトラックを記録中です.</string>
|
||||
<string name="unit_hour">時</string>
|
||||
<string name="unit_minute">分</string>
|
||||
<string name="voice_hour">時</string>
|
||||
<string name="voice_hours">時</string>
|
||||
<string name="voice_kilometer_per_hour">キロメータ毎時</string>
|
||||
<string name="voice_kilometers">キロメータ</string>
|
||||
<string name="voice_mile_per_hour">マイル毎時</string>
|
||||
<string name="voice_miles">マイル</string>
|
||||
<string name="voice_minute">分</string>
|
||||
<string name="voice_minutes">分</string>
|
||||
<string name="voice_no_distance">My Tracks 移動していません</string>
|
||||
<string name="voice_per_kilometer">毎キロメータ</string>
|
||||
<string name="voice_per_mile">毎マイル</string>
|
||||
<string name="voice_second">秒</string>
|
||||
<string name="voice_seconds">秒</string>
|
||||
<string name="voice_template">My Tracks %1$.2f %2$s 時間 %3$s 速度/ペース %4$s %5$s</string>
|
||||
<string name="voice_total_distance_zero">My Tracks 移動していません</string>
|
||||
<string name="welcome_about">My Tracksについて</string>
|
||||
<string name="welcome_title">ようこそ</string>
|
||||
</resources>
|
||||
|
||||
@@ -25,7 +25,6 @@ limitations under the License.
|
||||
<string name="eula_accept">Zaakceptuj</string>
|
||||
<string name="eula_decline">Odrzuć</string>
|
||||
<string name="eula_title">Licencja użytkownika końcowego</string>
|
||||
<string name="export_progress_message">Zapisywanie pliku na kartę SD. Poczekaj chwilę.</string>
|
||||
<string name="export_success">Eksport zakończony</string>
|
||||
<string name="generic_cancel">Anuluj</string>
|
||||
<string name="generic_confirm_title">Jesteś pewien?</string>
|
||||
@@ -78,6 +77,7 @@ limitations under the License.
|
||||
<string name="sd_card_error_no_storage">Nie znaleziono zewnętrznej pamięci. Upewniej się, że karta SD jest w telefonie i nie jest podłączona do komputera.</string>
|
||||
<string name="sd_card_error_read_file">Nie można odczytać pliku.</string>
|
||||
<string name="sd_card_error_write_file">Nie można zapisać pliku.</string>
|
||||
<string name="sd_card_progress_write_file">Zapisywanie pliku na kartę SD. Poczekaj chwilę.</string>
|
||||
<string name="sd_card_success_read_file">Zakończono odczytywanie z karty SD.</string>
|
||||
<string name="sd_card_success_write_file">Zakończono zapisywanie na karcie SD.</string>
|
||||
<string name="send_google_choose_account_title">Wybierz konto</string>
|
||||
@@ -199,20 +199,9 @@ limitations under the License.
|
||||
<string name="unit_minute">min</string>
|
||||
<string name="unit_minute_per_kilometer">min/km</string>
|
||||
<string name="unit_minute_per_mile">min/mi</string>
|
||||
<string name="voice_hour">godzina</string>
|
||||
<string name="voice_hours">godziny</string>
|
||||
<string name="voice_kilometer_per_hour">kilometry na godzinę</string>
|
||||
<string name="voice_kilometers">kilometerów</string>
|
||||
<string name="voice_mile_per_hour">mile na godzinę</string>
|
||||
<string name="voice_miles">mil</string>
|
||||
<string name="voice_minute">minuta</string>
|
||||
<string name="voice_minutes">minuty</string>
|
||||
<string name="voice_no_distance">My Tracks brak odległości</string>
|
||||
<string name="voice_per_kilometer">na kilometr</string>
|
||||
<string name="voice_per_mile">na milę</string>
|
||||
<string name="voice_second">sekunda</string>
|
||||
<string name="voice_seconds">sekundy</string>
|
||||
<string name="voice_template">My Tracks %1$.2f %2$s w %3$s w tempie %4$s %5$s</string>
|
||||
<string name="voice_total_distance_zero">My Tracks brak odległości</string>
|
||||
<string name="welcome_about">O My Tracks</string>
|
||||
<string name="welcome_title">Witamy</string>
|
||||
</resources>
|
||||
|
||||
@@ -25,7 +25,6 @@ limitations under the License.
|
||||
<string name="eula_accept">Aceitar</string>
|
||||
<string name="eula_decline">Recusar</string>
|
||||
<string name="eula_title">Contrato de Licença de Usuário Final</string>
|
||||
<string name="export_progress_message">Salvando arquivo para o cartão SD. Isso pode demorar alguns instantes.</string>
|
||||
<string name="generic_cancel">Cancelar</string>
|
||||
<string name="generic_confirm_title">Você tem certeza?</string>
|
||||
<string name="generic_error_title">Erro</string>
|
||||
@@ -74,6 +73,7 @@ limitations under the License.
|
||||
<string name="sd_card_error_create_dir">Impossível criar diretório no cartão SD.</string>
|
||||
<string name="sd_card_error_no_storage">Nenhum armazenamento externo foi encontrado. Assegure-se de que um cartão SD esteja inserido e que seu telefone não esteja montado em um computador.</string>
|
||||
<string name="sd_card_error_write_file">Impossível gravar arquivo.</string>
|
||||
<string name="sd_card_progress_write_file">Salvando arquivo para o cartão SD. Isso pode demorar alguns instantes.</string>
|
||||
<string name="sd_card_success_write_file">Gravação no cartão SD concluída.</string>
|
||||
<string name="send_google_choose_account_title">Escolher conta</string>
|
||||
<string name="send_google_docs">Google Docs</string>
|
||||
@@ -159,20 +159,9 @@ limitations under the License.
|
||||
<string name="track_record_success">Gravando um novo caminho.</string>
|
||||
<string name="unit_feet">pés</string>
|
||||
<string name="unit_hour">h</string>
|
||||
<string name="voice_hour">hora</string>
|
||||
<string name="voice_hours">horas</string>
|
||||
<string name="voice_kilometer_per_hour">kilômetros por hora</string>
|
||||
<string name="voice_kilometers">kilômetros</string>
|
||||
<string name="voice_mile_per_hour">milhas por hora</string>
|
||||
<string name="voice_miles">milhas</string>
|
||||
<string name="voice_minute">minuto</string>
|
||||
<string name="voice_minutes">minutos</string>
|
||||
<string name="voice_no_distance">My Tracks sem distância</string>
|
||||
<string name="voice_per_kilometer">por kilômetro</string>
|
||||
<string name="voice_per_mile">por milha</string>
|
||||
<string name="voice_second">segundo</string>
|
||||
<string name="voice_seconds">segundos</string>
|
||||
<string name="voice_template">My Tracks %1$.2f %2$s em %3$s a %4$s %5$s</string>
|
||||
<string name="voice_total_distance_zero">My Tracks sem distância</string>
|
||||
<string name="welcome_about">Sobre My Tracks</string>
|
||||
<string name="welcome_title">Bem-vindo</string>
|
||||
</resources>
|
||||
|
||||
@@ -27,7 +27,6 @@ limitations under the License.
|
||||
<string name="eula_accept">Принять</string>
|
||||
<string name="eula_decline">Отклонить</string>
|
||||
<string name="eula_title">Лицензионное соглашение</string>
|
||||
<string name="export_progress_message">Запись файла на SD карту. Это может занять некоторое время.</string>
|
||||
<string name="export_success">Экспорт закончен</string>
|
||||
<string name="generic_cancel">Отмена</string>
|
||||
<string name="generic_confirm_title">Вы уверены?</string>
|
||||
@@ -43,7 +42,6 @@ limitations under the License.
|
||||
<string name="gps_wait_for_fix">Ожидание сигнала GPS. Убедитесь в том, что вы находитесь под открытым небом.</string>
|
||||
<string name="import_error">Ошибка импорта файла %s</string>
|
||||
<string name="import_no_file">GPX файлы не найденны в %s. Возможно не читается SD-карта или каталог не содержит GPX файлы.</string>
|
||||
<string name="import_success">Импортировано %1$d из %2$d GPX файлов с %3$s</string>
|
||||
<string name="marker_detail_marker_description">Описание маркера</string>
|
||||
<string name="marker_detail_marker_name">Имя маркера</string>
|
||||
<string name="marker_detail_marker_type">Тип маркера (например: здание, выбоина, достопримечательность...)</string>
|
||||
@@ -94,6 +92,7 @@ limitations under the License.
|
||||
<string name="sd_card_error_no_storage">Не обнаружено внешнее устройство хранения данных. Убедитесь, что SD карта вставлена, и что ваш телефон не подключен к компьютеру.</string>
|
||||
<string name="sd_card_error_read_file">Невозможно прочитать из файла.</string>
|
||||
<string name="sd_card_error_write_file">Невозможно записать файл.</string>
|
||||
<string name="sd_card_progress_write_file">Запись файла на SD карту. Это может занять некоторое время.</string>
|
||||
<string name="sd_card_success_read_file">Чтение с SD карты закончено.</string>
|
||||
<string name="sd_card_success_write_file">Запись на SD карту закончена.</string>
|
||||
<string name="send_google_choose_account_title">Выбор учетной записи</string>
|
||||
@@ -246,20 +245,9 @@ limitations under the License.
|
||||
<string name="unit_minute_per_mile">мин/миля</string>
|
||||
<string name="unit_revolution_per_minute">об/мин</string>
|
||||
<string name="unit_watt">Вт</string>
|
||||
<string name="voice_hour">час</string>
|
||||
<string name="voice_hours">часов</string>
|
||||
<string name="voice_kilometer_per_hour">километров в час</string>
|
||||
<string name="voice_kilometers">километров</string>
|
||||
<string name="voice_mile_per_hour">миль в час</string>
|
||||
<string name="voice_miles">мили</string>
|
||||
<string name="voice_minute">минута</string>
|
||||
<string name="voice_minutes">минут</string>
|
||||
<string name="voice_no_distance">My Tracks нет расстояния</string>
|
||||
<string name="voice_per_kilometer">за километр</string>
|
||||
<string name="voice_per_mile">за милю</string>
|
||||
<string name="voice_second">секунда</string>
|
||||
<string name="voice_seconds">секунд</string>
|
||||
<string name="voice_template">Мои треки %1$.2f %2$s в %3$s на %4$s %5$s</string>
|
||||
<string name="voice_total_distance_zero">My Tracks нет расстояния</string>
|
||||
<string name="welcome_about">О My Tracks</string>
|
||||
<string name="welcome_title">Добро пожаловать</string>
|
||||
</resources>
|
||||
|
||||
@@ -25,7 +25,6 @@ limitations under the License.
|
||||
<string name="eula_accept">Acceptera</string>
|
||||
<string name="eula_decline">Avböj</string>
|
||||
<string name="eula_title">Licensavtal för slutanvändare</string>
|
||||
<string name="export_progress_message">Skriver till SD-kortet. Detta kan ta en stund.</string>
|
||||
<string name="export_success">Exporteringen slutfördes</string>
|
||||
<string name="generic_cancel">Avbryt</string>
|
||||
<string name="generic_confirm_title">Är du säker?</string>
|
||||
@@ -76,6 +75,7 @@ limitations under the License.
|
||||
<string name="sd_card_error_create_dir">Kunde inte skapa katalog på SD-kort.</string>
|
||||
<string name="sd_card_error_no_storage">Ingen extern lagring hittades. Se till att ett SD-kort sitter i och att telefonen inte är monterad till en dator.</string>
|
||||
<string name="sd_card_error_write_file">Kan inte skriva till filen.</string>
|
||||
<string name="sd_card_progress_write_file">Skriver till SD-kortet. Detta kan ta en stund.</string>
|
||||
<string name="sd_card_success_write_file">Slutförde skrivningen av spåret till SD-kort.</string>
|
||||
<string name="send_google_choose_account_title">Välj konto</string>
|
||||
<string name="send_google_docs">Google Dokument</string>
|
||||
@@ -169,20 +169,9 @@ limitations under the License.
|
||||
<string name="unit_minute">min</string>
|
||||
<string name="unit_minute_per_kilometer">min/km</string>
|
||||
<string name="unit_minute_per_mile">min/mi</string>
|
||||
<string name="voice_hour">timme</string>
|
||||
<string name="voice_hours">timmar</string>
|
||||
<string name="voice_kilometer_per_hour">kilometer i timmen</string>
|
||||
<string name="voice_kilometers">kilometer</string>
|
||||
<string name="voice_mile_per_hour">miles i timmen</string>
|
||||
<string name="voice_miles">miles</string>
|
||||
<string name="voice_minute">minut</string>
|
||||
<string name="voice_minutes">minuter</string>
|
||||
<string name="voice_no_distance">My Tracks ingen distans</string>
|
||||
<string name="voice_per_kilometer">per kilometer</string>
|
||||
<string name="voice_per_mile">per mile</string>
|
||||
<string name="voice_second">sekund</string>
|
||||
<string name="voice_seconds">sekunder</string>
|
||||
<string name="voice_template">My Tracks %1$.2f %2$s på %3$s i %4$s %5$s</string>
|
||||
<string name="voice_total_distance_zero">My Tracks ingen distans</string>
|
||||
<string name="welcome_about">Om My Tracks</string>
|
||||
<string name="welcome_title">Välkommen</string>
|
||||
</resources>
|
||||
|
||||
@@ -27,8 +27,6 @@ limitations under the License.
|
||||
<string name="eula_accept">同意</string>
|
||||
<string name="eula_decline">拒绝</string>
|
||||
<string name="eula_title">最终用户协议</string>
|
||||
<string name="export_canceled">操作已被取消.</string>
|
||||
<string name="export_progress_message">写入文件到 SD 卡中. 请稍候.</string>
|
||||
<string name="export_success">导出完毕</string>
|
||||
<string name="generic_cancel">取消</string>
|
||||
<string name="generic_confirm_title">请确认</string>
|
||||
@@ -44,7 +42,6 @@ limitations under the License.
|
||||
<string name="gps_wait_for_fix">等待更准确的 GPS 定位. 请确定可以看见天空.</string>
|
||||
<string name="import_error">导入文件 %s 出错.</string>
|
||||
<string name="import_no_file">在 %s 中未找到 GPX 文件. SD 存储卡不可用或者目录中没有 GPX 文件.</string>
|
||||
<string name="import_success">已从 %3$s 导入 %1$d 个 GPX 文件, 共 %2$d 个.</string>
|
||||
<string name="marker_detail_marker_description">标记描述</string>
|
||||
<string name="marker_detail_marker_name">标记名称</string>
|
||||
<string name="marker_detail_marker_type">标记类型 (例如: 建筑, 陷坑, 景点...)</string>
|
||||
@@ -85,9 +82,11 @@ limitations under the License.
|
||||
<string name="my_maps_list_public_label">公开</string>
|
||||
<string name="my_maps_list_title">发送到 Google My Maps</string>
|
||||
<string name="my_maps_list_unlisted_label">未公布</string>
|
||||
<string name="sd_card_canceled">操作已被取消.</string>
|
||||
<string name="sd_card_error_create_dir">无法在 SD 存储卡上创建目录.</string>
|
||||
<string name="sd_card_error_no_storage">没有发现存储设备. 请确认插入了 SD 存储卡并且你的手机没有将挂载 SD 卡到电脑.</string>
|
||||
<string name="sd_card_error_write_file">无法写入文件.</string>
|
||||
<string name="sd_card_progress_write_file">写入文件到 SD 卡中. 请稍候.</string>
|
||||
<string name="sd_card_success_read_file">从 SD 存储卡读取完毕.</string>
|
||||
<string name="sd_card_success_write_file">轨迹已导出到 SD 存储卡.</string>
|
||||
<string name="send_google_choose_account_title">选择帐户</string>
|
||||
@@ -227,20 +226,9 @@ limitations under the License.
|
||||
<string name="track_record_success">现在开始记录新的轨迹.</string>
|
||||
<string name="unit_hour">时</string>
|
||||
<string name="unit_minute">分</string>
|
||||
<string name="voice_hour">小时</string>
|
||||
<string name="voice_hours">小时</string>
|
||||
<string name="voice_kilometer_per_hour">千米每小时</string>
|
||||
<string name="voice_kilometers">千米</string>
|
||||
<string name="voice_mile_per_hour">英里每小时</string>
|
||||
<string name="voice_miles">英里</string>
|
||||
<string name="voice_minute">分钟</string>
|
||||
<string name="voice_minutes">分钟</string>
|
||||
<string name="voice_no_distance">My Tracks 无距离</string>
|
||||
<string name="voice_per_kilometer">每千米</string>
|
||||
<string name="voice_per_mile">每英里</string>
|
||||
<string name="voice_second">秒</string>
|
||||
<string name="voice_seconds">秒</string>
|
||||
<string name="voice_template">My Tracks %1$.2f %2$s 用时 %3$s 速度 %4$s %5$s</string>
|
||||
<string name="voice_total_distance_zero">My Tracks 无距离</string>
|
||||
<string name="welcome_about">关于 My Tracks</string>
|
||||
<string name="welcome_title">欢迎</string>
|
||||
</resources>
|
||||
|
||||
@@ -251,6 +251,6 @@ limitations under the License.
|
||||
<item>@string/waypoint_type_tunnel</item>
|
||||
<item>@string/waypoint_type_waterfall</item>
|
||||
<item>@string/waypoint_type_water_fountain</item>
|
||||
<item>@string/waypoint_type_way_point</item>
|
||||
<item>@string/waypoint_type_waypoint</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
@@ -32,7 +32,6 @@ limitations under the License.
|
||||
http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png
|
||||
</string>
|
||||
<string name="my_tracks_analytics_id">UA-7222692-2</string>
|
||||
<string name="my_tracks_app_name">My Tracks</string>
|
||||
<string name="my_tracks_privacy_url">m.google.com/privacy</string>
|
||||
<string name="my_tracks_recording_service_name">My Tracks Recording Service</string>
|
||||
<string name="my_tracks_web_url">mytracks.appspot.com</string>
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2011 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.
|
||||
-->
|
||||
<resources>
|
||||
<plurals name="importGpxFiles">
|
||||
<item quantity="zero">@string/import_gpx_files_zero</item>
|
||||
<item quantity="one">@string/import_gpx_files_one</item>
|
||||
<item quantity="two">@string/import_gpx_files_two</item>
|
||||
<item quantity="few">@string/import_gpx_files_few</item>
|
||||
<item quantity="many">@string/import_gpx_files_many</item>
|
||||
<item quantity="other">@string/import_gpx_files_other</item>
|
||||
</plurals>
|
||||
<plurals name="voiceHours">
|
||||
<item quantity="zero">@string/voice_hours_zero</item>
|
||||
<item quantity="one">@string/voice_hours_one</item>
|
||||
<item quantity="two">@string/voice_hours_two</item>
|
||||
<item quantity="few">@string/voice_hours_few</item>
|
||||
<item quantity="many">@string/voice_hours_many</item>
|
||||
<item quantity="other">@string/voice_hours_other</item>
|
||||
</plurals>
|
||||
<plurals name="voiceMinutes">
|
||||
<item quantity="zero">@string/voice_minutes_zero</item>
|
||||
<item quantity="one">@string/voice_minutes_one</item>
|
||||
<item quantity="two">@string/voice_minutes_two</item>
|
||||
<item quantity="few">@string/voice_minutes_few</item>
|
||||
<item quantity="many">@string/voice_minutes_many</item>
|
||||
<item quantity="other">@string/voice_minutes_other</item>
|
||||
</plurals>
|
||||
<plurals name="voiceSeconds">
|
||||
<item quantity="zero">@string/voice_seconds_zero</item>
|
||||
<item quantity="one">@string/voice_seconds_one</item>
|
||||
<item quantity="two">@string/voice_seconds_two</item>
|
||||
<item quantity="few">@string/voice_seconds_few</item>
|
||||
<item quantity="many">@string/voice_seconds_many</item>
|
||||
<item quantity="other">@string/voice_seconds_other</item>
|
||||
</plurals>
|
||||
<plurals name="voiceSpeedKilometersPerHour">
|
||||
<item quantity="zero">@string/voice_speed_kilometers_per_hour_zero</item>
|
||||
<item quantity="one">@string/voice_speed_kilometers_per_hour_one</item>
|
||||
<item quantity="two">@string/voice_speed_kilometers_per_hour_two</item>
|
||||
<item quantity="few">@string/voice_speed_kilometers_per_hour_few</item>
|
||||
<item quantity="many">@string/voice_speed_kilometers_per_hour_many</item>
|
||||
<item quantity="other">@string/voice_speed_kilometers_per_hour_other</item>
|
||||
</plurals>
|
||||
<plurals name="voiceSpeedMilesPerHour">
|
||||
<item quantity="zero">@string/voice_speed_miles_per_hour_zero</item>
|
||||
<item quantity="one">@string/voice_speed_miles_per_hour_one</item>
|
||||
<item quantity="two">@string/voice_speed_miles_per_hour_two</item>
|
||||
<item quantity="few">@string/voice_speed_miles_per_hour_few</item>
|
||||
<item quantity="many">@string/voice_speed_miles_per_hour_many</item>
|
||||
<item quantity="other">@string/voice_speed_miles_per_hour_other</item>
|
||||
</plurals>
|
||||
<plurals name="voiceTotalDistanceKilometers">
|
||||
<item quantity="zero">@string/voice_total_distance_kilometers_zero</item>
|
||||
<item quantity="one">@string/voice_total_distance_kilometers_one</item>
|
||||
<item quantity="two">@string/voice_total_distance_kilometers_two</item>
|
||||
<item quantity="few">@string/voice_total_distance_kilometers_few</item>
|
||||
<item quantity="many">@string/voice_total_distance_kilometers_many</item>
|
||||
<item quantity="other">@string/voice_total_distance_kilometers_other</item>
|
||||
</plurals>
|
||||
<plurals name="voiceTotalDistanceMiles">
|
||||
<item quantity="zero">@string/voice_total_distance_miles_zero</item>
|
||||
<item quantity="one">@string/voice_total_distance_miles_one</item>
|
||||
<item quantity="two">@string/voice_total_distance_miles_two</item>
|
||||
<item quantity="few">@string/voice_total_distance_miles_few</item>
|
||||
<item quantity="many">@string/voice_total_distance_miles_many</item>
|
||||
<item quantity="other">@string/voice_total_distance_miles_other</item>
|
||||
</plurals>
|
||||
</resources>
|
||||
+1851
-593
File diff suppressed because it is too large
Load Diff
@@ -15,24 +15,69 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<resources>
|
||||
<!-- The style for the unit on the statistics activity. -->
|
||||
<style name="StatsUnit" parent="@android:Widget.TextView">
|
||||
<item name="android:gravity">bottom</item>
|
||||
|
||||
<!-- About dialog TableRow -->
|
||||
<style name="AboutTableRow">
|
||||
<item name="android:paddingBottom">2dp</item>
|
||||
</style>
|
||||
|
||||
<!-- About dialog TextView -->
|
||||
<style name="AboutTextView">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_marginBottom">-2dip</item>
|
||||
<item name="android:layout_marginTop">-2dip</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:textColor">@color/stat_label_text</item>
|
||||
<item name="android:textSize">20sp</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for the unit on the statistics activity where there is only one string. -->
|
||||
<style name="StatsUnitSolo" parent="@android:Widget.TextView">
|
||||
<!-- About dialog TextView column 0 -->
|
||||
<style name="AboutTextView.Column0">
|
||||
<item name="android:gravity">right</item>
|
||||
<item name="android:layout_marginBottom">-9dip</item>
|
||||
<item name="android:layout_marginTop">-9dip</item>
|
||||
<item name="android:textColor">@color/stat_label_text</item>
|
||||
<item name="android:layout_column">0</item>
|
||||
<item name="android:paddingLeft">10dp</item>
|
||||
<item name="android:paddingRight">10dp</item>
|
||||
</style>
|
||||
|
||||
|
||||
<!-- About dialog TextView Url -->
|
||||
<style name="AboutTextView.Url">
|
||||
<item name="android:autoLink">web</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
</style>
|
||||
|
||||
<!-- Button -->
|
||||
<style name="Button">
|
||||
<item name="android:layout_height">48dip</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:layout_width">0dip</item>
|
||||
<item name="android:maxLines">2</item>
|
||||
<item name="android:textSize">14dip</item>
|
||||
</style>
|
||||
|
||||
<!-- Button layout -->
|
||||
<style name="ButtonLayout">
|
||||
<item name="android:background">@drawable/list_bar</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
<item name="android:paddingLeft">2dip</item>
|
||||
<item name="android:paddingRight">2dip</item>
|
||||
<item name="android:paddingTop">4dip</item>
|
||||
</style>
|
||||
|
||||
<!-- Button spacer -->
|
||||
<style name="ButtonSpacer">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">0.25</item>
|
||||
<item name="android:layout_width">0dip</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
<item name="android:visibility">gone</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for a view which divides the numerator and denominator of the units on the statistics activity. -->
|
||||
<style name="StatsDivider" parent="@android:Widget.TextView">
|
||||
<item name="android:background">@color/black</item>
|
||||
<item name="android:layout_height">3dip</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for a text view for displaying a value on the statistics activity. -->
|
||||
<style name="StatsRegister" parent="@android:Widget.TextView">
|
||||
<item name="android:gravity">right</item>
|
||||
@@ -67,51 +112,51 @@ limitations under the License.
|
||||
<item name="android:layout_width">5dip</item>
|
||||
<item name="android:textSize">40sp</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for a view which divides the numerator and denominator of the units on the statistics activity. -->
|
||||
<style name="StatsDivider" parent="@android:Widget.TextView">
|
||||
<item name="android:background">@color/black</item>
|
||||
<item name="android:layout_height">3dip</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for the track widget. -->
|
||||
<style name="WidgetText" parent="@android:Widget.TextView">
|
||||
<!-- The style for the unit on the statistics activity. -->
|
||||
<style name="StatsUnit" parent="@android:Widget.TextView">
|
||||
<item name="android:gravity">bottom</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_marginBottom">-2dip</item>
|
||||
<item name="android:layout_marginTop">-2dip</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:textColor">@color/stat_label_text</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for the unit on the statistics activity where there is only one string. -->
|
||||
<style name="StatsUnitSolo" parent="@android:Widget.TextView">
|
||||
<item name="android:gravity">right</item>
|
||||
<item name="android:layout_marginBottom">-9dip</item>
|
||||
<item name="android:layout_marginTop">-9dip</item>
|
||||
<item name="android:textColor">@color/stat_label_text</item>
|
||||
</style>
|
||||
|
||||
<!-- Welcome page TextView -->
|
||||
<style name="WelcomeTextView">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:paddingLeft">10sp</item>
|
||||
<item name="android:paddingRight">10sp</item>
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
</style>
|
||||
|
||||
<!-- Welcome page TextView question -->
|
||||
<style name="WelcomeTextView.Question">
|
||||
<item name="android:paddingTop">10sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
<!-- Widget TextView -->
|
||||
<style name="WidgetTextView">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:textColor">@color/appwidget_text</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
</style>
|
||||
<style name="WidgetText.Register">
|
||||
|
||||
<!-- Widget TextView value -->
|
||||
<style name="WidgetTextView.Value">
|
||||
<item name="android:width">160px</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for the layout of the bottom buttons. -->
|
||||
<style name="ButtonLayout">
|
||||
<item name="android:background">@drawable/list_bar</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
<item name="android:paddingLeft">2dip</item>
|
||||
<item name="android:paddingRight">2dip</item>
|
||||
<item name="android:paddingTop">4dip</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for the bottom button. -->
|
||||
<style name="Button">
|
||||
<item name="android:layout_height">48dip</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:layout_width">0dip</item>
|
||||
<item name="android:maxLines">2</item>
|
||||
<item name="android:textSize">14dip</item>
|
||||
</style>
|
||||
|
||||
<!-- The style for the spacer on the left and right of the bottom buttons. -->
|
||||
<style name="ButtonSpacer">
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:layout_weight">0.25</item>
|
||||
<item name="android:layout_width">0dip</item>
|
||||
<item name="android:orientation">horizontal</item>
|
||||
<item name="android:visibility">gone</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -6,6 +6,7 @@ import com.google.android.apps.mytracks.stats.TripStatistics;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
import android.os.Bundle;
|
||||
@@ -67,7 +68,7 @@ public class AggregatedStatsActivity extends Activity implements
|
||||
sv.setScrollBarStyle(ScrollView.SCROLLBARS_OUTSIDE_INSET);
|
||||
|
||||
SharedPreferences preferences = getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (preferences != null) {
|
||||
metricUnits = preferences.getBoolean(getString(R.string.metric_units_key), true);
|
||||
preferences.registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
@@ -23,7 +23,7 @@ import android.graphics.Paint;
|
||||
import android.graphics.Paint.Style;
|
||||
import android.graphics.Path;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
|
||||
/**
|
||||
* This class encapsulates meta data about one series of values for a chart.
|
||||
@@ -33,7 +33,7 @@ import java.text.DecimalFormat;
|
||||
public class ChartValueSeries {
|
||||
|
||||
private final ExtremityMonitor monitor = new ExtremityMonitor();
|
||||
private final DecimalFormat format;
|
||||
private final NumberFormat format;
|
||||
private final Path path = new Path();
|
||||
private final Paint fillPaint;
|
||||
private final Paint strokePaint;
|
||||
@@ -132,7 +132,6 @@ public class ChartValueSeries {
|
||||
* Constructs a new chart value series.
|
||||
*
|
||||
* @param context The context for the chart
|
||||
* @param formatString The format of the decimal format for this series
|
||||
* @param fillColor The paint for filling the chart
|
||||
* @param strokeColor The paint for stroking the outside the chart, optional
|
||||
* @param zoomSettings The settings related to zooming
|
||||
@@ -140,9 +139,9 @@ public class ChartValueSeries {
|
||||
*
|
||||
* TODO: Get rid of Context and inject appropriate values instead.
|
||||
*/
|
||||
public ChartValueSeries(Context context, String formatString, int fillColor, int strokeColor,
|
||||
ZoomSettings zoomSettings, int titleId) {
|
||||
this.format = new DecimalFormat(formatString);
|
||||
public ChartValueSeries(
|
||||
Context context, int fillColor, int strokeColor, ZoomSettings zoomSettings, int titleId) {
|
||||
this.format = NumberFormat.getIntegerInstance();
|
||||
fillPaint = new Paint();
|
||||
fillPaint.setStyle(Style.FILL);
|
||||
fillPaint.setColor(context.getResources().getColor(fillColor));
|
||||
@@ -251,9 +250,9 @@ public class ChartValueSeries {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The format for the decimal format for this series
|
||||
* @return The number format for this series
|
||||
*/
|
||||
DecimalFormat getFormat() {
|
||||
NumberFormat getFormat() {
|
||||
return format;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.widget.Scroller;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -120,8 +119,13 @@ public class ChartView extends View {
|
||||
private ChartValueSeries[] series;
|
||||
|
||||
private final ExtremityMonitor xMonitor = new ExtremityMonitor();
|
||||
private static final NumberFormat X_FORMAT = new DecimalFormat("###,###");
|
||||
private static final NumberFormat X_SHORT_FORMAT = new DecimalFormat("#.0");
|
||||
private static final NumberFormat X_FORMAT = NumberFormat.getIntegerInstance();
|
||||
private static final NumberFormat X_SHORT_FORMAT = NumberFormat.getNumberInstance();
|
||||
|
||||
static {
|
||||
X_SHORT_FORMAT.setMaximumFractionDigits(1);
|
||||
X_SHORT_FORMAT.setMinimumFractionDigits(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Paints etc. used when drawing the chart:
|
||||
@@ -205,7 +209,6 @@ public class ChartView extends View {
|
||||
// Create the value series.
|
||||
series[ELEVATION_SERIES] =
|
||||
new ChartValueSeries(context,
|
||||
"###,###",
|
||||
R.color.elevation_fill,
|
||||
R.color.elevation_border,
|
||||
new ZoomSettings(MAX_INTERVALS,
|
||||
@@ -214,7 +217,6 @@ public class ChartView extends View {
|
||||
|
||||
series[SPEED_SERIES] =
|
||||
new ChartValueSeries(context,
|
||||
"###,###",
|
||||
R.color.speed_fill,
|
||||
R.color.speed_border,
|
||||
new ZoomSettings(MAX_INTERVALS, 0, Integer.MIN_VALUE,
|
||||
@@ -222,14 +224,12 @@ public class ChartView extends View {
|
||||
R.string.stat_speed);
|
||||
series[POWER_SERIES] =
|
||||
new ChartValueSeries(context,
|
||||
"###,###",
|
||||
R.color.power_fill,
|
||||
R.color.power_border,
|
||||
new ZoomSettings(MAX_INTERVALS, 0, 1000, new int[] {5, 50, 100, 200}),
|
||||
R.string.sensor_state_power);
|
||||
series[CADENCE_SERIES] =
|
||||
new ChartValueSeries(context,
|
||||
"###,###",
|
||||
R.color.cadence_fill,
|
||||
R.color.cadence_border,
|
||||
new ZoomSettings(MAX_INTERVALS, 0, Integer.MIN_VALUE,
|
||||
@@ -237,7 +237,6 @@ public class ChartView extends View {
|
||||
R.string.sensor_state_cadence);
|
||||
series[HEART_RATE_SERIES] =
|
||||
new ChartValueSeries(context,
|
||||
"###,###",
|
||||
R.color.heartrate_fill,
|
||||
R.color.heartrate_border,
|
||||
new ZoomSettings(MAX_INTERVALS, 0, Integer.MIN_VALUE,
|
||||
|
||||
@@ -19,7 +19,6 @@ package com.google.android.apps.mytracks;
|
||||
import com.google.android.apps.mytracks.util.ApiFeatures;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
@@ -37,7 +36,7 @@ class CheckUnits {
|
||||
|
||||
public static void check(final Context context) {
|
||||
final SharedPreferences checkUnitsSharedPreferences = context.getSharedPreferences(
|
||||
CHECK_UNITS_PREFERENCE_FILE, Activity.MODE_PRIVATE);
|
||||
CHECK_UNITS_PREFERENCE_FILE, Context.MODE_PRIVATE);
|
||||
if (checkUnitsSharedPreferences.getBoolean(CHECK_UNITS_PREFERENCE_KEY, false)) {
|
||||
return;
|
||||
}
|
||||
@@ -61,7 +60,7 @@ class CheckUnits {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
recordCheckPerformed(checkUnitsSharedPreferences);
|
||||
SharedPreferences useMetricPreferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Activity.MODE_PRIVATE);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = useMetricPreferences.edit();
|
||||
String key = context.getString(R.string.metric_units_key);
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
@@ -60,9 +61,9 @@ public class DeleteAllTracks extends Handler {
|
||||
dialogInterface.dismiss();
|
||||
Log.w(Constants.TAG, "deleting all!");
|
||||
MyTracksProviderUtils.Factory.get(context).deleteAllTracks();
|
||||
SharedPreferences prefs =
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
Editor editor = prefs.edit();
|
||||
// TODO: Go through data manager
|
||||
editor.putLong(context.getString(R.string.selected_track_key), -1);
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor);
|
||||
|
||||
@@ -27,6 +27,7 @@ import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.ContentUris;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnCancelListener;
|
||||
import android.content.Intent;
|
||||
@@ -105,7 +106,8 @@ public class DeleteTrack extends Activity
|
||||
|
||||
// If the track we just deleted was selected, unselect it.
|
||||
String selectedKey = getString(R.string.selected_track_key);
|
||||
SharedPreferences preferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences preferences = getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (preferences.getLong(selectedKey, -1) == deleteTrackId) {
|
||||
Editor editor = preferences.edit().putLong(selectedKey, -1);
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor);
|
||||
|
||||
@@ -1,107 +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;
|
||||
|
||||
import com.google.android.apps.mytracks.util.ApiFeatures;
|
||||
import com.google.android.apps.mytracks.util.ResourceUtils;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
/**
|
||||
* This class handles display of EULAs ("End User License Agreements") to the
|
||||
* user.
|
||||
*/
|
||||
class Eula {
|
||||
private static final String PREFERENCE_EULA_ACCEPTED = "eula.accepted";
|
||||
private static final String PREFERENCES_EULA = "eula";
|
||||
|
||||
private Eula() {}
|
||||
|
||||
/**
|
||||
* Displays the EULA if necessary. This method should be called from the
|
||||
* onCreate() method of your main Activity. If the user accepts, the EULA
|
||||
* will never be displayed again. If the user refuses, the activity will
|
||||
* finish (exit).
|
||||
*
|
||||
* @param activity The Activity to finish if the user rejects the EULA
|
||||
*/
|
||||
static void showEulaRequireAcceptance(final Activity activity) {
|
||||
final SharedPreferences preferences =
|
||||
activity.getSharedPreferences(PREFERENCES_EULA, Activity.MODE_PRIVATE);
|
||||
if (preferences.getBoolean(PREFERENCE_EULA_ACCEPTED, false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final AlertDialog.Builder builder = initDialog(activity);
|
||||
builder.setPositiveButton(R.string.eula_accept,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
accept(activity, preferences);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.eula_decline,
|
||||
new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
refuse(activity);
|
||||
}
|
||||
});
|
||||
builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
refuse(activity);
|
||||
}
|
||||
});
|
||||
builder.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the EULA to the user in an informational context. They won't be
|
||||
* given the choice of accepting or declining the EULA -- we're simply
|
||||
* displaying it for them to read.
|
||||
*/
|
||||
static void showEula(Context context) {
|
||||
AlertDialog.Builder builder = initDialog(context);
|
||||
builder.setPositiveButton(R.string.generic_ok, null);
|
||||
builder.show();
|
||||
}
|
||||
|
||||
private static AlertDialog.Builder initDialog(Context context) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setCancelable(true);
|
||||
builder.setTitle(R.string.eula_title);
|
||||
builder.setMessage(ResourceUtils.readFile(context, R.raw.eula));
|
||||
return builder;
|
||||
}
|
||||
|
||||
private static void accept(Activity activity, SharedPreferences preferences) {
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(
|
||||
preferences.edit().putBoolean(PREFERENCE_EULA_ACCEPTED, true));
|
||||
Intent startIntent = new Intent(activity, WelcomeActivity.class);
|
||||
activity.startActivityForResult(startIntent, Constants.WELCOME);
|
||||
}
|
||||
|
||||
private static void refuse(Activity activity) {
|
||||
activity.finish();
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import com.google.android.maps.mytracks.R;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
@@ -87,6 +88,7 @@ public class ExportAllTracks {
|
||||
}
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setTitle(R.string.track_list_export_all);
|
||||
builder.setSingleChoiceItems(choices, 0, itemClick);
|
||||
builder.setPositiveButton(R.string.generic_ok, positiveClick);
|
||||
builder.setNegativeButton(R.string.generic_cancel, null);
|
||||
@@ -113,8 +115,8 @@ public class ExportAllTracks {
|
||||
* current track.
|
||||
*/
|
||||
private void aquireLocksAndExport() {
|
||||
SharedPreferences prefs =
|
||||
activity.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = activity.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
long recordingTrackId = -1;
|
||||
if (prefs != null) {
|
||||
recordingTrackId =
|
||||
|
||||
@@ -26,6 +26,7 @@ import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ContentUris;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -95,7 +96,8 @@ public class ImportAllTracks {
|
||||
* track. Acquire a wake lock if there is no current track.
|
||||
*/
|
||||
private void aquireLocksAndImport() {
|
||||
SharedPreferences prefs = activity.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = activity.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
long recordingTrackId = -1;
|
||||
if (prefs != null) {
|
||||
recordingTrackId = prefs.getLong(activity.getString(R.string.recording_track_key), -1);
|
||||
@@ -128,8 +130,10 @@ public class ImportAllTracks {
|
||||
if (gpxFileCount == 0) {
|
||||
builder.setMessage(activity.getString(R.string.import_no_file, gpxPath));
|
||||
} else {
|
||||
String totalFiles = activity.getResources().getQuantityString(
|
||||
R.plurals.importGpxFiles, gpxFileCount, gpxFileCount);
|
||||
builder.setMessage(
|
||||
activity.getString(R.string.import_success, importSuccessCount, gpxFileCount, gpxPath));
|
||||
activity.getString(R.string.import_success, importSuccessCount, totalFiles, gpxPath));
|
||||
}
|
||||
builder.setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
|
||||
@@ -163,8 +163,8 @@ public class MapOverlay extends Overlay implements OnSharedPreferenceChangeListe
|
||||
|
||||
trackPathPainter = TrackPathPainterFactory.getTrackPathPainter(context);
|
||||
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, 0)
|
||||
.registerOnSharedPreferenceChangeListener(this);
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE)
|
||||
.registerOnSharedPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,13 +28,18 @@ import com.google.android.apps.mytracks.services.ServiceUtils;
|
||||
import com.google.android.apps.mytracks.services.TrackRecordingServiceConnection;
|
||||
import com.google.android.apps.mytracks.services.tasks.StatusAnnouncerFactory;
|
||||
import com.google.android.apps.mytracks.util.ApiFeatures;
|
||||
import com.google.android.apps.mytracks.util.EulaUtil;
|
||||
import com.google.android.apps.mytracks.util.SystemUtils;
|
||||
import com.google.android.apps.mytracks.util.UriUtils;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.TabActivity;
|
||||
import android.content.ContentUris;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources;
|
||||
@@ -61,6 +66,8 @@ import android.widget.Toast;
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class MyTracks extends TabActivity implements OnTouchListener {
|
||||
private static final int DIALOG_EULA_ID = 0;
|
||||
|
||||
private TrackDataHub dataHub;
|
||||
|
||||
/**
|
||||
@@ -145,7 +152,7 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
||||
tracker.dispatch();
|
||||
|
||||
providerUtils = MyTracksProviderUtils.Factory.get(this);
|
||||
preferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
preferences = getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
dataHub = ((MyTracksApplication) getApplication()).getTrackDataHub();
|
||||
menuManager = new MenuManager(this);
|
||||
serviceConnection = new TrackRecordingServiceConnection(this, serviceBindCallback);
|
||||
@@ -191,10 +198,11 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
||||
tabHost.addView(layout);
|
||||
layout.setOnTouchListener(this);
|
||||
|
||||
// This will show the eula until the user accepts or quits the app.
|
||||
Eula.showEulaRequireAcceptance(this);
|
||||
if (!EulaUtil.getEulaValue(this)) {
|
||||
showDialog(DIALOG_EULA_ID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
Log.d(TAG, "MyTracks.onStart");
|
||||
@@ -255,6 +263,40 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Dialog onCreateDialog(int id) {
|
||||
switch (id) {
|
||||
case DIALOG_EULA_ID:
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.eula_title);
|
||||
builder.setMessage(R.string.eula_message);
|
||||
builder.setPositiveButton(R.string.eula_accept, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
EulaUtil.setEulaValue(MyTracks.this);
|
||||
Intent startIntent = new Intent(MyTracks.this, WelcomeActivity.class);
|
||||
startActivityForResult(startIntent, Constants.WELCOME);
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.eula_decline, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
builder.setCancelable(true);
|
||||
builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
return builder.create();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
super.onCreateOptionsMenu(menu);
|
||||
@@ -419,7 +461,8 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
||||
*/
|
||||
void stopRecording() {
|
||||
// Save the track id as the shared preference will overwrite the recording track id.
|
||||
SharedPreferences sharedPreferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences sharedPreferences = getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
long currentTrackId = sharedPreferences.getLong(getString(R.string.recording_track_key), -1);
|
||||
|
||||
ITrackRecordingService trackRecordingService = serviceConnection.getServiceIfBound();
|
||||
|
||||
@@ -32,7 +32,7 @@ import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
@@ -44,8 +44,7 @@ import java.util.TimerTask;
|
||||
*/
|
||||
public class SensorStateActivity extends Activity {
|
||||
|
||||
private static final SimpleDateFormat TIMESTAMP_FORMAT =
|
||||
new SimpleDateFormat("HH:mm:ss");
|
||||
private static final DateFormat TIMESTAMP_FORMAT = DateFormat.getTimeInstance(DateFormat.SHORT);
|
||||
private static final long REFRESH_PERIOD_MS = 250;
|
||||
|
||||
private final StatsUtilities utils;
|
||||
|
||||
@@ -31,6 +31,7 @@ import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
import android.os.Bundle;
|
||||
import android.preference.CheckBoxPreference;
|
||||
import android.preference.EditTextPreference;
|
||||
@@ -682,7 +683,9 @@ public class SettingsActivity extends PreferenceActivity {
|
||||
metricspeed = newValue;
|
||||
}
|
||||
SharedPreferences prefs = getPreferenceManager().getSharedPreferences();
|
||||
prefs.edit().putString(getString(id), metricspeed).commit();
|
||||
Editor editor = prefs.edit();
|
||||
editor.putString(getString(id), metricspeed);
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.google.android.apps.mytracks.util.ApiFeatures;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.location.Location;
|
||||
import android.os.Bundle;
|
||||
@@ -100,7 +101,7 @@ public class StatsActivity extends Activity implements TrackDataListener {
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
preferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
preferences = getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
utils = new StatsUtilities(this);
|
||||
|
||||
// The volume we want to control is the Text-To-Speech volume
|
||||
|
||||
@@ -24,7 +24,6 @@ import android.app.Activity;
|
||||
import android.util.Log;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
|
||||
/**
|
||||
@@ -35,15 +34,20 @@ import java.text.NumberFormat;
|
||||
public class StatsUtilities {
|
||||
|
||||
private final Activity activity;
|
||||
private static final NumberFormat LAT_LONG_FORMAT =
|
||||
new DecimalFormat("##,###.00000");
|
||||
private static final NumberFormat ALTITUDE_FORMAT =
|
||||
new DecimalFormat("###,###");
|
||||
private static final NumberFormat SPEED_FORMAT =
|
||||
new DecimalFormat("#,###,###.00");
|
||||
private static final NumberFormat GRADE_FORMAT =
|
||||
new DecimalFormat("##.0%");
|
||||
private static final NumberFormat LAT_LONG_FORMAT = NumberFormat.getNumberInstance();
|
||||
private static final NumberFormat ALTITUDE_FORMAT = NumberFormat.getIntegerInstance();
|
||||
private static final NumberFormat SPEED_FORMAT = NumberFormat.getNumberInstance();
|
||||
private static final NumberFormat GRADE_FORMAT = NumberFormat.getPercentInstance();
|
||||
|
||||
static {
|
||||
LAT_LONG_FORMAT.setMaximumFractionDigits(5);
|
||||
LAT_LONG_FORMAT.setMinimumFractionDigits(5);
|
||||
SPEED_FORMAT.setMaximumFractionDigits(2);
|
||||
SPEED_FORMAT.setMinimumFractionDigits(2);
|
||||
GRADE_FORMAT.setMaximumFractionDigits(1);
|
||||
GRADE_FORMAT.setMinimumFractionDigits(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* True if distances should be displayed in metric units (from shared
|
||||
* preferences).
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.ListActivity;
|
||||
import android.content.ContentUris;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
@@ -235,7 +236,7 @@ public class TrackList extends ListActivity
|
||||
listView = getListView();
|
||||
listView.setOnCreateContextMenuListener(contextMenuListener);
|
||||
|
||||
preferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
preferences = getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
serviceConnection = new TrackRecordingServiceConnection(this, serviceBindingChanged);
|
||||
|
||||
View deleteAll = findViewById(R.id.tracklist_btn_delete_all);
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
@@ -65,8 +66,8 @@ public class WaypointDetails extends Activity
|
||||
setContentView(R.layout.mytracks_waypoint_details);
|
||||
|
||||
utils = new StatsUtilities(this);
|
||||
SharedPreferences preferences =
|
||||
getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences preferences = getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (preferences != null) {
|
||||
boolean useMetric =
|
||||
preferences.getBoolean(getString(R.string.metric_units_key), true);
|
||||
|
||||
@@ -28,6 +28,7 @@ import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ListActivity;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -151,8 +152,8 @@ public class WaypointsList extends ListActivity
|
||||
insertStatisticsButton =
|
||||
(Button) findViewById(R.id.waypointslist_btn_insert_statistics);
|
||||
insertStatisticsButton.setOnClickListener(this);
|
||||
SharedPreferences preferences =
|
||||
getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences preferences = getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
|
||||
// TODO: Get rid of selected and recording track IDs
|
||||
long selectedTrackId = -1;
|
||||
|
||||
@@ -20,13 +20,12 @@ import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.Window;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
@@ -36,52 +35,54 @@ import android.widget.TextView;
|
||||
*/
|
||||
public class WelcomeActivity extends Activity {
|
||||
|
||||
private static final int DIALOG_ABOUT_ID = 0;
|
||||
private static final int DIALOG_EULA_ID = 1;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
requestWindowFeature(Window.FEATURE_PROGRESS);
|
||||
|
||||
setContentView(R.layout.welcome);
|
||||
|
||||
WebView web = (WebView) findViewById(R.id.welcome_web);
|
||||
web.loadUrl("file:///android_asset/welcome.html");
|
||||
|
||||
findViewById(R.id.welcome_ok).setOnClickListener(
|
||||
new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
findViewById(R.id.welcome_ok).setOnClickListener(new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
findViewById(R.id.welcome_about).setOnClickListener(new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
about();
|
||||
showDialog(DIALOG_ABOUT_ID);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the "about" dialog.
|
||||
*
|
||||
* TODO: Add a menu option for showing the same thing.
|
||||
*/
|
||||
public void about() {
|
||||
LayoutInflater li = LayoutInflater.from(this);
|
||||
View view = li.inflate(R.layout.about, null);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setView(view);
|
||||
builder.setPositiveButton(R.string.generic_ok, null);
|
||||
builder.setNegativeButton(R.string.about_license, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
Eula.showEula(WelcomeActivity.this);
|
||||
}
|
||||
});
|
||||
builder.setIcon(R.drawable.arrow_icon);
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
((TextView) dialog.findViewById(R.id.about_version_register)).
|
||||
setText(SystemUtils.getMyTracksVersion(this));
|
||||
@Override
|
||||
protected Dialog onCreateDialog(int id) {
|
||||
AlertDialog.Builder builder;
|
||||
switch (id) {
|
||||
case DIALOG_ABOUT_ID:
|
||||
LayoutInflater layoutInflator = LayoutInflater.from(this);
|
||||
View view = layoutInflator.inflate(R.layout.about, null);
|
||||
TextView aboutVersionTextView = (TextView) view.findViewById(R.id.about_version);
|
||||
aboutVersionTextView.setText(SystemUtils.getMyTracksVersion(this));
|
||||
|
||||
builder = new AlertDialog.Builder(this);
|
||||
builder.setView(view);
|
||||
builder.setPositiveButton(R.string.generic_ok, null);
|
||||
builder.setNegativeButton(R.string.about_license, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
showDialog(DIALOG_EULA_ID);
|
||||
}
|
||||
});
|
||||
return builder.create();
|
||||
case DIALOG_EULA_ID:
|
||||
builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.eula_title);
|
||||
builder.setMessage(R.string.eula_message);
|
||||
builder.setPositiveButton(R.string.generic_ok, null);
|
||||
builder.setCancelable(true);
|
||||
return builder.create();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ public class MyTracksProvider extends ContentProvider {
|
||||
} else {
|
||||
Context context = getContext();
|
||||
SharedPreferences sharedPreferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
return sharedPreferences.getBoolean(context.getString(R.string.allow_access_key), false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +201,8 @@ public class TrackDataHub {
|
||||
* Builds a new {@link TrackDataHub} instance.
|
||||
*/
|
||||
public synchronized static TrackDataHub newInstance(Context context) {
|
||||
SharedPreferences preferences = context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences preferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
MyTracksProviderUtils providerUtils = MyTracksProviderUtils.Factory.get(context);
|
||||
return new TrackDataHub(context,
|
||||
new TrackDataListeners(),
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.google.android.apps.mytracks.content.Track;
|
||||
import com.google.android.apps.mytracks.io.docs.DocsHelper;
|
||||
import com.google.android.apps.mytracks.io.gdata.GDataClientFactory;
|
||||
import com.google.android.apps.mytracks.io.gdata.GDataWrapper;
|
||||
import com.google.android.apps.mytracks.io.sendtogoogle.SendType;
|
||||
import com.google.android.common.gdata.AndroidXmlParserFactory;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
import com.google.wireless.gdata.client.GDataClient;
|
||||
@@ -32,6 +31,7 @@ import com.google.wireless.gdata.docs.SpreadsheetsClient;
|
||||
import com.google.wireless.gdata.docs.XmlDocsGDataParserFactory;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -55,10 +55,7 @@ public class SendToDocs {
|
||||
private final ProgressIndicator progressIndicator;
|
||||
private final boolean metricUnits;
|
||||
|
||||
private boolean createdNewSpreadSheet = false;
|
||||
|
||||
private boolean success = true;
|
||||
private String statusMessage = "";
|
||||
private Runnable onCompletion = null;
|
||||
|
||||
|
||||
@@ -70,7 +67,7 @@ public class SendToDocs {
|
||||
this.progressIndicator = progressIndicator;
|
||||
|
||||
SharedPreferences preferences = activity.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (preferences != null) {
|
||||
metricUnits =
|
||||
preferences.getBoolean(activity.getString(R.string.metric_units_key),
|
||||
@@ -92,12 +89,7 @@ public class SendToDocs {
|
||||
}
|
||||
|
||||
private void doUpload(long trackId) {
|
||||
// TODO
|
||||
String errorFormat = activity.getString(R.string.send_google_error_service);
|
||||
String serviceName = activity.getString(SendType.DOCS.getServiceName());
|
||||
statusMessage = String.format(errorFormat, serviceName);
|
||||
success = false;
|
||||
|
||||
try {
|
||||
if (trackId == -1) {
|
||||
Log.w(Constants.TAG, "Cannot get track id.");
|
||||
@@ -117,13 +109,6 @@ public class SendToDocs {
|
||||
|
||||
Log.d(Constants.TAG, "SendToDocs: Uploading to spreadsheet");
|
||||
success = uploadToDocs(track);
|
||||
if (success) {
|
||||
String successFormat = createdNewSpreadSheet
|
||||
? activity.getString(R.string.send_google_success_new)
|
||||
: activity.getString(R.string.send_google_success_existing);
|
||||
String url = activity.getString(SendType.DOCS.getServiceUrl());
|
||||
statusMessage = String.format(successFormat, serviceName, url);
|
||||
}
|
||||
Log.d(Constants.TAG, "SendToDocs: Done.");
|
||||
} finally {
|
||||
if (onCompletion != null) {
|
||||
@@ -136,10 +121,6 @@ public class SendToDocs {
|
||||
return success;
|
||||
}
|
||||
|
||||
public String getStatusMessage() {
|
||||
return statusMessage;
|
||||
}
|
||||
|
||||
public void setOnCompletion(Runnable onCompletion) {
|
||||
this.onCompletion = onCompletion;
|
||||
}
|
||||
@@ -222,7 +203,6 @@ public class SendToDocs {
|
||||
return false;
|
||||
}
|
||||
progressIndicator.setProgressValue(80);
|
||||
createdNewSpreadSheet = true;
|
||||
|
||||
if (spreadsheetId == null) {
|
||||
progressIndicator.setProgressValue(85);
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.google.api.client.http.InputStreamContent;
|
||||
import com.google.api.client.util.Strings;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.location.Location;
|
||||
@@ -72,7 +73,7 @@ public class SendToFusionTables implements Runnable {
|
||||
* Listener invoked when sending to fusion tables completes.
|
||||
*/
|
||||
public interface OnSendCompletedListener {
|
||||
void onSendCompleted(String tableId, boolean success, String statusMessage);
|
||||
void onSendCompleted(String tableId, boolean success);
|
||||
}
|
||||
|
||||
/** The GData service id for Fusion Tables. */
|
||||
@@ -169,9 +170,6 @@ public class SendToFusionTables implements Runnable {
|
||||
}
|
||||
|
||||
private void doUpload() {
|
||||
String errorFormat = context.getString(R.string.send_google_error_service);
|
||||
String serviceName = context.getString(SendType.FUSION_TABLES.getServiceName());
|
||||
String statusMessage = String.format(errorFormat, serviceName);
|
||||
boolean success = true;
|
||||
try {
|
||||
progressIndicator.setProgressValue(PROGRESS_INITIALIZATION);
|
||||
@@ -190,6 +188,7 @@ public class SendToFusionTables implements Runnable {
|
||||
// Create a new table:
|
||||
progressIndicator.setProgressValue(PROGRESS_FUSION_TABLE_CREATE);
|
||||
String creatingFormat = context.getString(R.string.send_google_progress_creating);
|
||||
String serviceName = context.getString(SendType.FUSION_TABLES.getServiceName());
|
||||
progressIndicator.setProgressMessage(String.format(creatingFormat, serviceName));
|
||||
if (!createNewTable(track) || !makeTableUnlisted()) {
|
||||
return;
|
||||
@@ -211,18 +210,14 @@ public class SendToFusionTables implements Runnable {
|
||||
return;
|
||||
}
|
||||
|
||||
String successFormat = context.getString(R.string.send_google_success_new);
|
||||
String url = context.getString(SendType.FUSION_TABLES.getServiceUrl());
|
||||
statusMessage = String.format(successFormat, serviceName, url);
|
||||
Log.d(Constants.TAG, "SendToFusionTables: Done: " + success);
|
||||
progressIndicator.setProgressValue(PROGRESS_COMPLETE);
|
||||
} finally {
|
||||
final boolean finalSuccess = success;
|
||||
final String finalStatusMessage = statusMessage;
|
||||
context.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
if (onCompletion != null) {
|
||||
onCompletion.onSendCompleted(tableId, finalSuccess, finalStatusMessage);
|
||||
onCompletion.onSendCompleted(tableId, finalSuccess);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -303,7 +298,8 @@ public class SendToFusionTables implements Runnable {
|
||||
}
|
||||
|
||||
private boolean uploadAllTrackPoints(final Track track, String originalDescription) {
|
||||
SharedPreferences preferences = context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences preferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
boolean metricUnits = true;
|
||||
if (preferences != null) {
|
||||
metricUnits = preferences.getBoolean(context.getString(R.string.metric_units_key), true);
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.google.android.apps.mytracks.util.UnitConversions;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.location.Location;
|
||||
@@ -76,7 +77,7 @@ public class SendToMyMaps implements Runnable {
|
||||
private int totalSegmentsUploaded;
|
||||
|
||||
public interface OnSendCompletedListener {
|
||||
void onSendCompleted(String mapId, boolean success, String statusMessage);
|
||||
void onSendCompleted(String mapId, boolean success);
|
||||
}
|
||||
|
||||
public SendToMyMaps(Activity context, String mapId, AuthManager auth,
|
||||
@@ -99,9 +100,6 @@ public class SendToMyMaps implements Runnable {
|
||||
}
|
||||
|
||||
private void doUpload() {
|
||||
String errorFormat = context.getString(R.string.send_google_error_service);
|
||||
String serviceName = context.getString(SendType.MYMAPS.getServiceName());
|
||||
String statusMessage = String.format(errorFormat, serviceName);
|
||||
boolean success = true;
|
||||
try {
|
||||
progressIndicator.setProgressMessage(
|
||||
@@ -124,7 +122,7 @@ public class SendToMyMaps implements Runnable {
|
||||
boolean isNewMap = mapId.equals(NEW_MAP_ID);
|
||||
if (isNewMap) {
|
||||
SharedPreferences preferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
boolean mapPublic = true;
|
||||
if (preferences != null) {
|
||||
mapPublic = preferences.getBoolean(
|
||||
@@ -132,6 +130,7 @@ public class SendToMyMaps implements Runnable {
|
||||
}
|
||||
|
||||
String creatingFormat = context.getString(R.string.send_google_progress_creating);
|
||||
String serviceName = context.getString(SendType.MYMAPS.getServiceName());
|
||||
progressIndicator.setProgressMessage(String.format(creatingFormat, serviceName));
|
||||
|
||||
StringBuilder mapIdBuilder = new StringBuilder();
|
||||
@@ -175,12 +174,6 @@ public class SendToMyMaps implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
if (success) {
|
||||
String successFormat = isNewMap ? context.getString(R.string.send_google_success_new)
|
||||
: context.getString(R.string.send_google_success_existing);
|
||||
String url = context.getString(SendType.MYMAPS.getServiceUrl());
|
||||
statusMessage = String.format(successFormat, serviceName, url);
|
||||
}
|
||||
Log.d(TAG, "SendToMyMaps: Done: " + success);
|
||||
progressIndicator.setProgressValue(100);
|
||||
} finally {
|
||||
@@ -189,11 +182,10 @@ public class SendToMyMaps implements Runnable {
|
||||
}
|
||||
|
||||
final boolean finalSuccess = success;
|
||||
final String finalStatusMessage = statusMessage;
|
||||
context.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
if (onCompletion != null) {
|
||||
onCompletion.onSendCompleted(mapId, finalSuccess, finalStatusMessage);
|
||||
onCompletion.onSendCompleted(mapId, finalSuccess);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -203,7 +195,7 @@ public class SendToMyMaps implements Runnable {
|
||||
private boolean uploadAllTrackPoints(
|
||||
final Track track, String originalDescription) {
|
||||
SharedPreferences preferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
boolean metricUnits = true;
|
||||
if (preferences != null) {
|
||||
metricUnits =
|
||||
|
||||
@@ -32,7 +32,7 @@ import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
@@ -47,8 +47,8 @@ import java.util.Date;
|
||||
public class BackupActivityHelper {
|
||||
|
||||
// Since the user sees this format, we use the local timezone
|
||||
private static final SimpleDateFormat DISPLAY_BACKUP_FORMAT =
|
||||
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
private static final DateFormat DISPLAY_BACKUP_FORMAT = DateFormat.getDateTimeInstance(
|
||||
DateFormat.SHORT, DateFormat.SHORT);
|
||||
|
||||
private static final Comparator<Date> REVERSE_DATE_ORDER =
|
||||
new Comparator<Date>() {
|
||||
|
||||
@@ -201,8 +201,8 @@ class ExternalFileBackup {
|
||||
}
|
||||
|
||||
// Dump preferences
|
||||
SharedPreferences preferences =
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences preferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
preferencesHelper.exportPreferences(preferences, outWriter);
|
||||
} catch (IOException e) {
|
||||
// We tried to delete the partially created file, but do nothing
|
||||
@@ -255,8 +255,8 @@ class ExternalFileBackup {
|
||||
pointImporter.importAllRows(reader);
|
||||
|
||||
// Restore preferences
|
||||
SharedPreferences preferences =
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences preferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
preferencesHelper.importPreferences(reader, preferences);
|
||||
} finally {
|
||||
compressedStream.close();
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.google.android.apps.mytracks.Constants;
|
||||
import android.app.backup.BackupAgent;
|
||||
import android.app.backup.BackupDataInput;
|
||||
import android.app.backup.BackupDataOutput;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.Log;
|
||||
@@ -41,7 +42,7 @@ public class MyTracksBackupAgent extends BackupAgent {
|
||||
ParcelFileDescriptor newState) throws IOException {
|
||||
Log.i(Constants.TAG, "Performing backup");
|
||||
SharedPreferences preferences = this.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
|
||||
backupPreferences(data, preferences);
|
||||
Log.i(Constants.TAG, "Backup complete");
|
||||
@@ -91,7 +92,7 @@ public class MyTracksBackupAgent extends BackupAgent {
|
||||
}
|
||||
|
||||
SharedPreferences preferences = this.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
PreferenceBackupHelper importer = createPreferenceBackupHelper();
|
||||
importer.importPreferences(dataBuffer, preferences);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.google.android.apps.mytracks.io.backup;
|
||||
|
||||
import com.google.android.apps.mytracks.content.ContentTypeIds;
|
||||
import com.google.android.apps.mytracks.util.ApiFeatures;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
@@ -77,15 +78,14 @@ class PreferenceBackupHelper {
|
||||
*
|
||||
* @param data the byte array to read preferences from
|
||||
* @param preferences the shared preferences to edit
|
||||
* @return whether the preference change was successful
|
||||
* @throws IOException if there are any errors while reading
|
||||
*/
|
||||
public boolean importPreferences(byte[] data, SharedPreferences preferences)
|
||||
public void importPreferences(byte[] data, SharedPreferences preferences)
|
||||
throws IOException {
|
||||
ByteArrayInputStream bufStream = new ByteArrayInputStream(data);
|
||||
DataInputStream reader = new DataInputStream(bufStream);
|
||||
|
||||
return importPreferences(reader, preferences);
|
||||
importPreferences(reader, preferences);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,10 +93,9 @@ class PreferenceBackupHelper {
|
||||
*
|
||||
* @param reader the stream to read from
|
||||
* @param preferences the shared preferences to edit
|
||||
* @return whether the preference change was successful
|
||||
* @throws IOException if there are any errors while reading
|
||||
*/
|
||||
public boolean importPreferences(DataInputStream reader,
|
||||
public void importPreferences(DataInputStream reader,
|
||||
SharedPreferences preferences) throws IOException {
|
||||
Editor editor = preferences.edit();
|
||||
editor.clear();
|
||||
@@ -107,8 +106,7 @@ class PreferenceBackupHelper {
|
||||
byte typeId = reader.readByte();
|
||||
readAndSetPreference(name, typeId, reader, editor);
|
||||
}
|
||||
|
||||
return editor.commit();
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,6 @@ import com.google.wireless.gdata.parser.ParseException;
|
||||
import com.google.wireless.gdata2.client.AuthenticationException;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.format.DateFormat;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@@ -45,6 +44,7 @@ import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
@@ -290,7 +290,7 @@ public class DocsHelper {
|
||||
DocsTagBuilder tagBuilder = new DocsTagBuilder(metricUnits)
|
||||
.append("name", track.getName())
|
||||
.append("description", track.getDescription())
|
||||
.append("date", getDisplayDate(context, stats.getStartTime()))
|
||||
.append("date", getDisplayDate(stats.getStartTime()))
|
||||
.append("totaltime", StringUtils.formatTimeAlwaysShowingHours(
|
||||
stats.getTotalTime()))
|
||||
.append("movingtime", StringUtils.formatTimeAlwaysShowingHours(
|
||||
@@ -331,17 +331,15 @@ public class DocsHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the display string for a time based on the phone's setting.
|
||||
* Gets the display string for a time.
|
||||
*
|
||||
* @param context the context to obtain the phone's setting.
|
||||
* @param time the time
|
||||
* @return the display string of the time
|
||||
*/
|
||||
protected String getDisplayDate(Context context, long time) {
|
||||
java.text.DateFormat dateFormat = DateFormat.getDateFormat(context);
|
||||
java.text.DateFormat timeFormat = DateFormat.getTimeFormat(context);
|
||||
private String getDisplayDate(long time) {
|
||||
DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
||||
Date startTime = new Date(time);
|
||||
String dateString = dateFormat.format(startTime) + " " + timeFormat.format(startTime);
|
||||
String dateString = format.format(startTime);
|
||||
return dateString;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,12 +15,9 @@
|
||||
*/
|
||||
package com.google.android.apps.mytracks.io.docs;
|
||||
|
||||
import com.google.android.apps.mytracks.util.ApiFeatures;
|
||||
import com.google.android.apps.mytracks.util.StringUtils;
|
||||
import com.google.android.apps.mytracks.util.UnitConversions;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -47,12 +44,16 @@ import java.util.Locale;
|
||||
*/
|
||||
class DocsTagBuilder {
|
||||
|
||||
private static final DecimalFormatSymbols FORMAT_SYMBOLS =
|
||||
ApiFeatures.getInstance().getApiAdapter().getDecimalFormatSymbols(Locale.ENGLISH);
|
||||
private static final NumberFormat LARGE_UNIT_FORMAT =
|
||||
new DecimalFormat("#,###,###.00", FORMAT_SYMBOLS);
|
||||
private static final NumberFormat SMALL_UNIT_FORMAT =
|
||||
new DecimalFormat("###,###", FORMAT_SYMBOLS);
|
||||
// Google Docs can only parse numbers in the English locale.
|
||||
private static final NumberFormat LARGE_UNIT_FORMAT = NumberFormat.getNumberInstance(
|
||||
Locale.ENGLISH);
|
||||
private static final NumberFormat SMALL_UNIT_FORMAT = NumberFormat.getIntegerInstance(
|
||||
Locale.ENGLISH);
|
||||
|
||||
static {
|
||||
LARGE_UNIT_FORMAT.setMaximumFractionDigits(2);
|
||||
LARGE_UNIT_FORMAT.setMinimumFractionDigits(2);
|
||||
}
|
||||
|
||||
protected final boolean metricUnits;
|
||||
protected final StringBuilder stringBuilder;
|
||||
|
||||
@@ -18,15 +18,14 @@ package com.google.android.apps.mytracks.io.file;
|
||||
import com.google.android.apps.mytracks.content.Track;
|
||||
import com.google.android.apps.mytracks.content.Waypoint;
|
||||
import com.google.android.apps.mytracks.io.file.TrackWriterFactory.TrackFileFormat;
|
||||
import com.google.android.apps.mytracks.util.FileUtils;
|
||||
|
||||
import android.location.Location;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* Exports a track as a CSV file, according to RFC 4180.
|
||||
@@ -46,13 +45,10 @@ import java.util.TimeZone;
|
||||
*/
|
||||
public class CsvTrackWriter implements TrackFormatWriter {
|
||||
|
||||
static final NumberFormat SHORT_FORMAT = NumberFormat.getInstance();
|
||||
static final SimpleDateFormat TIMESTAMP_FORMAT =
|
||||
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
||||
private static final NumberFormat SHORT_FORMAT = NumberFormat.getInstance();
|
||||
|
||||
static {
|
||||
SHORT_FORMAT.setMaximumFractionDigits(4);
|
||||
TIMESTAMP_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
}
|
||||
|
||||
private int segmentIdx = 0;
|
||||
@@ -93,7 +89,7 @@ public class CsvTrackWriter implements TrackFormatWriter {
|
||||
|
||||
@Override
|
||||
public void writeLocation(Location location) {
|
||||
String timeStr = TIMESTAMP_FORMAT.format(new Date(location.getTime()));
|
||||
String timeStr = FileUtils.FILE_TIMESTAMP_FORMAT.format(new Date(location.getTime()));
|
||||
writeCommaSeparatedLine("P",
|
||||
timeStr,
|
||||
Double.toString(location.getLatitude()),
|
||||
@@ -109,7 +105,7 @@ public class CsvTrackWriter implements TrackFormatWriter {
|
||||
@Override
|
||||
public void writeWaypoint(Waypoint waypoint) {
|
||||
Location location = waypoint.getLocation();
|
||||
String timeStr = TIMESTAMP_FORMAT.format(new Date(location.getTime()));
|
||||
String timeStr = FileUtils.FILE_TIMESTAMP_FORMAT.format(new Date(location.getTime()));
|
||||
writeCommaSeparatedLine("WAYPOINT",
|
||||
timeStr,
|
||||
Double.toString(location.getLatitude()),
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.google.android.apps.mytracks.io.file;
|
||||
import com.google.android.apps.mytracks.content.Track;
|
||||
import com.google.android.apps.mytracks.content.Waypoint;
|
||||
import com.google.android.apps.mytracks.io.file.TrackWriterFactory.TrackFileFormat;
|
||||
import com.google.android.apps.mytracks.util.FileUtils;
|
||||
import com.google.android.apps.mytracks.util.StringUtils;
|
||||
|
||||
import android.location.Location;
|
||||
@@ -27,10 +28,8 @@ import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* Log of one track.
|
||||
@@ -38,11 +37,8 @@ import java.util.TimeZone;
|
||||
* @author Sandor Dornbush
|
||||
*/
|
||||
public class GpxTrackWriter implements TrackFormatWriter {
|
||||
private static final String TIMESTAMP_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
|
||||
|
||||
private final NumberFormat elevationFormatter;
|
||||
private final NumberFormat coordinateFormatter;
|
||||
private final SimpleDateFormat timestampFormatter;
|
||||
private PrintWriter pw = null;
|
||||
private Track track;
|
||||
|
||||
@@ -57,9 +53,6 @@ public class GpxTrackWriter implements TrackFormatWriter {
|
||||
coordinateFormatter.setMaximumFractionDigits(5);
|
||||
coordinateFormatter.setMaximumIntegerDigits(3);
|
||||
coordinateFormatter.setGroupingUsed(false);
|
||||
|
||||
timestampFormatter = new SimpleDateFormat(TIMESTAMP_FORMAT);
|
||||
timestampFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
}
|
||||
|
||||
private String formatLocation(Location l) {
|
||||
@@ -144,7 +137,7 @@ public class GpxTrackWriter implements TrackFormatWriter {
|
||||
pw.println("<trkpt " + formatLocation(l) + ">");
|
||||
Date d = new Date(l.getTime());
|
||||
pw.println("<ele>" + elevationFormatter.format(l.getAltitude()) + "</ele>");
|
||||
pw.println("<time>" + timestampFormatter.format(d) + "</time>");
|
||||
pw.println("<time>" + FileUtils.FILE_TIMESTAMP_FORMAT.format(d) + "</time>");
|
||||
pw.println("</trkpt>");
|
||||
}
|
||||
}
|
||||
@@ -164,7 +157,7 @@ public class GpxTrackWriter implements TrackFormatWriter {
|
||||
if (l != null) {
|
||||
pw.println("<wpt " + formatLocation(l) + ">");
|
||||
pw.println("<ele>" + elevationFormatter.format(l.getAltitude()) + "</ele>");
|
||||
pw.println("<time>" + timestampFormatter.format(l.getTime()) + "</time>");
|
||||
pw.println("<time>" + FileUtils.FILE_TIMESTAMP_FORMAT.format(l.getTime()) + "</time>");
|
||||
pw.println("<name>" + StringUtils.stringAsCData(waypoint.getName())
|
||||
+ "</name>");
|
||||
pw.println("<desc>"
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.google.android.apps.mytracks.content.Sensor.SensorDataSet;
|
||||
import com.google.android.apps.mytracks.content.Track;
|
||||
import com.google.android.apps.mytracks.content.Waypoint;
|
||||
import com.google.android.apps.mytracks.io.file.TrackWriterFactory.TrackFileFormat;
|
||||
import com.google.android.apps.mytracks.util.FileUtils;
|
||||
import com.google.android.apps.mytracks.util.SystemUtils;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -30,10 +31,8 @@ import android.os.Build;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* Write out a a track in the Garmin training center database, tcx format.
|
||||
@@ -44,10 +43,9 @@ import java.util.TimeZone;
|
||||
* Garmin Training Center 3.5.3.
|
||||
*
|
||||
* @author Sandor Dornbush
|
||||
* @author Dominik Ršttsches
|
||||
* @author Dominik Rttsches
|
||||
*/
|
||||
public class TcxTrackWriter implements TrackFormatWriter {
|
||||
protected static final String TIMESTAMP_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
|
||||
|
||||
// These are the only sports allowed by the TCX v2 specification for fields
|
||||
// of type Sport_t.
|
||||
@@ -59,7 +57,6 @@ public class TcxTrackWriter implements TrackFormatWriter {
|
||||
private static final String TCX_TYPE_RELEASE = "Release";
|
||||
private static final String TCX_TYPE_INTERNAL = "Internal";
|
||||
|
||||
private final SimpleDateFormat timestampFormatter;
|
||||
private final Context context;
|
||||
|
||||
private PrintWriter pw = null;
|
||||
@@ -70,9 +67,6 @@ public class TcxTrackWriter implements TrackFormatWriter {
|
||||
|
||||
public TcxTrackWriter(Context context) {
|
||||
this.context = context;
|
||||
|
||||
timestampFormatter = new SimpleDateFormat(TIMESTAMP_FORMAT);
|
||||
timestampFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
}
|
||||
|
||||
@SuppressWarnings("hiding")
|
||||
@@ -117,7 +111,7 @@ public class TcxTrackWriter implements TrackFormatWriter {
|
||||
return;
|
||||
}
|
||||
|
||||
String startTime = timestampFormatter.format(track.getStatistics().getStartTime());
|
||||
String startTime = FileUtils.FILE_TIMESTAMP_FORMAT.format(track.getStatistics().getStartTime());
|
||||
|
||||
pw.println(" <Activities>");
|
||||
pw.format(" <Activity Sport=\"%s\">\n", categoryToTcxSport(track.getCategory()));
|
||||
@@ -150,7 +144,7 @@ public class TcxTrackWriter implements TrackFormatWriter {
|
||||
}
|
||||
pw.println(" <Trackpoint>");
|
||||
Date d = new Date(location.getTime());
|
||||
pw.println(" <Time>" + timestampFormatter.format(d) + "</Time>");
|
||||
pw.println(" <Time>" + FileUtils.FILE_TIMESTAMP_FORMAT.format(d) + "</Time>");
|
||||
pw.println(" <Position>");
|
||||
|
||||
pw.print(" <LatitudeDegrees>");
|
||||
|
||||
@@ -114,7 +114,7 @@ class TrackWriterImpl implements TrackWriter {
|
||||
private void doWriteTrack() {
|
||||
// Open the input and output
|
||||
success = false;
|
||||
errorMessage = R.string.export_error;
|
||||
errorMessage = R.string.sd_card_error_write_file;
|
||||
if (track != null) {
|
||||
if (openFile()) {
|
||||
try {
|
||||
@@ -127,7 +127,7 @@ class TrackWriterImpl implements TrackWriter {
|
||||
}
|
||||
}
|
||||
success = false;
|
||||
errorMessage = R.string.export_canceled;
|
||||
errorMessage = R.string.sd_card_canceled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class WriteProgressController {
|
||||
dialog.setIcon(android.R.drawable.ic_dialog_info);
|
||||
dialog.setTitle(activity.getString(R.string.generic_progress_title));
|
||||
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
|
||||
dialog.setMessage(activity.getString(R.string.export_progress_message));
|
||||
dialog.setMessage(activity.getString(R.string.sd_card_progress_write_file));
|
||||
dialog.setIndeterminate(true);
|
||||
dialog.setOnCancelListener(dialogCancelListener);
|
||||
return dialog;
|
||||
|
||||
@@ -67,9 +67,6 @@ public class SendActivity extends Activity implements ProgressIndicator {
|
||||
private static final String STATE_SEND_TO_MAPS = "mapsSend";
|
||||
private static final String STATE_SEND_TO_FUSION_TABLES = "fusionSend";
|
||||
private static final String STATE_SEND_TO_DOCS = "docsSend";
|
||||
private static final String STATE_DOCS_MESSAGE = "docsMsg";
|
||||
private static final String STATE_FUSION_TABLES_MESSAGE = "fusionMsg";
|
||||
private static final String STATE_MAPS_MESSAGE = "mapsMsg";
|
||||
private static final String STATE_DOCS_SUCCESS = "docsSuccess";
|
||||
private static final String STATE_FUSION_SUCCESS = "fusionSuccess";
|
||||
private static final String STATE_MAPS_SUCCESS = "mapsSuccess";
|
||||
@@ -134,10 +131,6 @@ public class SendActivity extends Activity implements ProgressIndicator {
|
||||
private boolean sendToMyMapsSuccess = false;
|
||||
private boolean sendToFusionTablesSuccess = false;
|
||||
private boolean sendToDocsSuccess = false;
|
||||
// TODO: Make these be used for showing results
|
||||
private String sendToMyMapsMessage;
|
||||
private String sendToFusionTablesMessage;
|
||||
private String sendToDocsMessage;
|
||||
|
||||
// Send result information, used to share a link.
|
||||
private String sendToMyMapsMapId;
|
||||
@@ -159,7 +152,7 @@ public class SendActivity extends Activity implements ProgressIndicator {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
providerUtils = MyTracksProviderUtils.Factory.get(this);
|
||||
sharedPreferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
sharedPreferences = getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
|
||||
tracker = GoogleAnalyticsTracker.getInstance();
|
||||
// Start the tracker in manual dispatch mode...
|
||||
@@ -259,10 +252,6 @@ public class SendActivity extends Activity implements ProgressIndicator {
|
||||
sendToFusionTablesSuccess = savedInstanceState.getBoolean(STATE_FUSION_SUCCESS);
|
||||
sendToDocsSuccess = savedInstanceState.getBoolean(STATE_DOCS_SUCCESS);
|
||||
|
||||
sendToMyMapsMessage = savedInstanceState.getString(STATE_MAPS_MESSAGE);
|
||||
sendToFusionTablesMessage = savedInstanceState.getString(STATE_FUSION_TABLES_MESSAGE);
|
||||
sendToDocsMessage = savedInstanceState.getString(STATE_DOCS_MESSAGE);
|
||||
|
||||
sendToMyMapsMapId = savedInstanceState.getString(STATE_MAP_ID);
|
||||
sendToFusionTablesTableId = savedInstanceState.getString(STATE_TABLE_ID);
|
||||
|
||||
@@ -280,10 +269,6 @@ public class SendActivity extends Activity implements ProgressIndicator {
|
||||
outState.putBoolean(STATE_FUSION_SUCCESS, sendToFusionTablesSuccess);
|
||||
outState.putBoolean(STATE_DOCS_SUCCESS, sendToDocsSuccess);
|
||||
|
||||
outState.putString(STATE_MAPS_MESSAGE, sendToMyMapsMessage);
|
||||
outState.putString(STATE_FUSION_TABLES_MESSAGE, sendToFusionTablesMessage);
|
||||
outState.putString(STATE_DOCS_MESSAGE, sendToDocsMessage);
|
||||
|
||||
outState.putString(STATE_MAP_ID, sendToMyMapsMapId);
|
||||
outState.putString(STATE_TABLE_ID, sendToFusionTablesTableId);
|
||||
|
||||
@@ -428,9 +413,7 @@ public class SendActivity extends Activity implements ProgressIndicator {
|
||||
|
||||
SendToMyMaps.OnSendCompletedListener onCompletion = new SendToMyMaps.OnSendCompletedListener() {
|
||||
@Override
|
||||
public void onSendCompleted(String mapId, boolean success, String statusMessage) {
|
||||
// TODO: Use this message
|
||||
sendToMyMapsMessage = statusMessage;
|
||||
public void onSendCompleted(String mapId, boolean success) {
|
||||
sendToMyMapsSuccess = success;
|
||||
if (sendToMyMapsSuccess) {
|
||||
sendToMyMapsMapId = mapId;
|
||||
@@ -489,9 +472,7 @@ public class SendActivity extends Activity implements ProgressIndicator {
|
||||
|
||||
OnSendCompletedListener onCompletion = new OnSendCompletedListener() {
|
||||
@Override
|
||||
public void onSendCompleted(String tableId, boolean success, String statusMessage) {
|
||||
// TODO: Use this message
|
||||
sendToFusionTablesMessage = statusMessage;
|
||||
public void onSendCompleted(String tableId, boolean success) {
|
||||
sendToFusionTablesSuccess = success;
|
||||
if (sendToFusionTablesSuccess) {
|
||||
sendToFusionTablesTableId = tableId;
|
||||
@@ -562,11 +543,7 @@ public class SendActivity extends Activity implements ProgressIndicator {
|
||||
Runnable onCompletion = new Runnable() {
|
||||
public void run() {
|
||||
setProgressValue(100);
|
||||
|
||||
// TODO: Use this message
|
||||
sendToDocsMessage = sender.getStatusMessage();
|
||||
sendToDocsSuccess = sender.wasSuccess();
|
||||
|
||||
executeStateMachine(SendState.SEND_TO_DOCS_DONE);
|
||||
}
|
||||
};
|
||||
@@ -871,11 +848,8 @@ public class SendActivity extends Activity implements ProgressIndicator {
|
||||
private void resetState() {
|
||||
currentState = SendState.SEND_OPTIONS;
|
||||
sendToMyMapsMapId = null;
|
||||
sendToMyMapsMessage = "";
|
||||
sendToMyMapsSuccess = true;
|
||||
sendToFusionTablesMessage = "";
|
||||
sendToFusionTablesSuccess = true;
|
||||
sendToDocsMessage = "";
|
||||
sendToDocsSuccess = true;
|
||||
sendToFusionTablesTableId = null;
|
||||
}
|
||||
|
||||
+6
-3
@@ -44,7 +44,8 @@ public class DynamicSpeedTrackPathDescriptor
|
||||
|
||||
public DynamicSpeedTrackPathDescriptor(Context context){
|
||||
this.context = context;
|
||||
SharedPreferences prefs = context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
|
||||
if (prefs == null) {
|
||||
speedMargin = 25;
|
||||
@@ -83,7 +84,8 @@ public class DynamicSpeedTrackPathDescriptor
|
||||
|| !key.equals(context.getString(R.string.track_color_mode_dynamic_speed_variation_key))) {
|
||||
return;
|
||||
}
|
||||
SharedPreferences prefs = context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
|
||||
if (prefs == null) {
|
||||
speedMargin = 25;
|
||||
@@ -98,7 +100,8 @@ public class DynamicSpeedTrackPathDescriptor
|
||||
|
||||
@Override
|
||||
public boolean needsRedraw() {
|
||||
SharedPreferences prefs = context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
long currentTrackId = prefs.getLong(context.getString(R.string.selected_track_key), -1);
|
||||
if(currentTrackId == -1) {
|
||||
// Could not find track.
|
||||
|
||||
+6
-5
@@ -39,15 +39,15 @@ public class FixedSpeedTrackPathDescriptor implements TrackPathDescriptor, OnSha
|
||||
public FixedSpeedTrackPathDescriptor(Context context) {
|
||||
|
||||
this.context = context;
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, 0)
|
||||
.registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
SharedPreferences prefs = context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (prefs == null) {
|
||||
slowSpeed = 9;
|
||||
normalSpeed = 17;
|
||||
return;
|
||||
}
|
||||
prefs.registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
try {
|
||||
slowSpeed = Integer.parseInt(prefs.getString(context.getString(
|
||||
R.string.track_color_mode_fixed_speed_slow_key), "9"));
|
||||
@@ -87,7 +87,8 @@ public class FixedSpeedTrackPathDescriptor implements TrackPathDescriptor, OnSha
|
||||
&& !key.equals(context.getString(R.string.track_color_mode_fixed_speed_medium_key)))) {
|
||||
return;
|
||||
}
|
||||
SharedPreferences prefs = context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (prefs == null) {
|
||||
slowSpeed = 9;
|
||||
normalSpeed = 17;
|
||||
|
||||
@@ -40,8 +40,8 @@ public class TrackPathPainterFactory {
|
||||
* @return The TrackPathPainter that corresponds to the track color mode setting.
|
||||
*/
|
||||
public static TrackPathPainter getTrackPathPainter(Context context) {
|
||||
SharedPreferences prefs =
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (prefs == null) {
|
||||
return new SingleColorTrackPathPainter(context);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import com.google.android.maps.mytracks.R;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -30,8 +30,6 @@ import java.util.Date;
|
||||
* @author Matthew Simmons
|
||||
*/
|
||||
class DefaultTrackNameFactory {
|
||||
private static final String TIMESTAMP_DATE_FORMAT = "yyyy-MM-dd HH:mm";
|
||||
|
||||
private final Context context;
|
||||
|
||||
DefaultTrackNameFactory(Context context) {
|
||||
@@ -48,7 +46,7 @@ class DefaultTrackNameFactory {
|
||||
*/
|
||||
String newTrackName(long trackId, long startTime) {
|
||||
if (useTimestampTrackName()) {
|
||||
SimpleDateFormat formatter = new SimpleDateFormat(TIMESTAMP_DATE_FORMAT);
|
||||
DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
||||
return formatter.format(new Date(startTime));
|
||||
} else {
|
||||
return String.format(context.getString(R.string.track_name_format), trackId);
|
||||
@@ -57,8 +55,8 @@ class DefaultTrackNameFactory {
|
||||
|
||||
/** Determines whether the preferences allow a timestamp-based track name */
|
||||
protected boolean useTimestampTrackName() {
|
||||
SharedPreferences prefs =
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
return prefs.getBoolean(
|
||||
context.getString(R.string.timestamp_track_name_key), true);
|
||||
}
|
||||
|
||||
@@ -16,9 +16,12 @@
|
||||
package com.google.android.apps.mytracks.services;
|
||||
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.util.ApiFeatures;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
import android.util.Log;
|
||||
|
||||
@@ -45,7 +48,7 @@ public class PreferenceManager implements OnSharedPreferenceChangeListener {
|
||||
public PreferenceManager(TrackRecordingService service) {
|
||||
this.service = service;
|
||||
this.sharedPreferences = service.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (sharedPreferences == null) {
|
||||
Log.w(Constants.TAG,
|
||||
"TrackRecordingService: Couldn't get shared preferences.");
|
||||
@@ -169,24 +172,21 @@ public class PreferenceManager implements OnSharedPreferenceChangeListener {
|
||||
}
|
||||
|
||||
public void setAutoResumeTrackCurrentRetry(int retryAttempts) {
|
||||
sharedPreferences
|
||||
.edit()
|
||||
.putInt(autoResumeTrackCurrentRetryKey, retryAttempts)
|
||||
.commit();
|
||||
Editor editor = sharedPreferences.edit();
|
||||
editor.putInt(autoResumeTrackCurrentRetryKey, retryAttempts);
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor);
|
||||
}
|
||||
|
||||
public void setRecordingTrack(long id) {
|
||||
sharedPreferences
|
||||
.edit()
|
||||
.putLong(recordingTrackKey, id)
|
||||
.commit();
|
||||
Editor editor = sharedPreferences.edit();
|
||||
editor.putLong(recordingTrackKey, id);
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor);
|
||||
}
|
||||
|
||||
public void setSelectedTrack(long id) {
|
||||
sharedPreferences
|
||||
.edit()
|
||||
.putLong(selectedTrackKey, id)
|
||||
.commit();
|
||||
Editor editor = sharedPreferences.edit();
|
||||
editor.putLong(selectedTrackKey, id);
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor);
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ServiceUtils {
|
||||
}
|
||||
|
||||
if (preferences == null) {
|
||||
preferences = ctx.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
preferences = ctx.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
}
|
||||
return preferences.getLong(ctx.getString(R.string.recording_track_key), -1) > 0;
|
||||
}
|
||||
|
||||
@@ -392,8 +392,8 @@ public class TrackRecordingService extends Service {
|
||||
+ autoResumeTrackTimeout);
|
||||
|
||||
// Check if we haven't exceeded the maximum number of retry attempts.
|
||||
SharedPreferences sharedPreferences =
|
||||
getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences sharedPreferences = getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
int retries = sharedPreferences.getInt(
|
||||
getString(R.string.auto_resume_track_current_retry_key), 0);
|
||||
Log.d(TAG,
|
||||
@@ -561,7 +561,8 @@ public class TrackRecordingService extends Service {
|
||||
}
|
||||
|
||||
private String getDefaultActivityType(Context context) {
|
||||
SharedPreferences prefs = context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
return prefs.getString(context.getString(R.string.default_activity_key), "");
|
||||
}
|
||||
|
||||
@@ -1056,7 +1057,8 @@ public class TrackRecordingService extends Service {
|
||||
.putExtra(getString(R.string.track_id_broadcast_extra), trackId);
|
||||
sendBroadcast(broadcastIntent, getString(R.string.permission_notification_value));
|
||||
|
||||
SharedPreferences sharedPreferences = getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences sharedPreferences = getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (sharedPreferences.getBoolean(getString(R.string.allow_access_key), false)) {
|
||||
sendBroadcast(broadcastIntent, getString(R.string.broadcast_notifications_permission));
|
||||
}
|
||||
@@ -1215,7 +1217,7 @@ public class TrackRecordingService extends Service {
|
||||
return true;
|
||||
} else {
|
||||
SharedPreferences sharedPreferences = service.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
return sharedPreferences.getBoolean(service.getString(R.string.allow_access_key), false);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -127,8 +127,8 @@ public class BluetoothSensorManager extends SensorManager {
|
||||
Log.w(Constants.TAG, "Disabled manager onStartTrack");
|
||||
return;
|
||||
}
|
||||
SharedPreferences prefs =
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
String address =
|
||||
prefs.getString(context.getString(R.string.bluetooth_sensor_key), null);
|
||||
if (address == null) {
|
||||
|
||||
+2
-2
@@ -40,8 +40,8 @@ public class SensorManagerFactory {
|
||||
* @return The sensor manager that corresponds to the sensor type setting.
|
||||
*/
|
||||
public static SensorManager getSensorManager(Context context) {
|
||||
SharedPreferences prefs =
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (prefs == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+6
-6
@@ -17,13 +17,13 @@ package com.google.android.apps.mytracks.services.sensors.ant;
|
||||
|
||||
import static com.google.android.apps.mytracks.Constants.TAG;
|
||||
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.content.Sensor;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import com.dsi.ant.AntDefine;
|
||||
import com.dsi.ant.AntMesg;
|
||||
import com.dsi.ant.exception.AntInterfaceException;
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.content.Sensor;
|
||||
import com.google.android.apps.mytracks.util.ApiFeatures;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -57,7 +57,7 @@ public class AntDirectSensorManager extends AntSensorManager {
|
||||
|
||||
// First read the the device id that we will be pairing with.
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (prefs != null) {
|
||||
deviceNumberHRM =
|
||||
(short) prefs.getInt(context.getString(R.string.ant_heart_rate_sensor_id_key), 0);
|
||||
@@ -135,7 +135,7 @@ public class AntDirectSensorManager extends AntSensorManager {
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putInt(context.getString(R.string.ant_heart_rate_sensor_id_key), deviceNumberHRM);
|
||||
editor.commit();
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor);
|
||||
}
|
||||
|
||||
private void handleMessageResponse(byte[] rawMessage) {
|
||||
|
||||
-227
@@ -1,227 +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.services.sensors.ant;
|
||||
|
||||
import static com.google.android.apps.mytracks.Constants.TAG;
|
||||
|
||||
import com.dsi.ant.AntDefine;
|
||||
import com.dsi.ant.AntMesg;
|
||||
import com.dsi.ant.exception.AntInterfaceException;
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.content.Sensor;
|
||||
import com.google.android.apps.mytracks.services.sensors.SensorUtils;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
|
||||
/**
|
||||
* A sensor manager that can connect to an SRM Power Control 7 head unit.
|
||||
*
|
||||
* @author Sandor Dornbush
|
||||
*/
|
||||
public class AntSRMSensorManager extends AntSensorManager {
|
||||
|
||||
/*
|
||||
* These constants are defined by the SRM Headunit spec.
|
||||
*/
|
||||
public static final byte NETWORK_NUMBER = (byte) 0;
|
||||
public static final byte DEVICE_TYPE = (byte) 12;
|
||||
public static final byte MANUFACTURER_ID = (byte) 1;
|
||||
public static final short CHANNEL_PERIOD = (short) 8192;
|
||||
public static final byte RF_FREQUENCY = (byte) 50;
|
||||
|
||||
public static final int MESSAGE_TYPE_INDEX = 3;
|
||||
public static final int INITIALS_MESSAGE_TYPE = 5;
|
||||
public static final int SENSOR_DATA_MESSAGE_TYPE = 6;
|
||||
|
||||
public static final int MESSAGE_ID_INDEX = 4;
|
||||
|
||||
/**
|
||||
* This can be any value between 0..8
|
||||
*/
|
||||
private byte channel = (byte) 5;
|
||||
|
||||
/**
|
||||
* This is the id of this device.
|
||||
* The head unit must be programmed to expect this number.
|
||||
*/
|
||||
private byte deviceId;
|
||||
|
||||
/**
|
||||
* The id of the last message received from the SRM head unit.
|
||||
*/
|
||||
private int lastMessageId;
|
||||
|
||||
public AntSRMSensorManager(Context context) {
|
||||
super(context);
|
||||
|
||||
// First read the the device id that we will be announcing.
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
if (prefs != null) {
|
||||
deviceId = (byte) prefs.getInt(
|
||||
context.getString(R.string.ant_srm_bridge_sensor_id_key),
|
||||
WILDCARD);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMessage(byte[] antMessage) {
|
||||
// Parse channel number
|
||||
byte recievedChannel = (byte) (antMessage[AntMesg.MESG_DATA_OFFSET]
|
||||
& AntDefine.CHANNEL_NUMBER_MASK);
|
||||
if (recievedChannel != channel) {
|
||||
Log.d(TAG, "Unexpected channel: " + recievedChannel);
|
||||
return;
|
||||
}
|
||||
switch (antMessage[AntMesg.MESG_ID_OFFSET]) {
|
||||
case AntMesg.MESG_BROADCAST_DATA_ID:
|
||||
handleBroadcastData(antMessage);
|
||||
break;
|
||||
case AntMesg.MESG_RESPONSE_EVENT_ID:
|
||||
handleMessageResponse(antMessage);
|
||||
break;
|
||||
case AntMesg.MESG_CHANNEL_ID_ID:
|
||||
handleChannelId(antMessage);
|
||||
break;
|
||||
default:
|
||||
Log.e(TAG, "Unexpected message id: " + antMessage[3]);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleBroadcastData(byte[] antMessage) {
|
||||
if (deviceId == WILDCARD) {
|
||||
try {
|
||||
Log.d(TAG, "Requesting channel id id.");
|
||||
getAntReceiver().ANTRequestMessage(channel, AntMesg.MESG_CHANNEL_ID_ID);
|
||||
} catch (AntInterfaceException e) {
|
||||
Log.e(TAG, "Failed to request channel id id", e);
|
||||
}
|
||||
}
|
||||
setSensorState(Sensor.SensorState.CONNECTED);
|
||||
switch(antMessage[MESSAGE_TYPE_INDEX]) {
|
||||
case INITIALS_MESSAGE_TYPE:
|
||||
// TODO handle initials message.
|
||||
break;
|
||||
case SENSOR_DATA_MESSAGE_TYPE:
|
||||
parseSensorData(antMessage);
|
||||
break;
|
||||
default:
|
||||
Log.e(TAG, "Unexpected message type: " + antMessage[MESSAGE_TYPE_INDEX]);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleChannelId(byte[] antMessage) {
|
||||
// Store the device id.
|
||||
deviceId = antMessage[3];
|
||||
Log.i(TAG, "Found device id: " + deviceId);
|
||||
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putInt(context.getString(R.string.ant_srm_bridge_sensor_id_key), deviceId);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
private void handleMessageResponse(byte[] antMessage) {
|
||||
if (antMessage[3] == AntMesg.MESG_EVENT_ID
|
||||
&& antMessage[4] == AntDefine.EVENT_RX_SEARCH_TIMEOUT) {
|
||||
// Search timeout
|
||||
Log.w(TAG, "Search timed out. Unassigning channel.");
|
||||
try {
|
||||
getAntReceiver().ANTUnassignChannel(channel);
|
||||
} catch (AntInterfaceException e) {
|
||||
Log.e(TAG, "Failed to unassign ANT channel", e);
|
||||
}
|
||||
setSensorState(Sensor.SensorState.DISCONNECTED);
|
||||
} else if (antMessage[3] == AntMesg.MESG_UNASSIGN_CHANNEL_ID) {
|
||||
setSensorState(Sensor.SensorState.DISCONNECTED);
|
||||
Log.i(TAG, "Disconnected from the sensor: " + getSensorState());
|
||||
}
|
||||
}
|
||||
|
||||
private void parseSensorData(byte[] antMessage) {
|
||||
if (antMessage.length != 11) {
|
||||
Log.e(TAG, "Unexpected ant message length: " + antMessage.length);
|
||||
return;
|
||||
}
|
||||
|
||||
int newMessageId = antMessage[MESSAGE_ID_INDEX] & 0xFF;
|
||||
if (lastMessageId == newMessageId) {
|
||||
// Repeated message.
|
||||
Log.i(TAG, String.format("SRM ignoring repeat: 0x%X", newMessageId));
|
||||
return;
|
||||
}
|
||||
if (newMessageId < lastMessageId) {
|
||||
if (!(newMessageId < 20 && lastMessageId > 200)) {
|
||||
Log.i(TAG, String.format("SRM ignoring repeat: 0x%X", newMessageId));
|
||||
return;
|
||||
} // else assume the byte overflowed to 0.
|
||||
}
|
||||
lastMessageId = newMessageId;
|
||||
|
||||
Sensor.SensorDataSet.Builder builder = Sensor.SensorDataSet.newBuilder()
|
||||
.setCreationTime(System.currentTimeMillis());
|
||||
|
||||
int power = SensorUtils.unsignedShortToInt(antMessage, 5);
|
||||
if (power >= 0) {
|
||||
Sensor.SensorData.Builder b = Sensor.SensorData.newBuilder()
|
||||
.setValue(power)
|
||||
.setState(Sensor.SensorState.SENDING);
|
||||
builder.setPower(b);
|
||||
}
|
||||
|
||||
int speed = SensorUtils.unsignedShortToInt(antMessage, 7);
|
||||
if (speed >= 0) {
|
||||
// The speed from srm is in 1/10 km/hr.
|
||||
// Sensor data expects the speed as m/s.
|
||||
// TODO finish this.
|
||||
//sensorData.setWheelSpeed(UnitConversions.TENTH_KMH_TO_MPS * speed);
|
||||
}
|
||||
|
||||
int cadence = antMessage[9] & 0xFF;
|
||||
if (cadence >= 0) {
|
||||
Sensor.SensorData.Builder b = Sensor.SensorData.newBuilder()
|
||||
.setValue(cadence)
|
||||
.setState(Sensor.SensorState.SENDING);
|
||||
builder.setCadence(b);
|
||||
}
|
||||
|
||||
int bpm = antMessage[10] & 0xFF;
|
||||
if (bpm > 0) {
|
||||
Sensor.SensorData.Builder b = Sensor.SensorData.newBuilder()
|
||||
.setValue(bpm)
|
||||
.setState(Sensor.SensorState.SENDING);
|
||||
builder.setHeartRate(b);
|
||||
}
|
||||
sensorData = builder.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setupAntSensorChannels() {
|
||||
lastMessageId = 0;
|
||||
setupAntSensorChannel(NETWORK_NUMBER,
|
||||
channel,
|
||||
deviceId,
|
||||
DEVICE_TYPE,
|
||||
MANUFACTURER_ID,
|
||||
CHANNEL_PERIOD,
|
||||
RF_FREQUENCY,
|
||||
(byte) 0);
|
||||
}
|
||||
}
|
||||
+10
-8
@@ -22,6 +22,7 @@ import com.dsi.ant.AntMesg;
|
||||
import com.dsi.ant.exception.AntInterfaceException;
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.content.Sensor;
|
||||
import com.google.android.apps.mytracks.util.ApiFeatures;
|
||||
import com.google.android.apps.mytracks.util.SystemUtils;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
@@ -68,7 +69,7 @@ public class AntSrmBridgeSensorManager extends AntSensorManager {
|
||||
|
||||
// First read the the device id that we will be pairing with.
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (prefs != null) {
|
||||
deviceNumber =
|
||||
(short) prefs.getInt(context.getString(
|
||||
@@ -151,6 +152,7 @@ public class AntSrmBridgeSensorManager extends AntSensorManager {
|
||||
|
||||
int powerVal = (((msg[INDEX_MESSAGE_POWER] & 0xFF) << 8) |
|
||||
(msg[INDEX_MESSAGE_POWER+1] & 0xFF));
|
||||
@SuppressWarnings("unused")
|
||||
int speedVal = (((msg[INDEX_MESSAGE_SPEED] & 0xFF) << 8) |
|
||||
(msg[INDEX_MESSAGE_SPEED+1] & 0xFF));
|
||||
int cadenceVal = (msg[INDEX_MESSAGE_CADENCE] & 0xFF);
|
||||
@@ -162,12 +164,12 @@ public class AntSrmBridgeSensorManager extends AntSensorManager {
|
||||
.setValue(powerVal)
|
||||
.setState(Sensor.SensorState.SENDING);
|
||||
|
||||
// Although speed is available from the SRM Bridge, MyTracks doesn't
|
||||
// use the value, and computes speed from the GPS location data.
|
||||
// Sensor.SensorData.Builder speed =
|
||||
// Sensor.SensorData.newBuilder()
|
||||
// .setValue(speedVal)
|
||||
// .setState(Sensor.SensorState.SENDING);
|
||||
/*
|
||||
* Although speed is available from the SRM Bridge, MyTracks doesn't use the value, and
|
||||
* computes speed from the GPS location data.
|
||||
*/
|
||||
// Sensor.SensorData.Builder speed = Sensor.SensorData.newBuilder().setValue(speedVal).setState(
|
||||
// Sensor.SensorState.SENDING);
|
||||
|
||||
Sensor.SensorData.Builder cadence =
|
||||
Sensor.SensorData.newBuilder()
|
||||
@@ -197,7 +199,7 @@ public class AntSrmBridgeSensorManager extends AntSensorManager {
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
editor.putInt(context.getString(R.string.ant_srm_bridge_sensor_id_key), deviceNumber);
|
||||
editor.commit();
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor);
|
||||
}
|
||||
|
||||
private void handleMessageResponse(byte[] rawMessage) {
|
||||
|
||||
+70
-63
@@ -150,66 +150,81 @@ public class StatusAnnouncerTask implements PeriodicTask {
|
||||
*/
|
||||
// @VisibleForTesting
|
||||
protected String getAnnouncement(TripStatistics stats) {
|
||||
SharedPreferences preferences =
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
boolean metricUnits = true;
|
||||
boolean reportSpeed = true;
|
||||
SharedPreferences preferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (preferences != null) {
|
||||
metricUnits =
|
||||
preferences.getBoolean(context.getString(R.string.metric_units_key),
|
||||
true);
|
||||
reportSpeed =
|
||||
preferences.getBoolean(context.getString(R.string.report_speed_key),
|
||||
true);
|
||||
metricUnits = preferences.getBoolean(context.getString(R.string.metric_units_key), true);
|
||||
reportSpeed = preferences.getBoolean(context.getString(R.string.report_speed_key), true);
|
||||
}
|
||||
|
||||
double d = stats.getTotalDistance() / 1000;
|
||||
double s = stats.getAverageMovingSpeed() * 3.6;
|
||||
double d = stats.getTotalDistance() / 1000; // d is in kilometers
|
||||
double s = stats.getAverageMovingSpeed() * 3.6; // s is in kilometers per hour
|
||||
|
||||
if (d == 0) {
|
||||
return context.getString(R.string.voice_no_distance);
|
||||
return context.getString(R.string.voice_total_distance_zero);
|
||||
}
|
||||
|
||||
int speedLabel;
|
||||
if (metricUnits) {
|
||||
if (reportSpeed) {
|
||||
speedLabel = R.string.voice_kilometer_per_hour;
|
||||
} else {
|
||||
speedLabel = R.string.voice_per_kilometer;
|
||||
}
|
||||
} else {
|
||||
s *= UnitConversions.KMH_TO_MPH;
|
||||
if (!metricUnits) {
|
||||
d *= UnitConversions.KM_TO_MI;
|
||||
if (reportSpeed) {
|
||||
speedLabel = R.string.voice_mile_per_hour;
|
||||
} else {
|
||||
speedLabel = R.string.voice_per_mile;
|
||||
}
|
||||
s *= UnitConversions.KMH_TO_MPH;
|
||||
}
|
||||
|
||||
String speed = null;
|
||||
if ((s == 0) || Double.isNaN(s)) {
|
||||
speed = context.getString(R.string.value_unknown);
|
||||
if (!reportSpeed) {
|
||||
s = 3600000.0 / s; // converts from speed to pace
|
||||
}
|
||||
|
||||
// Makes sure s is not NaN.
|
||||
if (Double.isNaN(s)) {
|
||||
s = 0;
|
||||
}
|
||||
|
||||
String speed;
|
||||
if (reportSpeed) {
|
||||
int speedId = metricUnits ? R.plurals.voiceSpeedKilometersPerHour
|
||||
: R.plurals.voiceSpeedMilesPerHour;
|
||||
speed = context.getResources().getQuantityString(speedId, getQuantityCount(s), s);
|
||||
} else {
|
||||
if (reportSpeed) {
|
||||
speed = String.format("%.1f", s);
|
||||
} else {
|
||||
double pace = 3600000.0 / s;
|
||||
Log.w(Constants.TAG,
|
||||
"Converted speed: " + s + " to pace: " + pace);
|
||||
speed = getAnnounceTime((long) pace);
|
||||
}
|
||||
int paceId = metricUnits ? R.string.voice_pace_per_kilometer : R.string.voice_pace_per_mile;
|
||||
speed = String.format(context.getString(paceId), getAnnounceTime((long) s));
|
||||
}
|
||||
|
||||
return context.getString(R.string.voice_template,
|
||||
d,
|
||||
context.getString(metricUnits
|
||||
? R.string.voice_kilometers
|
||||
: R.string.voice_miles),
|
||||
getAnnounceTime(stats.getMovingTime()),
|
||||
speed,
|
||||
context.getString(speedLabel));
|
||||
}
|
||||
int totalDistanceId = metricUnits ? R.plurals.voiceTotalDistanceKilometers
|
||||
: R.plurals.voiceTotalDistanceMiles;
|
||||
String totalDistance = context.getResources().getQuantityString(
|
||||
totalDistanceId, getQuantityCount(d), d);
|
||||
|
||||
return context.getString(
|
||||
R.string.voice_template, totalDistance, getAnnounceTime(stats.getMovingTime()), speed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plural count to be used by getQuantityString. getQuantityString
|
||||
* only supports integer quantities, not a double quantity like "2.2".
|
||||
* <p>
|
||||
* As a temporary workaround, we convert a double quantity to an integer
|
||||
* quantity. If the double quantity is exactly 0, 1, or 2, then we can return
|
||||
* these integer quantities. Otherwise, we cast the double quantity to an
|
||||
* integer quantity. However, we need to make sure that if the casted value is
|
||||
* 0, 1, or 2, we don't return those, instead, return the next biggest integer
|
||||
* 3.
|
||||
*
|
||||
* @param d the double value
|
||||
*/
|
||||
private int getQuantityCount(double d) {
|
||||
if (d == 0) {
|
||||
return 0;
|
||||
} else if (d == 1) {
|
||||
return 1;
|
||||
} else if (d == 2) {
|
||||
return 2;
|
||||
} else {
|
||||
int count = (int) d;
|
||||
return count < 3 ? 3 : count;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
Log.i(Constants.TAG, "Starting TTS");
|
||||
@@ -331,30 +346,22 @@ public class StatusAnnouncerTask implements PeriodicTask {
|
||||
@VisibleForTesting
|
||||
String getAnnounceTime(long time) {
|
||||
int[] parts = StringUtils.getTimeParts(time);
|
||||
String secLabel =
|
||||
context.getString(parts[0] == 1 ? R.string.voice_second : R.string.voice_seconds);
|
||||
String minLabel =
|
||||
context.getString(parts[1] == 1 ? R.string.voice_minute : R.string.voice_minutes);
|
||||
String hourLabel =
|
||||
context.getString(parts[2] == 1 ? R.string.voice_hour : R.string.voice_hours);
|
||||
String seconds = context.getResources().getQuantityString(
|
||||
R.plurals.voiceSeconds, parts[0], parts[0]);
|
||||
String minutes = context.getResources().getQuantityString(
|
||||
R.plurals.voiceMinutes, parts[1], parts[1]);
|
||||
String hours = context.getResources().getQuantityString(
|
||||
R.plurals.voiceHours, parts[2], parts[2]);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (parts[2] != 0) {
|
||||
sb.append(parts[2]);
|
||||
sb.append(hours);
|
||||
sb.append(" ");
|
||||
sb.append(hourLabel);
|
||||
sb.append(" ");
|
||||
sb.append(parts[1]);
|
||||
sb.append(" ");
|
||||
sb.append(minLabel);
|
||||
sb.append(minutes);
|
||||
} else {
|
||||
sb.append(parts[1]);
|
||||
sb.append(minutes);
|
||||
sb.append(" ");
|
||||
sb.append(minLabel);
|
||||
sb.append(" ");
|
||||
sb.append(parts[0]);
|
||||
sb.append(" ");
|
||||
sb.append(secLabel);
|
||||
sb.append(seconds);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@@ -33,8 +33,6 @@ import android.util.Log;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* API level 3 specific implementation of the {@link ApiLevelAdapter}.
|
||||
@@ -112,11 +110,6 @@ public class ApiLevel3Adapter implements ApiLevelAdapter {
|
||||
return output;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DecimalFormatSymbols getDecimalFormatSymbols(Locale locale) {
|
||||
return new DecimalFormatSymbols(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpTransport getHttpTransport() {
|
||||
return new ApacheHttpTransport();
|
||||
|
||||
@@ -8,9 +8,7 @@ import android.content.SharedPreferences.Editor;
|
||||
import android.os.StrictMode;
|
||||
import android.util.Log;
|
||||
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* API level 9 specific implementation of the {@link ApiLevelAdapter}.
|
||||
@@ -43,12 +41,7 @@ public class ApiLevel9Adapter extends ApiLevel8Adapter {
|
||||
public byte[] copyByteArray(byte[] input, int start, int end) {
|
||||
return Arrays.copyOfRange(input, start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DecimalFormatSymbols getDecimalFormatSymbols(Locale locale) {
|
||||
return DecimalFormatSymbols.getInstance(locale);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public HttpTransport getHttpTransport() {
|
||||
return new NetHttpTransport();
|
||||
|
||||
@@ -25,9 +25,6 @@ import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* A set of methods that may be implemented differently depending on the Android API level.
|
||||
*
|
||||
@@ -107,16 +104,6 @@ public interface ApiLevelAdapter {
|
||||
byte[] copyByteArray(byte[] input, int start, int end);
|
||||
|
||||
|
||||
/**
|
||||
* Gets an instance of {@link DecimalFormatSymbols} for a locale.
|
||||
*
|
||||
* Due to changes in API level 9.
|
||||
*
|
||||
* @param locale the locale
|
||||
* @return a new instance of {@link DecimalFormatSymbols}
|
||||
*/
|
||||
DecimalFormatSymbols getDecimalFormatSymbols(Locale locale);
|
||||
|
||||
/**
|
||||
* Gets a {@link HttpTransport}.
|
||||
*
|
||||
|
||||
@@ -49,8 +49,8 @@ public class ChartURLGenerator {
|
||||
*/
|
||||
public static String getChartUrl(Vector<Double> distances,
|
||||
Vector<Double> elevations, Track track, Context context) {
|
||||
SharedPreferences preferences =
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences preferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
boolean metricUnits = true;
|
||||
if (preferences != null) {
|
||||
metricUnits = preferences.getBoolean(
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
|
||||
/**
|
||||
* Utilities for the EULA preference value.
|
||||
*/
|
||||
public class EulaUtil {
|
||||
private static final String EULA_PREFERENCE_FILE = "eula";
|
||||
private static final String EULA_PREFERENCE_KEY = "eula.accepted";
|
||||
|
||||
private EulaUtil() {}
|
||||
|
||||
public static boolean getEulaValue(Context context) {
|
||||
SharedPreferences preferences = context.getSharedPreferences(
|
||||
EULA_PREFERENCE_FILE, Context.MODE_PRIVATE);
|
||||
return preferences.getBoolean(EULA_PREFERENCE_KEY, false);
|
||||
}
|
||||
|
||||
public static void setEulaValue(Context context) {
|
||||
SharedPreferences preferences = context.getSharedPreferences(
|
||||
EULA_PREFERENCE_FILE, Context.MODE_PRIVATE);
|
||||
Editor editor = preferences.edit();
|
||||
editor.putBoolean(EULA_PREFERENCE_KEY, true);
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(editor);
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,8 @@ import com.google.android.apps.mytracks.Constants;
|
||||
import android.os.Environment;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.TimeZone;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
@@ -39,6 +41,16 @@ public class FileUtils {
|
||||
private static final Pattern PROHIBITED_CHAR_PATTERN =
|
||||
Pattern.compile("[^ A-Za-z0-9_.()-]+");
|
||||
|
||||
/**
|
||||
* Timestamp format in UTC time zone.
|
||||
*/
|
||||
public static final SimpleDateFormat FILE_TIMESTAMP_FORMAT =
|
||||
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
||||
|
||||
static {
|
||||
FILE_TIMESTAMP_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds a path inside the My Tracks directory in the SD card.
|
||||
*
|
||||
|
||||
@@ -25,7 +25,7 @@ import com.google.android.maps.mytracks.R;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.ParsePosition;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
@@ -66,7 +66,12 @@ public class StringUtils implements DescriptionGenerator {
|
||||
return formatTimeInternal(time, true);
|
||||
}
|
||||
|
||||
private static final DecimalFormat SINGLE_DECIMAL_PLACE_FORMAT = new DecimalFormat("#.#");
|
||||
private static final NumberFormat SINGLE_DECIMAL_PLACE_FORMAT = NumberFormat.getNumberInstance();
|
||||
|
||||
static {
|
||||
SINGLE_DECIMAL_PLACE_FORMAT.setMaximumFractionDigits(1);
|
||||
SINGLE_DECIMAL_PLACE_FORMAT.setMinimumFractionDigits(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a double precision number as decimal number with a single decimal
|
||||
@@ -231,8 +236,8 @@ public class StringUtils implements DescriptionGenerator {
|
||||
public String generateTrackDescription(Track track, Vector<Double> distances,
|
||||
Vector<Double> elevations) {
|
||||
boolean displaySpeed = true;
|
||||
SharedPreferences preferences =
|
||||
context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences preferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (preferences != null) {
|
||||
displaySpeed =
|
||||
preferences.getBoolean(context.getString(R.string.report_speed_key), true);
|
||||
|
||||
@@ -94,7 +94,7 @@ public class TrackWidgetProvider
|
||||
providerUtils = MyTracksProviderUtils.Factory.get(context);
|
||||
unknown = context.getString(R.string.value_unknown);
|
||||
|
||||
sharedPreferences = context.getSharedPreferences(SETTINGS_NAME, 0);
|
||||
sharedPreferences = context.getSharedPreferences(SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
sharedPreferences.registerOnSharedPreferenceChangeListener(this);
|
||||
onSharedPreferenceChanged(sharedPreferences, null);
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ public class ChartValueSeriesTest extends AndroidTestCase {
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
series = new ChartValueSeries(getContext(),
|
||||
"###,###",
|
||||
R.color.elevation_fill,
|
||||
R.color.elevation_border,
|
||||
new ZoomSettings(5, new int[] {100}),
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Instrumentation.ActivityMonitor;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.Editor;
|
||||
@@ -223,7 +224,7 @@ public class MyTracksTest extends ActivityInstrumentationTestCase2<MyTracks>{
|
||||
editor.putLong(getActivity().getString(R.string.recording_track_key), -1);
|
||||
|
||||
editor.clear();
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,7 +254,8 @@ public class MyTracksTest extends ActivityInstrumentationTestCase2<MyTracks>{
|
||||
|
||||
private SharedPreferences getSharedPreferences() {
|
||||
if (sharedPreferences == null) {
|
||||
sharedPreferences = getActivity().getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
sharedPreferences = getActivity().getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
}
|
||||
return sharedPreferences;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.google.android.apps.mytracks.services.TrackRecordingServiceTest.MockC
|
||||
import com.google.android.maps.mytracks.R;
|
||||
import com.google.android.testing.mocking.AndroidMock;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
import android.database.ContentObserver;
|
||||
@@ -86,7 +87,7 @@ public class TrackDataHubTest extends AndroidTestCase {
|
||||
getContext(), getContext(), "test.");
|
||||
context = new MockContext(mockContentResolver, targetContext);
|
||||
|
||||
prefs = context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
prefs = context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
providerUtils = AndroidMock.createMock("providerUtils", MyTracksProviderUtils.class);
|
||||
dataSources = AndroidMock.createNiceMock("dataSources", DataSourcesWrapper.class);
|
||||
|
||||
@@ -138,7 +139,7 @@ public class TrackDataHubTest extends AndroidTestCase {
|
||||
Capture<ContentObserver> observerCapture = new Capture<ContentObserver>();
|
||||
Track track = new Track();
|
||||
prefs.edit().putLong("recordingTrack", TRACK_ID)
|
||||
.putLong("selectedTrack", TRACK_ID).commit();
|
||||
.putLong("selectedTrack", TRACK_ID).apply();
|
||||
expect(providerUtils.getTrack(TRACK_ID)).andStubReturn(track);
|
||||
expectStart();
|
||||
dataSources.registerContentObserver(
|
||||
@@ -297,7 +298,7 @@ public class TrackDataHubTest extends AndroidTestCase {
|
||||
public void testWaypointListen() {
|
||||
Capture<ContentObserver> observerCapture = new Capture<ContentObserver>();
|
||||
prefs.edit().putLong("recordingTrack", TRACK_ID)
|
||||
.putLong("selectedTrack", TRACK_ID).commit();
|
||||
.putLong("selectedTrack", TRACK_ID).apply();
|
||||
|
||||
Waypoint wpt1 = new Waypoint(),
|
||||
wpt2 = new Waypoint(),
|
||||
@@ -411,7 +412,7 @@ public class TrackDataHubTest extends AndroidTestCase {
|
||||
public void testPointsListen() {
|
||||
Capture<ContentObserver> observerCapture = new Capture<ContentObserver>();
|
||||
prefs.edit().putLong("recordingTrack", TRACK_ID)
|
||||
.putLong("selectedTrack", TRACK_ID).commit();
|
||||
.putLong("selectedTrack", TRACK_ID).apply();
|
||||
|
||||
expectStart();
|
||||
dataSources.registerContentObserver(
|
||||
@@ -498,7 +499,7 @@ public class TrackDataHubTest extends AndroidTestCase {
|
||||
public void testPointsListen_reRegister() {
|
||||
Capture<ContentObserver> observerCapture = new Capture<ContentObserver>();
|
||||
prefs.edit().putLong("recordingTrack", TRACK_ID)
|
||||
.putLong("selectedTrack", TRACK_ID).commit();
|
||||
.putLong("selectedTrack", TRACK_ID).apply();
|
||||
|
||||
expectStart();
|
||||
dataSources.registerContentObserver(
|
||||
@@ -570,7 +571,7 @@ public class TrackDataHubTest extends AndroidTestCase {
|
||||
public void testPointsListen_reRegisterTrackChanged() {
|
||||
Capture<ContentObserver> observerCapture = new Capture<ContentObserver>();
|
||||
prefs.edit().putLong("recordingTrack", TRACK_ID)
|
||||
.putLong("selectedTrack", TRACK_ID).commit();
|
||||
.putLong("selectedTrack", TRACK_ID).apply();
|
||||
|
||||
expectStart();
|
||||
dataSources.registerContentObserver(
|
||||
@@ -628,7 +629,7 @@ public class TrackDataHubTest extends AndroidTestCase {
|
||||
public void testPointsListen_largeTrackSampling() {
|
||||
Capture<ContentObserver> observerCapture = new Capture<ContentObserver>();
|
||||
prefs.edit().putLong("recordingTrack", TRACK_ID)
|
||||
.putLong("selectedTrack", TRACK_ID).commit();
|
||||
.putLong("selectedTrack", TRACK_ID).apply();
|
||||
|
||||
expectStart();
|
||||
dataSources.registerContentObserver(
|
||||
@@ -661,7 +662,7 @@ public class TrackDataHubTest extends AndroidTestCase {
|
||||
public void testPointsListen_resampling() {
|
||||
Capture<ContentObserver> observerCapture = new Capture<ContentObserver>();
|
||||
prefs.edit().putLong("recordingTrack", TRACK_ID)
|
||||
.putLong("selectedTrack", TRACK_ID).commit();
|
||||
.putLong("selectedTrack", TRACK_ID).apply();
|
||||
|
||||
expectStart();
|
||||
dataSources.registerContentObserver(
|
||||
@@ -814,7 +815,7 @@ public class TrackDataHubTest extends AndroidTestCase {
|
||||
prefs.edit()
|
||||
.putBoolean(metricUnitsKey, true)
|
||||
.putBoolean(speedKey, true)
|
||||
.commit();
|
||||
.apply();
|
||||
|
||||
Capture<OnSharedPreferenceChangeListener> listenerCapture =
|
||||
new Capture<OnSharedPreferenceChangeListener>();
|
||||
@@ -840,7 +841,7 @@ public class TrackDataHubTest extends AndroidTestCase {
|
||||
|
||||
prefs.edit()
|
||||
.putBoolean(speedKey, false)
|
||||
.commit();
|
||||
.apply();
|
||||
OnSharedPreferenceChangeListener listener = listenerCapture.getValue();
|
||||
listener.onSharedPreferenceChanged(prefs, speedKey);
|
||||
|
||||
@@ -854,7 +855,7 @@ public class TrackDataHubTest extends AndroidTestCase {
|
||||
|
||||
prefs.edit()
|
||||
.putBoolean(metricUnitsKey, false)
|
||||
.commit();
|
||||
.apply();
|
||||
listener.onSharedPreferenceChanged(prefs, metricUnitsKey);
|
||||
|
||||
verifyAndReset();
|
||||
|
||||
+4
-4
@@ -48,13 +48,13 @@ public class PreferenceBackupHelperTest extends TestCase {
|
||||
|
||||
@Override
|
||||
public boolean commit() {
|
||||
preferenceValues = newPreferences;
|
||||
apply();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
commit();
|
||||
preferenceValues = newPreferences;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -185,7 +185,7 @@ public class PreferenceBackupHelperTest extends TestCase {
|
||||
editor.putInt("int1", 42);
|
||||
editor.putLong("long1", 123456789L);
|
||||
editor.putString("str1", "lolcat");
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
|
||||
// Export it
|
||||
byte[] exported = preferenceBackupHelper.exportPreferences(preferences);
|
||||
@@ -195,7 +195,7 @@ public class PreferenceBackupHelperTest extends TestCase {
|
||||
editor.clear();
|
||||
editor.putString("str2", "Shouldn't be there after restore");
|
||||
editor.putBoolean("bool2", true);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
|
||||
// Import it back
|
||||
preferenceBackupHelper.importPreferences(exported, preferences);
|
||||
|
||||
+4
-13
@@ -40,7 +40,8 @@ import junit.framework.TestCase;
|
||||
*/
|
||||
public class DocsHelper_AddTrackRowTest extends TestCase {
|
||||
private static final long TIME = 1288721514000L;
|
||||
private static final DateFormat DATE_FORMAT = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
||||
private static final DateFormat DATE_FORMAT = DateFormat.getDateTimeInstance(
|
||||
DateFormat.SHORT, DateFormat.SHORT);
|
||||
|
||||
private static class StringWritingDocsHelper extends DocsHelper {
|
||||
String writtenSheetUri = null;
|
||||
@@ -55,12 +56,7 @@ public class DocsHelper_AddTrackRowTest extends TestCase {
|
||||
}
|
||||
|
||||
public void testAddTrackRow_imperial() throws Exception {
|
||||
StringWritingDocsHelper docsHelper = new StringWritingDocsHelper() {
|
||||
@Override
|
||||
protected String getDisplayDate(Context context, long time) {
|
||||
return DATE_FORMAT.format(new Date(TIME));
|
||||
}
|
||||
};
|
||||
StringWritingDocsHelper docsHelper = new StringWritingDocsHelper();
|
||||
addTrackRow(docsHelper, false);
|
||||
|
||||
String expectedData =
|
||||
@@ -94,12 +90,7 @@ public class DocsHelper_AddTrackRowTest extends TestCase {
|
||||
}
|
||||
|
||||
public void testAddTrackRow_metric() throws Exception {
|
||||
StringWritingDocsHelper docsHelper = new StringWritingDocsHelper() {
|
||||
@Override
|
||||
protected String getDisplayDate(Context context, long time) {
|
||||
return DATE_FORMAT.format(new Date(TIME));
|
||||
}
|
||||
};
|
||||
StringWritingDocsHelper docsHelper = new StringWritingDocsHelper();
|
||||
addTrackRow(docsHelper, true);
|
||||
|
||||
// The imperial test verifies that the tags come out in the proper order,
|
||||
|
||||
@@ -3,13 +3,9 @@ package com.google.android.apps.mytracks.io.file;
|
||||
|
||||
import com.google.android.apps.mytracks.content.MyTracksLocation;
|
||||
import com.google.android.apps.mytracks.content.Sensor;
|
||||
import com.google.android.apps.mytracks.io.file.TcxTrackWriter;
|
||||
import com.google.android.apps.mytracks.io.file.TrackFormatWriter;
|
||||
import com.google.android.apps.mytracks.util.FileUtils;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
@@ -20,15 +16,6 @@ import org.w3c.dom.Element;
|
||||
* @author Sandor Dornbush
|
||||
*/
|
||||
public class TcxTrackWriterTest extends TrackFormatWriterTest {
|
||||
private DateFormat timestampFormatter;
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
timestampFormatter = new SimpleDateFormat(TcxTrackWriter.TIMESTAMP_FORMAT);
|
||||
timestampFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
}
|
||||
|
||||
public void testXmlOutput() throws Exception {
|
||||
TrackFormatWriter writer = new TcxTrackWriter(getContext());
|
||||
@@ -72,7 +59,7 @@ public class TcxTrackWriterTest extends TrackFormatWriterTest {
|
||||
assertEquals(Double.toString(loc.getLongitude()),
|
||||
getChildTextValue(posTag, "LongitudeDegrees"));
|
||||
|
||||
assertEquals(timestampFormatter.format(loc.getTime()),
|
||||
assertEquals(FileUtils.FILE_TIMESTAMP_FORMAT.format(loc.getTime()),
|
||||
getChildTextValue(tag, "Time"));
|
||||
assertEquals(Double.toString(loc.getAltitude()),
|
||||
getChildTextValue(tag, "AltitudeMeters"));
|
||||
|
||||
@@ -214,7 +214,7 @@ public class TrackWriterTest extends AndroidTestCase {
|
||||
mocksControl.verify();
|
||||
|
||||
assertFalse(writer.wasSuccess());
|
||||
assertEquals(R.string.export_canceled, writer.getErrorMessage());
|
||||
assertEquals(R.string.sd_card_canceled, writer.getErrorMessage());
|
||||
}
|
||||
|
||||
public void testWriteTrack_openFails() {
|
||||
|
||||
+4
-3
@@ -41,11 +41,12 @@ public class TrackPathPainterFactoryTest extends TrackPathPainterTestCase {
|
||||
}
|
||||
|
||||
Context context = getContext();
|
||||
SharedPreferences prefs = context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
SharedPreferences prefs = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
if (prefs == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
testTrackPathPainterFactorySpecific(context, prefs, R.string.display_track_color_value_none,
|
||||
SingleColorTrackPathPainter.class);
|
||||
testTrackPathPainterFactorySpecific(context, prefs, R.string.display_track_color_value_fixed,
|
||||
@@ -57,7 +58,7 @@ public class TrackPathPainterFactoryTest extends TrackPathPainterTestCase {
|
||||
private <T> void testTrackPathPainterFactorySpecific(Context context, SharedPreferences prefs,
|
||||
int track_color_mode, Class <?> c) {
|
||||
prefs.edit().putString(context.getString(R.string.track_color_mode_key),
|
||||
context.getString(track_color_mode)).commit();
|
||||
context.getString(track_color_mode)).apply();
|
||||
|
||||
int startLocationIdx = 0;
|
||||
Boolean alwaysVisible = true;
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ package com.google.android.apps.mytracks.services;
|
||||
import android.content.Context;
|
||||
import android.test.AndroidTestCase;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -52,7 +52,7 @@ public class DefaultTrackNameFactoryTest extends AndroidTestCase {
|
||||
DefaultTrackNameFactory factory =
|
||||
new MockDefaultTrackNameFactory(getContext(), true);
|
||||
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
||||
assertEquals(formatter.format(new Date(TIMESTAMP)),
|
||||
factory.newTrackName(1, TIMESTAMP));
|
||||
}
|
||||
|
||||
+6
-7
@@ -151,17 +151,16 @@ public class TrackRecordingServiceTest
|
||||
|
||||
providerUtils = MyTracksProviderUtils.Factory.get(context);
|
||||
|
||||
sharedPreferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
sharedPreferences = context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
// Let's use default values.
|
||||
sharedPreferences.edit().clear().commit();
|
||||
sharedPreferences.edit().clear().apply();
|
||||
|
||||
// Disable auto resume by default.
|
||||
updateAutoResumePrefs(0, -1);
|
||||
// No recording track.
|
||||
Editor editor = sharedPreferences.edit();
|
||||
editor.putLong(context.getString(R.string.recording_track_key), -1);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@@ -654,7 +653,7 @@ public class TrackRecordingServiceTest
|
||||
R.string.auto_resume_track_current_retry_key), attempts);
|
||||
editor.putInt(context.getString(
|
||||
R.string.auto_resume_track_timeout_key), timeoutMins);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
private Intent createStartIntent() {
|
||||
@@ -673,7 +672,7 @@ public class TrackRecordingServiceTest
|
||||
private void setRecordingTrack(long id) {
|
||||
Editor editor = sharedPreferences.edit();
|
||||
editor.putLong(context.getString(R.string.recording_track_key), id);
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
// TODO: We support multiple values for readability, however this test's
|
||||
@@ -697,7 +696,7 @@ public class TrackRecordingServiceTest
|
||||
} else if (value == null) {
|
||||
// Do nothing, as clear above has already removed this property.
|
||||
}
|
||||
editor.commit();
|
||||
editor.apply();
|
||||
|
||||
fullRecordingSession();
|
||||
}
|
||||
|
||||
+6
-5
@@ -2,9 +2,10 @@ package com.google.android.apps.mytracks.services.sensors;
|
||||
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.services.sensors.ant.AntDirectSensorManager;
|
||||
import com.google.android.apps.mytracks.services.sensors.ant.AntSRMSensorManager;
|
||||
import com.google.android.apps.mytracks.services.sensors.ant.AntSrmBridgeSensorManager;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.test.AndroidTestCase;
|
||||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
@@ -18,9 +19,9 @@ public class SensorManagerFactoryTest extends AndroidTestCase {
|
||||
super.setUp();
|
||||
|
||||
sharedPreferences = getContext().getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
// Let's use default values.
|
||||
sharedPreferences.edit().clear().commit();
|
||||
sharedPreferences.edit().clear().apply();
|
||||
}
|
||||
|
||||
@SmallTest
|
||||
@@ -40,14 +41,14 @@ public class SensorManagerFactoryTest extends AndroidTestCase {
|
||||
|
||||
@SmallTest
|
||||
public void testCreateAntSRM() throws Exception {
|
||||
assertClassForName(AntSRMSensorManager.class, R.string.sensor_type_value_srm_ant_bridge);
|
||||
assertClassForName(AntSrmBridgeSensorManager.class, R.string.sensor_type_value_srm_ant_bridge);
|
||||
}
|
||||
|
||||
private void assertClassForName(Class<?> c, int i) {
|
||||
sharedPreferences.edit()
|
||||
.putString(getContext().getString(R.string.sensor_type_key),
|
||||
getContext().getString(i))
|
||||
.commit();
|
||||
.apply();
|
||||
SensorManager sm = SensorManagerFactory.getSensorManager(getContext());
|
||||
assertNotNull(sm);
|
||||
assertTrue(c.isInstance(sm));
|
||||
|
||||
+3
-3
@@ -18,9 +18,9 @@ package com.google.android.apps.mytracks.services.sensors.ant;
|
||||
import com.dsi.ant.AntMesg;
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.content.Sensor;
|
||||
import com.google.android.apps.mytracks.services.sensors.ant.AntDirectSensorManager;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.test.AndroidTestCase;
|
||||
import android.test.suitebuilder.annotation.SmallTest;
|
||||
@@ -32,9 +32,9 @@ public class AntDirectSensorManagerTest extends AndroidTestCase {
|
||||
|
||||
public void setUp() {
|
||||
sharedPreferences = getContext().getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, 0);
|
||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
// Let's use default values.
|
||||
sharedPreferences.edit().clear().commit();
|
||||
sharedPreferences.edit().clear().apply();
|
||||
manager = new AntDirectSensorManager(getContext());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user