From ce7543bef301f2a622023b2633166409de93d09e Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 1 Feb 2012 20:12:27 +0000 Subject: Fixes in AboutActivity, and some string stuff. --- AndroidManifest.xml | 2 ++ gen/net/cbaines/suma/R.java | Bin 10843 -> 10891 bytes res/raw/ormlite_config.txt | 2 +- res/values/strings.xml | 2 +- src/net/cbaines/suma/AboutActivity.java | 62 +++++++++++++++++--------------- src/net/cbaines/suma/DataHandler.java | 2 +- 6 files changed, 39 insertions(+), 31 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 69eb2fd..4fd68e4 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -31,6 +31,8 @@ + + diff --git a/gen/net/cbaines/suma/R.java b/gen/net/cbaines/suma/R.java index 8b15d5f..9f05f48 100644 Binary files a/gen/net/cbaines/suma/R.java and b/gen/net/cbaines/suma/R.java differ diff --git a/res/raw/ormlite_config.txt b/res/raw/ormlite_config.txt index 4cd38cd..60f9ade 100644 --- a/res/raw/ormlite_config.txt +++ b/res/raw/ormlite_config.txt @@ -1,3 +1,3 @@ # -# generated on 2012/01/31 05:34:59 +# generated on 2012/02/01 07:59:58 # diff --git a/res/values/strings.xml b/res/values/strings.xml index 948c10e..a53109b 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -104,7 +104,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.< Live Bus Data Provided under the Open Government License by the Southampton City Council ROMANSE office through the University of Southampton Open Data Service. Android Market App Page - insert link + market://details?id=net.cbaines.suma Map Data From the OpenStreetMap project, exported and used from the University of Southampton Open Data Service. Map Icons diff --git a/src/net/cbaines/suma/AboutActivity.java b/src/net/cbaines/suma/AboutActivity.java index 70e9ebf..a455d70 100644 --- a/src/net/cbaines/suma/AboutActivity.java +++ b/src/net/cbaines/suma/AboutActivity.java @@ -26,6 +26,7 @@ import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceActivity; import android.preference.PreferenceScreen; +import android.util.Log; public class AboutActivity extends PreferenceActivity { @@ -43,6 +44,8 @@ public class AboutActivity extends PreferenceActivity { private static final String KEY_ABOUT_DATABASE = "about_database"; private static final String KEY_ABOUT_DONATE = "about_donate"; + private static final String TAG = "AboutActivity"; + public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -51,35 +54,38 @@ public class AboutActivity extends PreferenceActivity { @Override public boolean onPreferenceTreeClick(final PreferenceScreen preferenceScreen, final Preference preference) { - final String key = preference.getKey(); - if (KEY_ABOUT_LICENSE.equals(key)) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.gnu.org/licenses/gpl-2.0.html"))); - } else if (KEY_ABOUT_PROJECT.equals(key)) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/cbaines/SouthamptonUniversityMap"))); - } else if (KEY_ABOUT_DEVELOPER.equals(key)) { - Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); - emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { "cbaines8@gmail.com" }); - emailIntent.setType("text/plain"); - - startActivity(Intent.createChooser(emailIntent, "Email the developer")); - } else if (KEY_ABOUT_DATA.equals(key)) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://data.southampton.ac.uk/bus-routes.html"))); - } else if (KEY_ABOUT_ANDROID_MARKET.equals(key)) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://market.android.com/details?id=net.cbaines.suma"))); - } else if (KEY_ABOUT_MAP_DATA.equals(key)) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("http://data.southampton.ac.uk/places.html")))); - } else if (KEY_ABOUT_MAP_ICONS.equals(key)) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://mapicons.nicolasmollet.com/"))); - } else if (KEY_ABOUT_OSM_MAP.equals(key)) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.openstreetmap.org/"))); - } else if (KEY_ABOUT_MAP_TILES.equals(key)) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.mapquest.com/"))); - } else if (KEY_ABOUT_DATABASE.equals(key)) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("http://ormlite.com/")))); - } else if (KEY_ABOUT_DONATE.equals(key)) { - showDialog(DONATE_DIALOG_ID); - } + try { + final String key = preference.getKey(); + if (KEY_ABOUT_LICENSE.equals(key)) { + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.gnu.org/licenses/gpl-2.0.html"))); + } else if (KEY_ABOUT_PROJECT.equals(key)) { + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/cbaines/SouthamptonUniversityMap"))); + } else if (KEY_ABOUT_DEVELOPER.equals(key)) { + Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); + emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { "cbaines8@gmail.com" }); + emailIntent.setType("text/plain"); + startActivity(Intent.createChooser(emailIntent, "Email the developer")); + } else if (KEY_ABOUT_DATA.equals(key)) { + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://data.southampton.ac.uk/bus-routes.html"))); + } else if (KEY_ABOUT_ANDROID_MARKET.equals(key)) { + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=net.cbaines.suma"))); + } else if (KEY_ABOUT_MAP_DATA.equals(key)) { + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("http://data.southampton.ac.uk/places.html")))); + } else if (KEY_ABOUT_MAP_ICONS.equals(key)) { + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://mapicons.nicolasmollet.com/"))); + } else if (KEY_ABOUT_OSM_MAP.equals(key)) { + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.openstreetmap.org/"))); + } else if (KEY_ABOUT_MAP_TILES.equals(key)) { + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.mapquest.com/"))); + } else if (KEY_ABOUT_DATABASE.equals(key)) { + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("http://ormlite.com/")))); + } else if (KEY_ABOUT_DONATE.equals(key)) { + showDialog(DONATE_DIALOG_ID); + } + } catch (Exception e) { + Log.e("Error opening one of the icons", TAG, e); + } return false; } diff --git a/src/net/cbaines/suma/DataHandler.java b/src/net/cbaines/suma/DataHandler.java index f6263da..f564d19 100644 --- a/src/net/cbaines/suma/DataHandler.java +++ b/src/net/cbaines/suma/DataHandler.java @@ -81,7 +81,7 @@ public class DataHandler extends DefaultHandler { @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { if (localName.equals("trkpt")) { - Log.v("DataHandler", "Adding point to route overlay " + atts.getValue("lat") + " " + atts.getValue("lon")); + // Log.v("DataHandler", "Adding point to route overlay " + atts.getValue("lat") + " " + atts.getValue("lon")); _data.addPoint(Util.csLatLongToGeoPoint(atts.getValue("lat"), atts.getValue("lon"))); } } -- cgit v1.2.3