diff options
author | Mark Longair <mhl@pobox.com> | 2012-10-16 16:35:10 +0100 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2012-10-17 09:57:51 +0100 |
commit | 9c5048229159c172a4071ddf6e8c377f4d5511bb (patch) | |
tree | 4ead914a170d2592b807d95b9d90ffb4fad4d515 /phonegap/Android | |
parent | 7ff54542f29751b465b4580bac8bfd622eb296da (diff) |
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.)
Diffstat (limited to 'phonegap/Android')
23 files changed, 108 insertions, 70 deletions
diff --git a/phonegap/Android/.classpath b/phonegap/Android/.classpath index 075ed1757..e088a5d5b 100644 --- a/phonegap/Android/.classpath +++ b/phonegap/Android/.classpath @@ -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> diff --git a/phonegap/Android/AndroidManifest.xml b/phonegap/Android/AndroidManifest.xml index b9540ffbe..8e7f49994 100644 --- a/phonegap/Android/AndroidManifest.xml +++ b/phonegap/Android/AndroidManifest.xml @@ -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" /> diff --git a/phonegap/Android/gen/org/mysociety/FixMyStreet/R.java b/phonegap/Android/gen/org/mysociety/FixMyStreet/R.java index adcacc076..9dd2e6d98 100644 --- a/phonegap/Android/gen/org/mysociety/FixMyStreet/R.java +++ b/phonegap/Android/gen/org/mysociety/FixMyStreet/R.java @@ -11,17 +11,28 @@ public final class R { 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; } } diff --git a/phonegap/Android/libs/cordova-1.8.0.jar b/phonegap/Android/libs/cordova-1.8.0.jar Binary files differdeleted file mode 100755 index 326fa8392..000000000 --- a/phonegap/Android/libs/cordova-1.8.0.jar +++ /dev/null diff --git a/phonegap/Android/libs/cordova-2.1.0.jar b/phonegap/Android/libs/cordova-2.1.0.jar Binary files differnew file mode 100644 index 000000000..d3eecaaaf --- /dev/null +++ b/phonegap/Android/libs/cordova-2.1.0.jar diff --git a/phonegap/Android/proguard-project.txt b/phonegap/Android/proguard-project.txt new file mode 100644 index 000000000..f2fe1559a --- /dev/null +++ b/phonegap/Android/proguard-project.txt @@ -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 *; +#} diff --git a/phonegap/Android/proguard.cfg b/phonegap/Android/proguard.cfg deleted file mode 100644 index b1cdf17b5..000000000 --- a/phonegap/Android/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 <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 *; -} diff --git a/phonegap/Android/project.properties b/phonegap/Android/project.properties index f049142c1..9b84a6b4b 100644 --- a/phonegap/Android/project.properties +++ b/phonegap/Android/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-16 diff --git a/phonegap/Android/res/drawable-hdpi/ic_action_search.png b/phonegap/Android/res/drawable-hdpi/ic_action_search.png Binary files differnew file mode 100644 index 000000000..67de12dec --- /dev/null +++ b/phonegap/Android/res/drawable-hdpi/ic_action_search.png diff --git a/phonegap/Android/res/drawable-hdpi/ic_launcher.png b/phonegap/Android/res/drawable-hdpi/ic_launcher.png Binary files differindex 8074c4c57..a301d5795 100644 --- a/phonegap/Android/res/drawable-hdpi/ic_launcher.png +++ b/phonegap/Android/res/drawable-hdpi/ic_launcher.png diff --git a/phonegap/Android/res/drawable-ldpi/ic_launcher.png b/phonegap/Android/res/drawable-ldpi/ic_launcher.png Binary files differindex 1095584ec..2c2a58b2f 100644 --- a/phonegap/Android/res/drawable-ldpi/ic_launcher.png +++ b/phonegap/Android/res/drawable-ldpi/ic_launcher.png diff --git a/phonegap/Android/res/drawable-mdpi/ic_action_search.png b/phonegap/Android/res/drawable-mdpi/ic_action_search.png Binary files differnew file mode 100644 index 000000000..134d5490b --- /dev/null +++ b/phonegap/Android/res/drawable-mdpi/ic_action_search.png diff --git a/phonegap/Android/res/drawable-mdpi/ic_launcher.png b/phonegap/Android/res/drawable-mdpi/ic_launcher.png Binary files differindex a07c69fa5..f91f736fe 100644 --- a/phonegap/Android/res/drawable-mdpi/ic_launcher.png +++ b/phonegap/Android/res/drawable-mdpi/ic_launcher.png diff --git a/phonegap/Android/res/drawable-xhdpi/ic_action_search.png b/phonegap/Android/res/drawable-xhdpi/ic_action_search.png Binary files differnew file mode 100644 index 000000000..d699c6b37 --- /dev/null +++ b/phonegap/Android/res/drawable-xhdpi/ic_action_search.png diff --git a/phonegap/Android/res/drawable-xhdpi/ic_launcher.png b/phonegap/Android/res/drawable-xhdpi/ic_launcher.png Binary files differnew file mode 100644 index 000000000..96095ec84 --- /dev/null +++ b/phonegap/Android/res/drawable-xhdpi/ic_launcher.png diff --git a/phonegap/Android/res/layout/activity_main.xml b/phonegap/Android/res/layout/activity_main.xml new file mode 100644 index 000000000..0b4ffccc1 --- /dev/null +++ b/phonegap/Android/res/layout/activity_main.xml @@ -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> diff --git a/phonegap/Android/res/layout/main.xml b/phonegap/Android/res/layout/main.xml deleted file mode 100644 index bc12cd823..000000000 --- a/phonegap/Android/res/layout/main.xml +++ /dev/null @@ -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>
\ No newline at end of file diff --git a/phonegap/Android/res/menu/activity_main.xml b/phonegap/Android/res/menu/activity_main.xml new file mode 100644 index 000000000..cfc10fd52 --- /dev/null +++ b/phonegap/Android/res/menu/activity_main.xml @@ -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> diff --git a/phonegap/Android/res/values-v11/styles.xml b/phonegap/Android/res/values-v11/styles.xml new file mode 100644 index 000000000..d408cbc37 --- /dev/null +++ b/phonegap/Android/res/values-v11/styles.xml @@ -0,0 +1,5 @@ +<resources> + + <style name="AppTheme" parent="android:Theme.Holo.Light" /> + +</resources>
\ No newline at end of file diff --git a/phonegap/Android/res/values-v14/styles.xml b/phonegap/Android/res/values-v14/styles.xml new file mode 100644 index 000000000..1c089a788 --- /dev/null +++ b/phonegap/Android/res/values-v14/styles.xml @@ -0,0 +1,5 @@ +<resources> + + <style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar" /> + +</resources>
\ No newline at end of file diff --git a/phonegap/Android/res/values/strings.xml b/phonegap/Android/res/values/strings.xml index a4df04a14..6e091cf98 100644 --- a/phonegap/Android/res/values/strings.xml +++ b/phonegap/Android/res/values/strings.xml @@ -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>
\ No newline at end of file diff --git a/phonegap/Android/res/xml/plugins.xml b/phonegap/Android/res/xml/config.xml index 76879a1ce..4a6fffccb 100644 --- a/phonegap/Android/res/xml/plugins.xml +++ b/phonegap/Android/res/xml/config.xml @@ -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> + diff --git a/phonegap/Android/res/xml/cordova.xml b/phonegap/Android/res/xml/cordova.xml deleted file mode 100644 index c7b500003..000000000 --- a/phonegap/Android/res/xml/cordova.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<cordova> - <access origin="http://127.0.0.1*"/> - <log level="DEBUG"/> -</cordova> |