From: gumartinm Date: Thu, 22 Dec 2011 05:46:42 +0000 (+0100) Subject: New Test, same as Test 2 but using Java executors instead of Android AsyncTask. X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=bff39a82c1099c043d8ebef29a0711751e0f34f0;p=JavaForFun New Test, same as Test 2 but using Java executors instead of Android AsyncTask. 1. The onPostExecute method from AsyncTask is executed in the UI thread and I do not want that behaviour, so it seems the best option to lauch a new Thread using without using the AsyncTask 2. First steps retrieving the JSON data from sent by the RESTful Web Service --- diff --git a/Android/Testing/README b/Android/Testing/README new file mode 100644 index 0000000..38527c8 --- /dev/null +++ b/Android/Testing/README @@ -0,0 +1,14 @@ +INDEX: + +1. Test1: Login UI with AsyncTask. The connection to the RESTful Web Service is made by an AsyncTask. + +2. Test2: Sequential login UI. The connection to the RESTful Web Service is made in the UI thread. + With an AsyncTask to treat updates from LocationManager. + DialogFragment API for popups/dialogs. + Method to determine whether one Location reading is better than the current Location from: + http://developer.android.com/guide/topics/location/obtaining-user-location.html + It is useful when you can use a window to improve the results retrieved from the LocationManager + +3. Test3: Sequential login UI. + Using Java Concurrent to treat updates from LocationManager. + DialogFragment API for popups/dialogs. diff --git a/Android/Testing/Test3/AndroidManifest.xml b/Android/Testing/Test3/AndroidManifest.xml new file mode 100644 index 0000000..548eed8 --- /dev/null +++ b/Android/Testing/Test3/AndroidManifest.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Android/Testing/Test3/gen/de/android/test3/R.java b/Android/Testing/Test3/gen/de/android/test3/R.java new file mode 100644 index 0000000..21d25a0 --- /dev/null +++ b/Android/Testing/Test3/gen/de/android/test3/R.java @@ -0,0 +1,41 @@ +/* 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 de.android.test3; + +public final class R { + public static final class attr { + } + public static final class drawable { + public static final int alert_dialog_icon=0x7f020000; + public static final int ic_launcher=0x7f020001; + } + public static final class id { + public static final int cancel_button=0x7f050005; + public static final int frameLayout1=0x7f050000; + public static final int frameLayout2=0x7f050003; + public static final int login_button=0x7f050004; + public static final int password=0x7f050002; + public static final int username=0x7f050001; + } + public static final class layout { + public static final int main=0x7f030000; + public static final int nextactivity=0x7f030001; + } + public static final class string { + public static final int alert_dialog_cancel=0x7f040000; + public static final int app_name=0x7f040004; + public static final int button_cancel=0x7f040009; + public static final int button_login=0x7f040007; + public static final int button_ok=0x7f040008; + public static final int error_dialog_connection_error=0x7f040001; + public static final int error_dialog_userpwd_error=0x7f040002; + public static final int hello=0x7f040003; + public static final int password=0x7f040006; + public static final int username=0x7f040005; + } +} diff --git a/Android/Testing/Test3/proguard.cfg b/Android/Testing/Test3/proguard.cfg new file mode 100644 index 0000000..b1cdf17 --- /dev/null +++ b/Android/Testing/Test3/proguard.cfg @@ -0,0 +1,40 @@ +-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/Android/Testing/Test3/project.properties b/Android/Testing/Test3/project.properties new file mode 100644 index 0000000..730e911 --- /dev/null +++ b/Android/Testing/Test3/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-14 diff --git a/Android/Testing/Test3/res/drawable-hdpi/alert_dialog_icon.png b/Android/Testing/Test3/res/drawable-hdpi/alert_dialog_icon.png new file mode 100755 index 0000000..fe54477 Binary files /dev/null and b/Android/Testing/Test3/res/drawable-hdpi/alert_dialog_icon.png differ diff --git a/Android/Testing/Test3/res/drawable-hdpi/ic_launcher.png b/Android/Testing/Test3/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..8074c4c Binary files /dev/null and b/Android/Testing/Test3/res/drawable-hdpi/ic_launcher.png differ diff --git a/Android/Testing/Test3/res/drawable-ldpi/ic_launcher.png b/Android/Testing/Test3/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 0000000..1095584 Binary files /dev/null and b/Android/Testing/Test3/res/drawable-ldpi/ic_launcher.png differ diff --git a/Android/Testing/Test3/res/drawable-mdpi/ic_launcher.png b/Android/Testing/Test3/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..a07c69f Binary files /dev/null and b/Android/Testing/Test3/res/drawable-mdpi/ic_launcher.png differ diff --git a/Android/Testing/Test3/res/layout/main.xml b/Android/Testing/Test3/res/layout/main.xml new file mode 100644 index 0000000..1e03635 --- /dev/null +++ b/Android/Testing/Test3/res/layout/main.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + +