Permalink
Browse files

Update Android to Phonegap 2.1

In fact, this will break the iPhone version until that is
updated to 2.1 as well.  (The paths to cordova-?.?.?.jar
in www have changed, and I've replaced the previously
iOS www/cordova-1.8.0.js with the Android cordova-2.1.0.jar.)
  • Loading branch information...
1 parent 7ff5454 commit 9c5048229159c172a4071ddf6e8c377f4d5511bb @mhl mhl committed Oct 16, 2012
Showing with 1,892 additions and 1,178 deletions.
  1. +1 −1 phonegap/Android/.classpath
  2. +14 −3 phonegap/Android/AndroidManifest.xml
  3. +17 −6 phonegap/Android/gen/org/mysociety/FixMyStreet/R.java
  4. BIN phonegap/Android/libs/cordova-1.8.0.jar
  5. BIN phonegap/Android/libs/cordova-2.1.0.jar
  6. +20 −0 phonegap/Android/proguard-project.txt
  7. +0 −40 phonegap/Android/proguard.cfg
  8. +5 −2 phonegap/Android/project.properties
  9. BIN phonegap/Android/res/drawable-hdpi/ic_action_search.png
  10. BIN phonegap/Android/res/drawable-hdpi/ic_launcher.png
  11. BIN phonegap/Android/res/drawable-ldpi/ic_launcher.png
  12. BIN phonegap/Android/res/drawable-mdpi/ic_action_search.png
  13. BIN phonegap/Android/res/drawable-mdpi/ic_launcher.png
  14. BIN phonegap/Android/res/drawable-xhdpi/ic_action_search.png
  15. BIN phonegap/Android/res/drawable-xhdpi/ic_launcher.png
  16. +14 −0 phonegap/Android/res/layout/activity_main.xml
  17. +0 −12 phonegap/Android/res/layout/main.xml
  18. +6 −0 phonegap/Android/res/menu/activity_main.xml
  19. +5 −0 phonegap/Android/res/values-v11/styles.xml
  20. +5 −0 phonegap/Android/res/values-v14/styles.xml
  21. +2 −0 phonegap/Android/res/values/strings.xml
  22. +19 −1 phonegap/Android/res/xml/{plugins.xml → config.xml}
  23. +0 −5 phonegap/Android/res/xml/cordova.xml
  24. +531 −443 phonegap/android_cordova.js
  25. +1 −1 phonegap/www/about.html
  26. +1 −1 phonegap/www/around.html
  27. +1,245 −657 phonegap/www/{cordova-1.8.0.js → cordova-2.1.0.js}
  28. +1 −1 phonegap/www/email_sent.html
  29. +1 −1 phonegap/www/index.html
  30. +1 −1 phonegap/www/no_connection.html
  31. +1 −1 phonegap/www/report_created.html
  32. +1 −1 phonegap/www/sign_in.html
  33. +1 −1 phonegap/www/signed_in.html
@@ -4,6 +4,6 @@
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
- <classpathentry kind="lib" path="libs/cordova-1.8.0.jar"/>
+ <classpathentry kind="lib" path="libs/cordova-2.1.0.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
@@ -4,7 +4,16 @@
android:versionCode="1"
android:versionName="1.0" >
- <uses-sdk android:minSdkVersion="10" />
+ <uses-sdk
+ android:minSdkVersion="7"
+ android:targetSdkVersion="15" />
+
+ <supports-screens
+ android:largeScreens="true"
+ android:normalScreens="true"
+ android:smallScreens="true"
+ android:resizeable="true"
+ android:anyDensity="true" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"/>
@@ -15,10 +24,12 @@
<application
android:icon="@drawable/ic_launcher"
- android:label="@string/app_name">
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
<activity
android:name=".AndroidActivity"
- android:label="@string/app_name" >
+ android:label="@string/title_activity_main"
+ android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@@ -11,17 +11,28 @@
public static final class attr {
}
public static final class drawable {
- public static final int ic_launcher=0x7f020000;
+ public static final int ic_action_search=0x7f020000;
+ public static final int ic_launcher=0x7f020001;
+ }
+ public static final class id {
+ public static final int menu_settings=0x7f080000;
}
public static final class layout {
- public static final int main=0x7f030000;
+ public static final int activity_main=0x7f030000;
+ }
+ public static final class menu {
+ public static final int activity_main=0x7f070000;
}
public static final class string {
- public static final int app_name=0x7f050001;
- public static final int hello=0x7f050000;
+ public static final int app_name=0x7f050000;
+ public static final int hello=0x7f050001;
+ public static final int menu_settings=0x7f050002;
+ public static final int title_activity_main=0x7f050003;
+ }
+ public static final class style {
+ public static final int AppTheme=0x7f060000;
}
public static final class xml {
- public static final int cordova=0x7f040000;
- public static final int plugins=0x7f040001;
+ public static final int config=0x7f040000;
}
}
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,20 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
@@ -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 <methods>;
-}
-
--keepclasseswithmembers class * {
- public <init>(android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembers class * {
- public <init>(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 *;
-}
@@ -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-16
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,14 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true"
+ android:text="@string/hello"
+ tools:context=".MainActivity" />
+
+</RelativeLayout>
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
-
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/hello" />
-
-</LinearLayout>
@@ -0,0 +1,6 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/menu_settings"
+ android:title="@string/menu_settings"
+ android:orderInCategory="100"
+ android:showAsAction="never" />
+</menu>
@@ -0,0 +1,5 @@
+<resources>
+
+ <style name="AppTheme" parent="android:Theme.Holo.Light" />
+
+</resources>
@@ -0,0 +1,5 @@
+<resources>
+
+ <style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar" />
+
+</resources>
@@ -3,5 +3,7 @@
<string name="hello">Hello World, AndroidActivity!</string>
<string name="app_name">FixMyStreet</string>
+ <string name="menu_settings">Settings</string>
+ <string name="title_activity_main">AndroidActivity</string>
</resources>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
+<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
@@ -17,6 +17,21 @@
specific language governing permissions and limitations
under the License.
-->
+<cordova>
+ <!--
+ access elements control the Android whitelist.
+ Domains are assumed blocked unless set otherwise
+ -->
+
+ <access origin="http://127.0.0.1*"/> <!-- allow local pages -->
+
+ <!-- <access origin="https://example.com" /> allow any secure requests to example.com -->
+ <!-- <access origin="https://example.com" subdomains="true" /> such as above, but including subdomains, such as www -->
+ <access origin=".*"/>
+
+ <log level="DEBUG"/>
+ <preference name="useBrowserHistory" value="false" />
+ <preference name="exit-on-suspend" value="false" />
<plugins>
<plugin name="App" value="org.apache.cordova.App"/>
<plugin name="Geolocation" value="org.apache.cordova.GeoBroker"/>
@@ -35,4 +50,7 @@
<plugin name="Capture" value="org.apache.cordova.Capture"/>
<plugin name="Battery" value="org.apache.cordova.BatteryListener"/>
<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
+ <plugin name="Echo" value="org.apache.cordova.Echo" />
</plugins>
+</cordova>
+
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<cordova>
- <access origin="http://127.0.0.1*"/>
- <log level="DEBUG"/>
-</cordova>
Oops, something went wrong.

0 comments on commit 9c50482

Please sign in to comment.