aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2010-12-03 02:36:59 +0100
committerHerbert von Broeuschmeul <Herbert.Broeuschmeul@gmail.com>2010-12-03 02:36:59 +0100
commitf223acbfd9d2e832211f65cad82a69c64b31c346 (patch)
treef0e1a9b7cacc04b055aa7a3bc37ea60929339ea7
parent209c8bd571998d3d1639c56c5ad02fba0b6f9fe5 (diff)
parent173e2bd256382e33de5ece287a1ec5667196a2e4 (diff)
downloadBlueGPS-f223acbfd9d2e832211f65cad82a69c64b31c346.zip
BlueGPS-f223acbfd9d2e832211f65cad82a69c64b31c346.tar.gz
BlueGPS-f223acbfd9d2e832211f65cad82a69c64b31c346.tar.bz2
Merge branch 'dev_1.1.x' into dev_1.2.x
-rw-r--r--res/drawable/gplv3_icon.pngbin0 -> 2986 bytes
-rw-r--r--res/layout/about.xml85
-rw-r--r--res/values-fr/strings.xml16
-rw-r--r--res/values/about_style.xml29
-rw-r--r--res/values/constants.xml1
-rw-r--r--res/values/strings.xml16
-rw-r--r--res/xml/pref.xml7
-rw-r--r--src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java44
-rw-r--r--src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsProviderService.java1
9 files changed, 196 insertions, 3 deletions
diff --git a/res/drawable/gplv3_icon.png b/res/drawable/gplv3_icon.png
new file mode 100644
index 0000000..b06e043
--- /dev/null
+++ b/res/drawable/gplv3_icon.png
Binary files differ
diff --git a/res/layout/about.xml b/res/layout/about.xml
new file mode 100644
index 0000000..b5b872d
--- /dev/null
+++ b/res/layout/about.xml
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2010 Herbert von Broeuschmeul
+ Copyright (C) 2010 BluetoothGPS4Droid Project
+
+ This file is part of BluetoothGPS4Droid.
+
+ BluetoothGPS4Droid is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ BluetoothGPS4Droid is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with BluetoothGPS4Droid. If not, see : http://www.gnu.org/licenses/.
+-->
+<ScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+ >
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ >
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ style="@style/about_text"
+ android:text="@string/about_version"
+ />
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ style="@style/about_text"
+ android:text="@string/versionName"
+ />
+ </LinearLayout>
+<!--
+ <TextView
+ style="@style/about_text"
+ android:text="@string/about_copyright_1"
+ />
+ <TextView
+ style="@style/about_text"
+ android:text="@string/about_copyright_2"
+ />
+-->
+ <TextView
+ style="@style/about_text"
+ android:text="@string/about_app_desc"
+ />
+ <TextView
+ android:id="@+id/about_license"
+ style="@style/about_text"
+ android:text="@string/about_license"
+ android:autoLink="none"
+ />
+ <TextView
+ android:id="@+id/about_sources"
+ style="@style/about_text"
+ android:text="@string/about_sources"
+ /><!--
+ <TextView
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="16sp"
+ android:textSize="16sp"
+ android:textColor="?android:attr/textColorPrimary"
+ android:autoLink="web"
+ android:text="@string/about"
+ />
+ -->
+ </LinearLayout>
+</ScrollView> \ No newline at end of file
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index fd0a090..9b8ab51 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -44,6 +44,8 @@
<string name="pref_trackfile_directory_summary">Indiquer un répertoire pour les fichiers de traces</string>
<string name="pref_bluetooth_device_title">Sélection du GPS</string>
<string name="pref_bluetooth_device_summary">"Périphérique actuel : %s"</string>
+ <string name="pref_about_title">À propos</string>
+ <string name="pref_about_summary"></string>
<string name="pref_sirf_gps_title">GPS SiRF</string>
<string name="pref_sirf_gps_summary_off">"Ne pas utiliser les paramètres SiRF"</string>
@@ -104,4 +106,18 @@
</plurals>
<string name="service_closed_because_connection_problem_notification_title">BlueGps arrêté</string>
<string name="service_closed_because_connection_problem_notification">"Motif : %s"</string>
+
+ <string name="about_title">À propos</string>
+ <string name="about_version">BluetoothGPS4Droid version</string>
+ <string name="about_copyright_1">Copyright (C) 2010 Herbert von Broeuschmeul</string>
+ <string name="about_copyright_2">Copyright (C) 2010 BluetoothGPS4Droid Project</string>
+ <string name="about_app_desc">Bluetooth GPS for Android est une application
+ qui permet d\'utiliser un GPS bluetooth externe avec un terminal Android.
+ </string>
+ <string name="about_license">Il s\'agit d\'un logiciel libre
+ distribué gratuitement et régi par la <a href="http://www.gnu.org/licenses/gpl-3.0-standalone.html"><b>Licence publique générale de GNU</b></a>.
+ </string>
+ <string name="about_sources">Le code source est librement téléchargeable à partir du dépot Git sur le site web du projet :
+ http://sourceforge.net/p/bluegps4droid
+ </string>
</resources>
diff --git a/res/values/about_style.xml b/res/values/about_style.xml
new file mode 100644
index 0000000..1555525
--- /dev/null
+++ b/res/values/about_style.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2010 Herbert von Broeuschmeul
+ Copyright (C) 2010 BluetoothGPS4Droid Project
+
+ This file is part of BluetoothGPS4Droid.
+
+ BluetoothGPS4Droid is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ BluetoothGPS4Droid is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with BluetoothGPS4Droid. If not, see : http://www.gnu.org/licenses/.
+-->
+<resources xmlns:android="http://schemas.android.com/apk/res/android" >
+ <style name="about_text" >
+ <item name="android:layout_width">fill_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:padding">4sp</item>
+ <item name="android:textAppearance">?android:attr/textAppearance</item>
+ <item name="android:autoLink">web</item>
+ </style>
+</resources>
diff --git a/res/values/constants.xml b/res/values/constants.xml
index a67e978..992fb83 100644
--- a/res/values/constants.xml
+++ b/res/values/constants.xml
@@ -30,6 +30,7 @@
<string name="pref_trackfile_directory_key">trackFileDirectory</string>
<string name="pref_trackfile_prefix_key">trackFilePrefix</string>
<string name="pref_bluetooth_device_key">bluetoothDevice</string>
+ <string name="pref_about_key">about</string>
<string name="pref_sirf_gps_key">sirfGps</string>
<string name="pref_sirf_enable_gga_key">enableGGA</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 197b4c7..b9c4335 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -47,6 +47,8 @@
<string name="pref_trackfile_directory_summary">Select the directory for the track files</string>
<string name="pref_bluetooth_device_title">Choose Bluetooth GPS</string>
<string name="pref_bluetooth_device_summary">"Current device: %s"</string>
+ <string name="pref_about_title">About</string>
+ <string name="pref_about_summary"></string>
<string name="pref_sirf_gps_title">SiRF GPS</string>
<string name="pref_sirf_gps_summary_off">"Use SiRF Options"</string>
@@ -107,4 +109,18 @@
</plurals>
<string name="service_closed_because_connection_problem_notification_title">BlueGps stopped</string>
<string name="service_closed_because_connection_problem_notification">"Reason: %s"</string>
+
+ <string name="about_title">About</string>
+ <string name="about_version">BluetoothGPS4Droid version</string>
+ <string name="about_copyright_1">Copyright (C) 2010 Herbert von Broeuschmeul</string>
+ <string name="about_copyright_2">Copyright (C) 2010 BluetoothGPS4Droid Project</string>
+ <string name="about_app_desc">Bluetooth GPS for Android is an application
+ for using an external bluetooth GPS on Android devices.
+ </string>
+ <string name="about_license">It is open source software
+ distributed free of charge under the terms of the <a href="http://www.gnu.org/licenses/gpl-3.0-standalone.html"><b>GNU General Public License</b></a>.
+ </string>
+ <string name="about_sources">The source code is available from Git repository on the project website:
+ http://sourceforge.net/p/bluegps4droid
+ </string>
</resources>
diff --git a/res/xml/pref.xml b/res/xml/pref.xml
index da66b50..948e0c2 100644
--- a/res/xml/pref.xml
+++ b/res/xml/pref.xml
@@ -20,7 +20,7 @@
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
- android:title="@string/app_name">
+ android:title="@string/app_name" >
<ListPreference
android:dialogTitle="@string/pref_bluetooth_device_title"
android:title="@string/pref_bluetooth_device_title"
@@ -171,4 +171,9 @@
android:defaultValue="@string/defaultTrackFilePrefix"
android:summary="@string/pref_trackfile_prefix_summary" />
</PreferenceScreen>
+ <Preference
+ android:key="@string/pref_about_key"
+ android:persistent="false"
+ android:title="@string/pref_about_title"
+ android:summary="@string/pref_about_summary" />
</PreferenceScreen>
diff --git a/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java b/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
index ad35864..0551913 100644
--- a/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
+++ b/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsActivity.java
@@ -20,8 +20,10 @@
package org.broeuschmeul.android.gps.bluetooth.provider;
+import java.util.HashSet;
import java.util.Set;
+import android.app.AlertDialog;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
@@ -34,7 +36,10 @@ import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.preference.Preference.OnPreferenceChangeListener;
+import android.text.method.LinkMovementMethod;
import android.util.Log;
+import android.view.View;
+import android.widget.TextView;
/**
* A PreferenceActivity Class used to configure, start and stop the NMEA tracker service.
@@ -58,6 +63,14 @@ public class BluetoothGpsActivity extends PreferenceActivity implements OnPrefer
sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
sharedPref.registerOnSharedPreferenceChangeListener(this);
bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
+ Preference pref = findPreference(BluetoothGpsProviderService.PREF_ABOUT);
+ pref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ BluetoothGpsActivity.this.displayAboutDialog();
+ return true;
+ }
+ });
}
/* (non-Javadoc)
@@ -85,7 +98,10 @@ public class BluetoothGpsActivity extends PreferenceActivity implements OnPrefer
updateDevicePreferenceSummary();
// update bluetooth device list
ListPreference prefDevices = (ListPreference)findPreference(BluetoothGpsProviderService.PREF_BLUETOOTH_DEVICE);
- Set<BluetoothDevice> pairedDevices = bluetoothAdapter.getBondedDevices();
+ Set<BluetoothDevice> pairedDevices = new HashSet<BluetoothDevice>();
+ if (bluetoothAdapter != null){
+ pairedDevices = bluetoothAdapter.getBondedDevices();
+ }
String[] entryValues = new String[pairedDevices.size()];
String[] entries = new String[pairedDevices.size()];
int i = 0;
@@ -118,7 +134,7 @@ public class BluetoothGpsActivity extends PreferenceActivity implements OnPrefer
pref.setSummary(s);
Log.v(LOG_TAG, "loc. provider: "+s);
Log.v(LOG_TAG, "loc. provider: "+pref.getSummary());
- }
+ }
this.onContentChanged();
}
@@ -127,6 +143,30 @@ public class BluetoothGpsActivity extends PreferenceActivity implements OnPrefer
super.onDestroy();
sharedPref.unregisterOnSharedPreferenceChangeListener(this);
}
+
+ private void displayAboutDialog(){
+ View messageView = getLayoutInflater().inflate(R.layout.about, null, false);
+ // we need this to enable html links
+ TextView textView = (TextView) messageView.findViewById(R.id.about_license);
+ textView.setMovementMethod(LinkMovementMethod.getInstance());
+ // When linking text, force to always use default color. This works
+ // around a pressed color state bug.
+ int defaultColor = textView.getTextColors().getDefaultColor();
+ textView.setTextColor(defaultColor);
+ textView = (TextView) messageView.findViewById(R.id.about_sources);
+ textView.setTextColor(defaultColor);
+
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle(R.string.about_title);
+ builder.setIcon(R.drawable.gplv3_icon);
+ builder.setView(messageView);
+
+
+// CharSequence styledText = Html.fromHtml(getString(R.string.about));
+// builder.setMessage(R.string.about);
+// builder.setMessage(styledText);
+ builder.show();
+ }
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
diff --git a/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsProviderService.java b/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsProviderService.java
index c772e94..a2f1c8d 100644
--- a/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsProviderService.java
+++ b/src/org/broeuschmeul/android/gps/bluetooth/provider/BluetoothGpsProviderService.java
@@ -70,6 +70,7 @@ public class BluetoothGpsProviderService extends Service implements NmeaListener
public static final String PREF_TRACK_FILE_DIR = "trackFileDirectory";
public static final String PREF_TRACK_FILE_PREFIX = "trackFilePrefix";
public static final String PREF_BLUETOOTH_DEVICE = "bluetoothDevice";
+ public static final String PREF_ABOUT = "about";
private static final String LOG_TAG = "BlueGPS";
// private static final String LOG_TAG = BluetoothGpsProviderService.class.getSimpleName();