From 00a703025eb1764c53930524e92fdc93d33f3f5a Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Mon, 2 Sep 2013 09:49:31 +0200 Subject: [PATCH 1/7] start gmaps directly in nav-mode. this way we get a labeled marker with locales using decimal comma separator too (thanks joerg wagner) --- .../iitc_mobile/share/ShareActivity.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java b/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java index 756d6b64..1bcf0b1f 100644 --- a/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java +++ b/mobile/src/com/cradle/iitc_mobile/share/ShareActivity.java @@ -79,19 +79,13 @@ public class ShareActivity extends FragmentActivity implements ActionBar.TabList // we merge gmaps intents with geo intents since it is not possible // anymore to set a labeled marker on geo intents ArrayList intents = new ArrayList(); - DecimalFormatSymbols decFormat = new DecimalFormatSymbols(); - // thx to gmaps, this only works for the decimal point separator String gMapsUri; - if (decFormat.getDecimalSeparator() == '.') - try { - gMapsUri = "http://maps.google.com/maps?q=loc:" + mLl + - "%20(" + URLEncoder.encode(mTitle, "UTF-8") + ")&z=" + mZoom; - } catch (UnsupportedEncodingException e) { - gMapsUri = "http://maps.google.com/maps?ll=" + mLl + "&z=" + mZoom; - e.printStackTrace(); - } - else - gMapsUri = "http://maps.google.com/maps?ll=" + mLl + "&z=" + mZoom; + try { + gMapsUri = "http://maps.google.com/?daddr=" + mLl + "%20(" + URLEncoder.encode(mTitle, "UTF-8") + ")"; + } catch (UnsupportedEncodingException e) { + gMapsUri = "http://maps.google.com/?daddr=" + mLl; + e.printStackTrace(); + } Intent gMapsIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(gMapsUri)); intents.add(gMapsIntent); String geoUri = "geo:" + mLl; From 0e3d82b4bfbc5293ce3b550e81bbdb1d505a46fe Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Mon, 2 Sep 2013 09:51:40 +0200 Subject: [PATCH 2/7] bumped version number on mobile --- mobile/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml index 57c7693b..1ae9ff11 100644 --- a/mobile/AndroidManifest.xml +++ b/mobile/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="41" + android:versionName="0.5.7"> Date: Mon, 2 Sep 2013 21:13:10 +0200 Subject: [PATCH 3/7] add licence and g+ links to about dialog --- mobile/res/values/strings.xml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/mobile/res/values/strings.xml b/mobile/res/values/strings.xml index a4693bcc..4fc12a40 100644 --- a/mobile/res/values/strings.xml +++ b/mobile/res/values/strings.xml @@ -24,10 +24,30 @@ Ingress Intel Total Conversion (IITC) userscript by breunigs. After Niantic asked the main developer to shut down his github project, development is continued on a fork of jonatkins.

- Website:
- http://iitc.jonatkins.com/

- IITC on Github:
- https://github.com/jonatkins/ingress-intel-total-conversion]]> + Community:
+ • Visit the IITC website for new releases and the desktop version.
+ • Follow the IITC Google+ page + for release announcements.
+ • Join the IITC Google+ community + - a place to ask for help and discuss with other users.

+ Developers:
+ IITC on Github

+ Licence:
+ Copyright © 2013 Stefan Breunig, Philipp Schäfer, Jon Atkins and others

+ + Permission to use, copy, modify, and/or distribute this software for + any purpose with or without fee is hereby granted, provided that the + above copyright notice and this permission notice appear in all + copies.

+ + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL + WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA + OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE.]]> UI From fe632b5cccbfb44e310119106cf0930f56ebd46a Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Mon, 2 Sep 2013 21:27:16 +0200 Subject: [PATCH 4/7] added method to get versionCode of mobile app to JSInterface --- mobile/plugins/user-location.user.js | 2 ++ .../com/cradle/iitc_mobile/IITC_JSInterface.java | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/mobile/plugins/user-location.user.js b/mobile/plugins/user-location.user.js index 4dbd30ba..51789e8a 100644 --- a/mobile/plugins/user-location.user.js +++ b/mobile/plugins/user-location.user.js @@ -47,6 +47,8 @@ window.plugin.userLocation.setup = function() { window.plugin.userLocation.updateLocation = function(lat, lng) { var latlng = new L.LatLng(lat, lng); + var foo = android.getVersionCode(); + window.console.log('version code: ' + foo); window.plugin.userLocation.marker.setLatLng(latlng); } diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java b/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java index 330d7955..908ad25f 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_JSInterface.java @@ -13,6 +13,8 @@ import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface.OnMultiChoiceClickListener; import android.content.Intent; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; import android.util.Log; import android.view.View; import android.webkit.JavascriptInterface; @@ -79,6 +81,19 @@ public class IITC_JSInterface { .show(); } + @JavascriptInterface + public int getVersionCode() { + int versionCode = 0; + try { + PackageInfo pInfo = mContext.getPackageManager() + .getPackageInfo(mContext.getPackageName(), 0); + versionCode = pInfo.versionCode; + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + return versionCode; + } + @JavascriptInterface public void switchToPane(String id) { From 896803bf68fed926718dc9c3214b2d18916ae0f1 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Mon, 2 Sep 2013 21:29:51 +0200 Subject: [PATCH 5/7] removed test code --- mobile/plugins/user-location.user.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/mobile/plugins/user-location.user.js b/mobile/plugins/user-location.user.js index 51789e8a..4dbd30ba 100644 --- a/mobile/plugins/user-location.user.js +++ b/mobile/plugins/user-location.user.js @@ -47,8 +47,6 @@ window.plugin.userLocation.setup = function() { window.plugin.userLocation.updateLocation = function(lat, lng) { var latlng = new L.LatLng(lat, lng); - var foo = android.getVersionCode(); - window.console.log('version code: ' + foo); window.plugin.userLocation.marker.setLatLng(latlng); } From c262a2e1d6b8a1d29cd259c0756b6588c10a6abf Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Mon, 2 Sep 2013 21:41:43 +0200 Subject: [PATCH 6/7] multiple authors in licence message --- website/page/about.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/page/about.php b/website/page/about.php index 7c06c41f..25f54b1b 100644 --- a/website/page/about.php +++ b/website/page/about.php @@ -31,10 +31,10 @@ any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE -AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +AUTHORS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR From c5dfef083022406e078dc88f0c52605dca638b07 Mon Sep 17 00:00:00 2001 From: Philipp Schaefer Date: Mon, 2 Sep 2013 21:50:43 +0200 Subject: [PATCH 7/7] don't try to draw location while iitc boots --- mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java index 8a624ca5..f086d8fd 100644 --- a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java +++ b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java @@ -475,7 +475,7 @@ public class IITC_Mobile extends Activity { if (!mIsLocEnabled) { mIitcWebView.loadUrl("javascript: " + "window.map.locate({setView : true, maxZoom: 15});"); - // if gps location is displayed we can use a better location without any costs + // if gps location is displayed we can use a better location without any costs } else { if (mLastLocation != null) mIitcWebView.loadUrl("javascript: window.map.setView(new L.LatLng(" + @@ -554,9 +554,12 @@ public class IITC_Mobile extends Activity { // throw away all positions with accuracy > 100 meters // should avoid gps glitches if (loc.getAccuracy() < 100) { - mIitcWebView.loadUrl("javascript: " - + "window.plugin.userLocation.updateLocation( " - + loc.getLatitude() + ", " + loc.getLongitude() + ");"); + // do not touch the javascript while iitc boots + if (findViewById(R.id.imageLoading).getVisibility() == View.GONE) { + mIitcWebView.loadUrl("javascript: " + + "window.plugin.userLocation.updateLocation( " + + loc.getLatitude() + ", " + loc.getLongitude() + ");"); + } } }