diff --git a/.gitignore b/.gitignore index 85dfaf14..4970c6dc 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ gen/* *.dex google-play-services_lib/ .recommenders/ +.DS_Store diff --git a/AndroidPlot/.classpath b/AndroidPlot/.classpath deleted file mode 100644 index 7bc01d9a..00000000 --- a/AndroidPlot/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/AndroidPlot/.project b/AndroidPlot/.project deleted file mode 100644 index c2208085..00000000 --- a/AndroidPlot/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - AndroidPlot - - - - - - 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/AndroidPlot/.settings/org.eclipse.jdt.core.prefs b/AndroidPlot/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b080d2dd..00000000 --- a/AndroidPlot/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/AndroidPlot/.settings/org.eclipse.ltk.core.refactoring.prefs b/AndroidPlot/.settings/org.eclipse.ltk.core.refactoring.prefs deleted file mode 100644 index 87e8de8b..00000000 --- a/AndroidPlot/.settings/org.eclipse.ltk.core.refactoring.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Fri Jul 22 22:32:56 IST 2011 -eclipse.preferences.version=1 -org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/AndroidPlot/app/build.gradle b/AndroidPlot/app/build.gradle new file mode 100644 index 00000000..e584a308 --- /dev/null +++ b/AndroidPlot/app/build.gradle @@ -0,0 +1,23 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 19 + buildToolsVersion "21.1.2" + + defaultConfig { + applicationId "com.plot" + minSdkVersion 7 + targetSdkVersion 7 + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' + } + } +} + +dependencies { + compile files('libs/Androidplot-core-0.4.4-release.jar') +} diff --git a/AndroidPlot/libs/Androidplot-core-0.4.4-release.jar b/AndroidPlot/app/libs/Androidplot-core-0.4.4-release.jar similarity index 100% rename from AndroidPlot/libs/Androidplot-core-0.4.4-release.jar rename to AndroidPlot/app/libs/Androidplot-core-0.4.4-release.jar diff --git a/AndroidPlot/AndroidManifest.xml b/AndroidPlot/app/src/main/AndroidManifest.xml similarity index 100% rename from AndroidPlot/AndroidManifest.xml rename to AndroidPlot/app/src/main/AndroidManifest.xml diff --git a/AndroidPlot/src/com/plot/AndroidPlot.java b/AndroidPlot/app/src/main/java/com/plot/AndroidPlot.java similarity index 100% rename from AndroidPlot/src/com/plot/AndroidPlot.java rename to AndroidPlot/app/src/main/java/com/plot/AndroidPlot.java diff --git a/AndroidPlot/res/drawable-hdpi/icon.png b/AndroidPlot/app/src/main/res/drawable-hdpi/icon.png similarity index 100% rename from AndroidPlot/res/drawable-hdpi/icon.png rename to AndroidPlot/app/src/main/res/drawable-hdpi/icon.png diff --git a/AndroidPlot/res/drawable-ldpi/icon.png b/AndroidPlot/app/src/main/res/drawable-ldpi/icon.png similarity index 100% rename from AndroidPlot/res/drawable-ldpi/icon.png rename to AndroidPlot/app/src/main/res/drawable-ldpi/icon.png diff --git a/AndroidPlot/res/drawable-mdpi/icon.png b/AndroidPlot/app/src/main/res/drawable-mdpi/icon.png similarity index 100% rename from AndroidPlot/res/drawable-mdpi/icon.png rename to AndroidPlot/app/src/main/res/drawable-mdpi/icon.png diff --git a/AndroidPlot/res/layout/main.xml b/AndroidPlot/app/src/main/res/layout/main.xml similarity index 100% rename from AndroidPlot/res/layout/main.xml rename to AndroidPlot/app/src/main/res/layout/main.xml diff --git a/AndroidPlot/res/values/strings.xml b/AndroidPlot/app/src/main/res/values/strings.xml similarity index 100% rename from AndroidPlot/res/values/strings.xml rename to AndroidPlot/app/src/main/res/values/strings.xml diff --git a/AndroidPlot/build.gradle b/AndroidPlot/build.gradle new file mode 100644 index 00000000..833eee9a --- /dev/null +++ b/AndroidPlot/build.gradle @@ -0,0 +1,15 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.1.0' + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/AndroidPlot/gradle/wrapper/gradle-wrapper.jar b/AndroidPlot/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..8c0fb64a Binary files /dev/null and b/AndroidPlot/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidPlot/gradle/wrapper/gradle-wrapper.properties b/AndroidPlot/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..0c71e760 --- /dev/null +++ b/AndroidPlot/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/AndroidPlot/proguard.cfg b/AndroidPlot/proguard.cfg deleted file mode 100644 index 12dd0392..00000000 --- a/AndroidPlot/proguard.cfg +++ /dev/null @@ -1,36 +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 ; -} - --keepclasseswithmembernames class * { - public (android.content.Context, android.util.AttributeSet); -} - --keepclasseswithmembernames class * { - public (android.content.Context, android.util.AttributeSet, int); -} - --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/AndroidPlot/project.properties b/AndroidPlot/project.properties deleted file mode 100644 index a5578ba0..00000000 --- a/AndroidPlot/project.properties +++ /dev/null @@ -1,11 +0,0 @@ -# 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-19 diff --git a/AndroidPlot/settings.gradle b/AndroidPlot/settings.gradle new file mode 100644 index 00000000..e7b4def4 --- /dev/null +++ b/AndroidPlot/settings.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/AndroidRss/.classpath b/AndroidRss/.classpath deleted file mode 100644 index 8807363c..00000000 --- a/AndroidRss/.classpath +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/AndroidRss/.project b/AndroidRss/.project deleted file mode 100644 index 5259d254..00000000 --- a/AndroidRss/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - AndroidRss - - - - - - 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/AndroidRss/.settings/org.eclipse.jdt.core.prefs b/AndroidRss/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index b080d2dd..00000000 --- a/AndroidRss/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.source=1.6 diff --git a/AndroidRss/app/build.gradle b/AndroidRss/app/build.gradle new file mode 100644 index 00000000..3554ce64 --- /dev/null +++ b/AndroidRss/app/build.gradle @@ -0,0 +1,24 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 19 + buildToolsVersion "21.1.2" + + defaultConfig { + applicationId "com.pfizer.android" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' + } + } +} + +dependencies { + compile files('libs/jdom-1.0.jar') + compile files('libs/jdom-1.1.3.jar') + compile files('libs/rome-0.9.jar') + compile files('libs/rome-1.0.jar') +} diff --git a/AndroidRss/libs/jdom-1.0.jar b/AndroidRss/app/libs/jdom-1.0.jar similarity index 100% rename from AndroidRss/libs/jdom-1.0.jar rename to AndroidRss/app/libs/jdom-1.0.jar diff --git a/AndroidRss/libs/jdom-1.1.3.jar b/AndroidRss/app/libs/jdom-1.1.3.jar similarity index 100% rename from AndroidRss/libs/jdom-1.1.3.jar rename to AndroidRss/app/libs/jdom-1.1.3.jar diff --git a/AndroidRss/libs/rome-0.9.jar b/AndroidRss/app/libs/rome-0.9.jar similarity index 100% rename from AndroidRss/libs/rome-0.9.jar rename to AndroidRss/app/libs/rome-0.9.jar diff --git a/AndroidRss/libs/rome-1.0.jar b/AndroidRss/app/libs/rome-1.0.jar similarity index 100% rename from AndroidRss/libs/rome-1.0.jar rename to AndroidRss/app/libs/rome-1.0.jar diff --git a/AndroidRss/AndroidManifest.xml b/AndroidRss/app/src/main/AndroidManifest.xml similarity index 100% rename from AndroidRss/AndroidManifest.xml rename to AndroidRss/app/src/main/AndroidManifest.xml diff --git a/AndroidRss/src/com/pfizer/android/AndroidRss.java b/AndroidRss/app/src/main/java/com/pfizer/android/AndroidRss.java similarity index 100% rename from AndroidRss/src/com/pfizer/android/AndroidRss.java rename to AndroidRss/app/src/main/java/com/pfizer/android/AndroidRss.java diff --git a/AndroidRss/res/drawable-hdpi/icon.png b/AndroidRss/app/src/main/res/drawable-hdpi/icon.png similarity index 100% rename from AndroidRss/res/drawable-hdpi/icon.png rename to AndroidRss/app/src/main/res/drawable-hdpi/icon.png diff --git a/AndroidRss/res/drawable-ldpi/icon.png b/AndroidRss/app/src/main/res/drawable-ldpi/icon.png similarity index 100% rename from AndroidRss/res/drawable-ldpi/icon.png rename to AndroidRss/app/src/main/res/drawable-ldpi/icon.png diff --git a/AndroidRss/res/drawable-mdpi/icon.png b/AndroidRss/app/src/main/res/drawable-mdpi/icon.png similarity index 100% rename from AndroidRss/res/drawable-mdpi/icon.png rename to AndroidRss/app/src/main/res/drawable-mdpi/icon.png diff --git a/AndroidRss/res/layout/dataview.xml b/AndroidRss/app/src/main/res/layout/dataview.xml similarity index 100% rename from AndroidRss/res/layout/dataview.xml rename to AndroidRss/app/src/main/res/layout/dataview.xml diff --git a/AndroidRss/res/layout/main.xml b/AndroidRss/app/src/main/res/layout/main.xml similarity index 100% rename from AndroidRss/res/layout/main.xml rename to AndroidRss/app/src/main/res/layout/main.xml diff --git a/AndroidRss/res/values/strings.xml b/AndroidRss/app/src/main/res/values/strings.xml similarity index 100% rename from AndroidRss/res/values/strings.xml rename to AndroidRss/app/src/main/res/values/strings.xml diff --git a/AndroidRss/build.gradle b/AndroidRss/build.gradle new file mode 100644 index 00000000..833eee9a --- /dev/null +++ b/AndroidRss/build.gradle @@ -0,0 +1,15 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.1.0' + } +} + +allprojects { + repositories { + jcenter() + } +} diff --git a/AndroidRss/gradle/wrapper/gradle-wrapper.jar b/AndroidRss/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..8c0fb64a Binary files /dev/null and b/AndroidRss/gradle/wrapper/gradle-wrapper.jar differ diff --git a/AndroidRss/gradle/wrapper/gradle-wrapper.properties b/AndroidRss/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..0c71e760 --- /dev/null +++ b/AndroidRss/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Apr 10 15:27:10 PDT 2013 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip diff --git a/AndroidRss/project.properties b/AndroidRss/project.properties deleted file mode 100644 index a5578ba0..00000000 --- a/AndroidRss/project.properties +++ /dev/null @@ -1,11 +0,0 @@ -# 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-19 diff --git a/AndroidRss/settings.gradle b/AndroidRss/settings.gradle new file mode 100644 index 00000000..e7b4def4 --- /dev/null +++ b/AndroidRss/settings.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/README.adoc b/README.adoc index 145dad63..23bc0920 100644 --- a/README.adoc +++ b/README.adoc @@ -1,6 +1,6 @@ == Android Cookbook Examples -This repo contains about seventy source code examples from the recipes published in the O'Reilly Android Cookbook (see http://androidcookbook.com/), a great source of tutorial material for the Android Developer. Not all recipes in the book or online have code accompanying them; this repo features code that was either linked by the contributor, or in a few cases, re-constructed as a New Project by the editor, for your convenience. +This repo contains about seventy source code examples from the recipes published in the O'Reilly Android Cookbook (see http://androidcookbook.com ), a great source of tutorial material for the Android Developer. Not all recipes in the book or online have code accompanying them; this repo features code that was either linked by the contributor, or in a few cases, re-constructed as a New Project by the editor, for your convenience. Further note that not all programs used in the book/online appear here; some of the examples in the book/online are only program fragments taken from other programs that can't be included. And of course some projects used as examples in the book/online are routinely hosted elsewhere. @@ -121,4 +121,4 @@ There are some things I'd love it if people would contribute: | Vibrate | Make the device vibrate | - | | ViewPagerDemo | Swipe among views | - | | WindowBackgroundDemo | - | - | -|=========== +|=========== \ No newline at end of file