diff --git a/mobile/.gitignore b/mobile/.gitignore
new file mode 100644
index 00000000..c6e43131
--- /dev/null
+++ b/mobile/.gitignore
@@ -0,0 +1,9 @@
+.classpath
+.project
+.settings/
+assets/
+bin/
+gen/
+libs/
+proguard-project.txt
+local.properties
diff --git a/mobile/AndroidManifest.xml b/mobile/AndroidManifest.xml
new file mode 100644
index 00000000..c4c68282
--- /dev/null
+++ b/mobile/AndroidManifest.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mobile/IngressIntelTC/.classpath b/mobile/IngressIntelTC/.classpath
deleted file mode 100644
index a4f1e405..00000000
--- a/mobile/IngressIntelTC/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/mobile/IngressIntelTC/.project b/mobile/IngressIntelTC/.project
deleted file mode 100644
index 25a5ec79..00000000
--- a/mobile/IngressIntelTC/.project
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
- AppTemplate
-
-
-
-
-
- com.android.ide.eclipse.adt.ResourceManagerBuilder
-
-
-
-
- com.android.ide.eclipse.adt.PreCompilerBuilder
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
- com.android.ide.eclipse.adt.ApkBuilder
-
-
-
-
-
- com.android.ide.eclipse.adt.AndroidNature
- org.eclipse.jdt.core.javanature
-
-
diff --git a/mobile/IngressIntelTC/AndroidManifest.xml b/mobile/IngressIntelTC/AndroidManifest.xml
deleted file mode 100644
index dbf96330..00000000
--- a/mobile/IngressIntelTC/AndroidManifest.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/mobile/IngressIntelTC/assets/js/ingressSplash.html b/mobile/IngressIntelTC/assets/js/ingressSplash.html
deleted file mode 100644
index 49960e18..00000000
--- a/mobile/IngressIntelTC/assets/js/ingressSplash.html
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
- Ingress Intel Total Converion - Mobile & Tablet
-
-
-
-
- Ingress Intel Total Conversion
-
loading...
-
- Disclaimer: Ingress Intel Total Conversion is in no way affiliated with, connected to, or sanctioned by Ingress, Google or Niantic.
- Full source for Ingress Intel Total Conversion can be found @
https://github.com/breunigs/ingress-intel-total-conversion
- Source for this wrapper app available soon.
-
-
-
-
diff --git a/mobile/IngressIntelTC/gen/com/jakbox/ingressTC/BuildConfig.java b/mobile/IngressIntelTC/gen/com/jakbox/ingressTC/BuildConfig.java
deleted file mode 100644
index c53b896c..00000000
--- a/mobile/IngressIntelTC/gen/com/jakbox/ingressTC/BuildConfig.java
+++ /dev/null
@@ -1,6 +0,0 @@
-/** Automatically generated file. DO NOT MODIFY */
-package com.jakbox.ingressTC;
-
-public final class BuildConfig {
- public final static boolean DEBUG = true;
-}
\ No newline at end of file
diff --git a/mobile/IngressIntelTC/gen/com/jakbox/ingressTC/R.java b/mobile/IngressIntelTC/gen/com/jakbox/ingressTC/R.java
deleted file mode 100644
index 162c7876..00000000
--- a/mobile/IngressIntelTC/gen/com/jakbox/ingressTC/R.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/* AUTO-GENERATED FILE. DO NOT MODIFY.
- *
- * This class was automatically generated by the
- * aapt tool from the resource data it found. It
- * should not be modified by hand.
- */
-
-package com.jakbox.ingressTC;
-
-public final class R {
- public static final class attr {
- }
- public static final class drawable {
- public static final int ic_launcher=0x7f020000;
- }
- public static final class layout {
- public static final int main=0x7f030000;
- }
- public static final class raw {
- public static final int loader=0x7f040000;
- }
- public static final class string {
- public static final int app_name=0x7f050000;
- public static final int first_page=0x7f050001;
- public static final int jakboxBootLoader=0x7f050002;
- }
-}
diff --git a/mobile/IngressIntelTC/proguard.cfg b/mobile/IngressIntelTC/proguard.cfg
deleted file mode 100644
index b1cdf17b..00000000
--- a/mobile/IngressIntelTC/proguard.cfg
+++ /dev/null
@@ -1,40 +0,0 @@
--optimizationpasses 5
--dontusemixedcaseclassnames
--dontskipnonpubliclibraryclasses
--dontpreverify
--verbose
--optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgentHelper
--keep public class * extends android.preference.Preference
--keep public class com.android.vending.licensing.ILicensingService
-
--keepclasseswithmembernames class * {
- native ;
-}
-
--keepclasseswithmembers class * {
- public (android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembers class * {
- public (android.content.Context, android.util.AttributeSet, int);
-}
-
--keepclassmembers class * extends android.app.Activity {
- public void *(android.view.View);
-}
-
--keepclassmembers enum * {
- public static **[] values();
- public static ** valueOf(java.lang.String);
-}
-
--keep class * implements android.os.Parcelable {
- public static final android.os.Parcelable$Creator *;
-}
diff --git a/mobile/IngressIntelTC/res/drawable-hdpi/ic_launcher.png b/mobile/IngressIntelTC/res/drawable-hdpi/ic_launcher.png
deleted file mode 100644
index 55c83277..00000000
Binary files a/mobile/IngressIntelTC/res/drawable-hdpi/ic_launcher.png and /dev/null differ
diff --git a/mobile/IngressIntelTC/res/drawable-ldpi/ic_launcher.png b/mobile/IngressIntelTC/res/drawable-ldpi/ic_launcher.png
deleted file mode 100644
index b06e1f85..00000000
Binary files a/mobile/IngressIntelTC/res/drawable-ldpi/ic_launcher.png and /dev/null differ
diff --git a/mobile/IngressIntelTC/res/drawable-mdpi/ic_launcher.png b/mobile/IngressIntelTC/res/drawable-mdpi/ic_launcher.png
deleted file mode 100644
index f9b7522d..00000000
Binary files a/mobile/IngressIntelTC/res/drawable-mdpi/ic_launcher.png and /dev/null differ
diff --git a/mobile/IngressIntelTC/res/layout/main.xml b/mobile/IngressIntelTC/res/layout/main.xml
deleted file mode 100644
index e33294fb..00000000
--- a/mobile/IngressIntelTC/res/layout/main.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
diff --git a/mobile/IngressIntelTC/res/raw/loader.js b/mobile/IngressIntelTC/res/raw/loader.js
deleted file mode 100644
index bcb336ca..00000000
--- a/mobile/IngressIntelTC/res/raw/loader.js
+++ /dev/null
@@ -1,13 +0,0 @@
-function rebuildUI() {
- if(window.UIDone == true) { return; }
- if(!document.getElementById("map_canvas")) {
- setTimeout(rebuildUI, 50);
- return;
- } else {
- window.UIDone = true;
- }
- window.console.log(window.deviceID);
- window.loadJS("http://mathphys.fsk.uni-heidelberg.de:8000/test.js")
- //window.Android.TCReady();
-}
-rebuildUI();
\ No newline at end of file
diff --git a/mobile/IngressIntelTC/res/values/strings.xml b/mobile/IngressIntelTC/res/values/strings.xml
deleted file mode 100644
index cd948842..00000000
--- a/mobile/IngressIntelTC/res/values/strings.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- Ingress Intel Total Conversion
- Connecting to Ingress Intel Map ...
-
- bootLoader = function() {
- if(document.getElementById(\"map_canvas\")) {
- window.stop();
- document.body.innerHTML = "";
- } else {
- setTimeout(bootLoader, 50);
- }
- };
- setTimeout(bootLoader, 5);
-
-
-
diff --git a/mobile/IngressIntelTC/src/com/jakbox/ingressTC/MainActivity.java b/mobile/IngressIntelTC/src/com/jakbox/ingressTC/MainActivity.java
deleted file mode 100644
index e98f3404..00000000
--- a/mobile/IngressIntelTC/src/com/jakbox/ingressTC/MainActivity.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/********************************************************************************
- Ingress Intel Total Converion - Mobile & Tablet
- Android WebView wrapper/loader for iitc (ingress intel total conversion)
- iitc source @ https://github.com/breunigs/ingress-intel-total-conversion
-
- Original Author: Jason Grima - jason@jakbox.net
-*********************************************************************************/
-
-
-package com.jakbox.ingressTC;
-
-import android.app.*;
-import android.os.*;
-import android.content.Context;
-import android.view.*;
-import android.widget.*;
-import android.webkit.*;
-import android.provider.Settings.Secure;
-import android.util.Log;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.BufferedReader;
-import java.lang.StringBuffer;
-
-public class MainActivity extends Activity
-{
- WebView web; // webview to hold the ingress site (and login etc)
- WebView splash; // splash screen, just a bit of pretty
- MyChrome chrome; // for logging, progress, etc
- MyClient client; // for controlling the webview's
-
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- requestWindowFeature(Window.FEATURE_NO_TITLE); // hide the app title bar, Xeen requested
- super.onCreate(savedInstanceState);
-
- // little animated title/splash page for IngressIntelTC
- // separate webview so we can be loading stuff in the background
- JSInterface js = new JSInterface(this, this); //js.setActivity(this);
- this.splash = new WebView(this);
- splash.getSettings().setJavaScriptEnabled(true); // because we use JS to trigger the CSS animation
- splash.getSettings().setAllowFileAccess(true); // because the splash page is store in the apk
- splash.getSettings().setAllowFileAccessFromFileURLs(true); // in case we add more scripts/images to the splash page
- splash.loadUrl("file:///android_asset/js/ingressSplash.html"); // there is is!
- splash.addJavascriptInterface(js, "android");
- setContentView(splash);
- // righto, load the the website (ingress.com/intel) with a bunch of permissions that may/or not be needed
- this.web = new WebView(this);
- this.client = new MyClient();
- web.setWebViewClient(this.client);
- web.getSettings().setJavaScriptEnabled(true);
- web.getSettings().setGeolocationEnabled(true);
- web.getSettings().setAllowFileAccess(true);
- web.getSettings().setAllowFileAccessFromFileURLs(true);
- web.getSettings().setDatabaseEnabled(true);
- web.getSettings().setDomStorageEnabled(true);
- web.getSettings().setGeolocationEnabled(true);
-
- this.chrome = new MyChrome(); // the chrome let's us get console and progress feedback from the page
- web.setWebChromeClient(this.chrome);
- web.addJavascriptInterface(js, "android"); // ready to go
-
- }
-
- public void onRestoreInstanceState(Bundle state) {
- this.splash.restoreState(state);
- this.web.restoreState(state);
- }
- public void onSaveInstanceState(Bundle state) {
- this.splash.saveState(state);
- this.web.saveState(state);
- }
-
- public void showWeb() { setContentView(web); splash.destroy(); Log.d("com.jakbox.ingressTC", "Flipping to web/ingress view"); }
- public void showSplash() { setContentView(splash); web.destroy(); Log.d("com.jakbox.ingressTC", "Flipping to splash/loading"); }
-
- final class JSInterface {
- Context context; MainActivity act;
- public JSInterface (Context c, MainActivity a) { this.context = c; this.act = a; }
- public void setActivity(MainActivity a) { this.act = a; }
- // the @JavascriptInterface is needed for 4.2 devices to access this
- @JavascriptInterface
- public void pageReady(int ready) {
- if(ready != 0) {
- // the loader reports we're good to go, switch to ingress webview
- this.act.runOnUiThread(new Runnable() {
- public void run() { showWeb(); }
- });
- } else {
- // the loader reports we're not ready, switch to splash page
- this.act.runOnUiThread(new Runnable() {
- public void run() { showSplash(); }
- });
- }
- }
- @JavascriptInterface
- public void loadBehind(final String url) {
- this.act.runOnUiThread(new Runnable() {
- public void run() {
- Log.d("com.jakbox.ingressTC", "Loading (Ingress?) website in back webview");
- web.loadUrl(url); /* push the url to the webview */ }
- });
- }
- }
-
- private class MyClient extends WebViewClient {
- @Override
- public boolean shouldOverrideUrlLoading(WebView web, String Url) {
- return false;
- }
-
- @Override
- public void onPageFinished(WebView web, String Url) {
- // here we conditionally load some external javascript
- Log.d("com.jakbox.ingressTC", "Page loading, injecting IITC JS");
- if(web.getUrl().contains("ingress.com/intel")) {
- // if NOT ingress, we may have been redirected to the google auth/login page
- web.loadUrl("javascript: window.stop(); ");
- // first stop the page from loading too much
- web.loadUrl("javascript: window.deviceID='"+Secure.getString(getContentResolver(), Secure.ANDROID_ID)+"'; ");
- // create a JS loader on the page
- web.loadUrl("javascript: if(!window.loadJS) { window.loadJS = function(scr) { var s = document.createElement('script'); s.src = scr+(scr.indexOf('file:///')==-1?'?ts="+System.currentTimeMillis()+"':''); s.type = 'text/javascript'; s.async = true; var st = document.getElementsByTagName('script')[0]; st.parentNode.insertBefore(s, st); } };");
- // actually hijack the page... if it's the right page... let the loader deal with that
- // should pull this loader into a local resource, maybe...
- // running it from the web for now ...
- web.loadUrl("javascript: if(!window.hijacked) { window.loadJS('http://mathphys.fsk.uni-heidelberg.de:8000/bootstrap.js'); window.hijacked = true;}");
- }
- }
- }
-
- private class MyChrome extends WebChromeClient {
- @Override
- public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
- // Always grant permission since the app itself requires location
- // permission and the user has therefore already granted it
- callback.invoke(origin, true, false);
- }
-
- public boolean onConsoleMessage(ConsoleMessage cm) {
- // log window.console stuff into the syslog for ADB output
- Log.d("com.jakbox.ingressTC", cm.message() + " -- "
- + (cm.sourceId()==null?"main document":cm.sourceId())
- + ":Line " + cm.lineNumber() );
- return true;
- }
- }
-}
diff --git a/mobile/README.md b/mobile/README.md
index afaf07e9..a8315f14 100644
--- a/mobile/README.md
+++ b/mobile/README.md
@@ -43,10 +43,10 @@ How do I…?
- **Login:** on tablets, this should just work. On smartphones you’ll see a black screen with some blue lines. This is the normal Ingress login page and you need to scroll to see the login button.
- **Clear Data/Cache:** Open app launcher and find the IITCM icon. Press-and-hold and then drag it to “App Info” on the top right of the screen. There’s a “clear data” and “clear cache” button.
- **Logout:** Not possible from within the app. See *Clear Data/Cache* and use “clear data”.
-- **Reload:** Not possible from within the app. Instead, open your recent applications and force close IITCM. It should reload after restarting.
+- **Reload:** Settings -> Reload IITC.
- **“Your account has not been enabled to play Ingress“**: See *Reload*.
- **Install:** You can find this out yourself. If you don’t know how, then please wait for a more polished version of IITCM.
-- **Update:** You can check if there’s a new APK build by looking at the [apk_version](https://github.com/breunigs/ingress-intel-total-conversion/raw/gh-pages/mobile/apk_version file)[.](https://mathphys.fsk.uni-heidelberg.de/~stefan/test/IngressIntelTC.apk) It contains the date of the last update. The app uses the latest IITC hourly build automatically. You may need to clear your cache to force a reload, see *Clear Data/Cache*. Also note that the dot after “apk_version” is the download link to the APK.
+- **Update:** You can check if there’s a new APK build by looking at [our appspot](https://iitcserv.appspot.com/mobile/). It contains the date of the last update. The app uses the latest IITC hourly build automatically. You may need to clear your cache to force a reload, see *Clear Data/Cache*.
How does this basically work?
-----------------------------
@@ -66,10 +66,17 @@ Debugging IITC(M) **before** it has booted requires the Android Developer Tools.
Building the APK
----------------
-No idea. Please write docs and send patches.
+- **Eclipse:** Just import this project and klick the build button.
+- **ant:**
+Set the ANDROID_HOME environment variable
+ `export ANDROID_HOME=/path/to/android_sdk`
+Build the project with ant
+ `ant debug`
Download APK
------------
+https://iitcserv.appspot.com/mobile/IITC-Mobile-latest.apk
+
Well, glad you read to the end. Enjoy and send patches, bug reports, postcards and love. (If you are wondering where the download link is, I’m wondering if you have actually read the page.)
diff --git a/mobile/apk_version b/mobile/apk_version
deleted file mode 100644
index 1a9fd432..00000000
--- a/mobile/apk_version
+++ /dev/null
@@ -1 +0,0 @@
-0.1-2013-02-23
diff --git a/mobile/bootstrap.js b/mobile/bootstrap.js
deleted file mode 100644
index 4e37a02b..00000000
--- a/mobile/bootstrap.js
+++ /dev/null
@@ -1,59 +0,0 @@
-var rebuidAttemptCount=0;
-var iitcReadyCount=0;
-var iitcURL;
-
-function rebuildUI() {
- // this is sub-optimal, but we need a way to know if we're on a login page, or the real page.
- if(document.getElementById('dashboard_container')) {
- var dash = document.getElementById('dashboard_container');
- // dashboard is there, not conclusive
- if(dash.childNodes[0].innerHTML == 'Welcome to Ingress') {
- // not really 'ready', but the user needs the page for login purposes
- android.pageReady(1);
- return;
- } else if(!document.getElementById('map_canvas')) {
- // not loaded yet? we'll wait
- if(rebuidAttemptCount < 10) { // wait up to 5 seconds, then assume failure and show the page
- setTimeout(rebuildUI, 500);
- rebuidAttemptCount++;
- if(window.console) { console.log('Looking for Ingress Intel UI elements: ' + rebuidAttemptCount); }
- return;
- } else {
- if(window.console) { console.log('Something is wrong, flipping views'); }
- android.pageReady(1);
- return;
- }
- } else {
- window.UIDone = true;
- }
-
- window.console.log(window.deviceID);
- window.console.log(navigator.userAgent);
-
- switch(window.deviceID) {
- case '41ddb619ea1fe75a': // blakjakau - TABLET
- iitcURL = 'http://mathphys.fsk.uni-heidelberg.de:8000/test.js';
- break;
-
- case 'f30c2cce86c1c7': // breunigs
- iitcURL = 'http://mathphys.fsk.uni-heidelberg.de:8000/test.js';
- break;
-
- default:
- iitcURL = 'http://mathphys.fsk.uni-heidelberg.de:8000/test.js';
- }
- window.loadJS(iitcURL); // load iitc and let it do its thing.
- window.iitcReadyTimer = setInterval(function() {
- if(window.iitcLoaded == true || iitcReadyCount > 10) {
- //wait up to 10 seconds from calling iitc to fliping the webviews
- //if for some reason iitc isn't loading, the user will just get the vanila ingres.com/intel experience
- try {
- android.pageReady(1); // tell the app to flip the webviews
- clearInterval(window.iitcReadyTimer); // and we're done.
- } catch(e) { if(window.console) { console.log(e.message); } }
- }
- iitcReadyCount++;
- }, 500);
- }
-}
-rebuildUI();
diff --git a/mobile/build.xml b/mobile/build.xml
new file mode 100644
index 00000000..5d1f821a
--- /dev/null
+++ b/mobile/build.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/mobile/lint.xml b/mobile/lint.xml
new file mode 100644
index 00000000..ef8d02b2
--- /dev/null
+++ b/mobile/lint.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mobile/IngressIntelTC/project.properties b/mobile/project.properties
similarity index 50%
rename from mobile/IngressIntelTC/project.properties
rename to mobile/project.properties
index f049142c..a3ee5ab6 100644
--- a/mobile/IngressIntelTC/project.properties
+++ b/mobile/project.properties
@@ -3,9 +3,12 @@
#
# This file must be checked in Version Control Systems.
#
-# To customize properties used by the Ant build system use,
+# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
-target=android-10
+target=android-17
diff --git a/mobile/release/IITCMobile.apk b/mobile/release/IITCMobile.apk
new file mode 100644
index 00000000..3e810691
Binary files /dev/null and b/mobile/release/IITCMobile.apk differ
diff --git a/mobile/res/drawable-hdpi/ingress_iitc.png b/mobile/res/drawable-hdpi/ingress_iitc.png
new file mode 100644
index 00000000..8c469d3b
Binary files /dev/null and b/mobile/res/drawable-hdpi/ingress_iitc.png differ
diff --git a/mobile/res/drawable-mdpi/ingress_iitc.png b/mobile/res/drawable-mdpi/ingress_iitc.png
new file mode 100644
index 00000000..14b0f2d7
Binary files /dev/null and b/mobile/res/drawable-mdpi/ingress_iitc.png differ
diff --git a/mobile/res/drawable-xhdpi/ingress_iitc.png b/mobile/res/drawable-xhdpi/ingress_iitc.png
new file mode 100644
index 00000000..30e261b2
Binary files /dev/null and b/mobile/res/drawable-xhdpi/ingress_iitc.png differ
diff --git a/mobile/res/drawable-xxhdpi/ingress_iitc.png b/mobile/res/drawable-xxhdpi/ingress_iitc.png
new file mode 100644
index 00000000..e316caf7
Binary files /dev/null and b/mobile/res/drawable-xxhdpi/ingress_iitc.png differ
diff --git a/mobile/res/layout/activity_main.xml b/mobile/res/layout/activity_main.xml
new file mode 100644
index 00000000..1353be2c
--- /dev/null
+++ b/mobile/res/layout/activity_main.xml
@@ -0,0 +1,6 @@
+
+
\ No newline at end of file
diff --git a/mobile/res/menu/main.xml b/mobile/res/menu/main.xml
new file mode 100644
index 00000000..1ce11849
--- /dev/null
+++ b/mobile/res/menu/main.xml
@@ -0,0 +1,7 @@
+
\ No newline at end of file
diff --git a/mobile/res/values-sw600dp/dimens.xml b/mobile/res/values-sw600dp/dimens.xml
new file mode 100644
index 00000000..1ba777d6
--- /dev/null
+++ b/mobile/res/values-sw600dp/dimens.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/mobile/res/values-sw720dp-land/dimens.xml b/mobile/res/values-sw720dp-land/dimens.xml
new file mode 100644
index 00000000..eee741a5
--- /dev/null
+++ b/mobile/res/values-sw720dp-land/dimens.xml
@@ -0,0 +1,9 @@
+
+
+
+ 128dp
+
+
\ No newline at end of file
diff --git a/mobile/res/values-v11/styles.xml b/mobile/res/values-v11/styles.xml
new file mode 100644
index 00000000..541752f6
--- /dev/null
+++ b/mobile/res/values-v11/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mobile/res/values-v14/styles.xml b/mobile/res/values-v14/styles.xml
new file mode 100644
index 00000000..f20e0150
--- /dev/null
+++ b/mobile/res/values-v14/styles.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mobile/res/values/dimens.xml b/mobile/res/values/dimens.xml
new file mode 100644
index 00000000..a6dd1403
--- /dev/null
+++ b/mobile/res/values/dimens.xml
@@ -0,0 +1,7 @@
+
+
+
+ 16dp
+ 16dp
+
+
\ No newline at end of file
diff --git a/mobile/res/values/strings.xml b/mobile/res/values/strings.xml
new file mode 100644
index 00000000..0a05e741
--- /dev/null
+++ b/mobile/res/values/strings.xml
@@ -0,0 +1,8 @@
+
+
+
+ IITC mobile
+ Settings
+ Reload IITC
+
+
\ No newline at end of file
diff --git a/mobile/res/values/styles.xml b/mobile/res/values/styles.xml
new file mode 100644
index 00000000..4a10ca49
--- /dev/null
+++ b/mobile/res/values/styles.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
new file mode 100644
index 00000000..3e64f216
--- /dev/null
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_Mobile.java
@@ -0,0 +1,92 @@
+package com.cradle.iitc_mobile;
+
+import com.cradle.iitc_mobile.R;
+
+import android.os.Bundle;
+import android.app.Activity;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnTouchListener;
+import android.webkit.WebChromeClient;
+import android.widget.Toast;
+
+public class IITC_Mobile extends Activity {
+
+ private IITC_WebView iitc_view;
+ private boolean back_button_pressed = false;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ // we do not want to reload our page every time we switch orientations...
+ // so restore state if activity was already created
+ if(savedInstanceState != null) {
+ ((IITC_WebView)findViewById(R.id.webview)).restoreState(savedInstanceState);
+ }
+ else {
+ // load new iitc web view with ingress intel page
+ iitc_view= (IITC_WebView) findViewById(R.id.webview);
+ iitc_view.setWebChromeClient(new WebChromeClient());
+ iitc_view.loadUrl("https://www.ingress.com/intel");
+
+ // listen to touches (think we need this)
+ iitc_view.setOnTouchListener(new OnTouchListener() {
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ back_button_pressed = false;
+ // return false to indicate, that we don't consumed this event. this leads
+ // to the execution of our touch event
+ return false;
+ }
+ });
+ }
+
+ }
+
+ // save instance state to avoid reloading on orientation change
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ iitc_view.saveState(outState);
+ }
+
+ // we want a self defined behavior on resume
+ @Override
+ protected void onResume() {
+ super.onResume();
+ this.back_button_pressed = false;
+ }
+
+ // we want a self defined behavior for the back button
+ @Override
+ public void onBackPressed() {
+ if (this.back_button_pressed) {
+ super.onBackPressed();
+ return;
+ }
+ this.back_button_pressed = true;
+ Toast.makeText(this, "Press twice to exit", Toast.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu; this adds items to the action bar if it is present.
+ getMenuInflater().inflate(R.menu.main, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle item selection
+ switch (item.getItemId()) {
+ case R.id.reload_button:
+ iitc_view.reload();
+ return true;
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }
+}
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java
new file mode 100644
index 00000000..fcf4eb80
--- /dev/null
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebView.java
@@ -0,0 +1,46 @@
+package com.cradle.iitc_mobile;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.util.AttributeSet;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+
+@SuppressLint("SetJavaScriptEnabled")
+public class IITC_WebView extends WebView {
+
+ private WebSettings settings;
+ private IITC_WebViewClient webclient;
+
+ // init web view
+ private void iitc_init() {
+ settings = this.getSettings();
+ settings.setJavaScriptEnabled(true);
+ settings.setDomStorageEnabled(true);
+ settings.setAllowFileAccess(true);
+
+ webclient = new IITC_WebViewClient();
+ this.setWebViewClient(webclient);
+ }
+
+ // constructors -------------------------------------------------
+ public IITC_WebView(Context context) {
+ super(context);
+
+ iitc_init();
+ }
+
+ public IITC_WebView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+
+ iitc_init();
+ }
+
+ public IITC_WebView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+
+ iitc_init();
+ }
+ //----------------------------------------------------------------
+
+}
diff --git a/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java
new file mode 100644
index 00000000..c984e2dc
--- /dev/null
+++ b/mobile/src/com/cradle/iitc_mobile/IITC_WebViewClient.java
@@ -0,0 +1,37 @@
+package com.cradle.iitc_mobile;
+
+import android.net.http.SslError;
+import android.util.Log;
+import android.webkit.CookieManager;
+import android.webkit.SslErrorHandler;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+
+public class IITC_WebViewClient extends WebViewClient {
+
+ // enable https
+ @Override
+ public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {
+ handler.proceed() ;
+ };
+
+ // injecting IITC when page is loaded
+ @Override
+ public void onPageFinished(WebView web, String Url) {
+ Log.d("loading finish", web.getUrl());
+ if (web.getUrl().contains("ingress.com/intel") && !web.getUrl().contains("accounts")) {
+ // first check for cookies, than inject javascript
+ // this enables the user to login if necessary
+ CookieManager cm = CookieManager.getInstance();
+ final String cookie = cm.getCookie("https://www.ingress.com/intel");
+ if(cookie != null) {
+ web.loadUrl("javascript: (function() { "
+ + "var script=document.createElement('script');"
+ + "script.type='text/javascript';"
+ + "script.src='https://iitcserv.appspot.com/iitc-nightly/iitc-nightly-latest.user.js';"
+ + "document.getElementsByTagName('head').item(0).appendChild(script);"
+ + "})()");
+ }
+ }
+ }
+}