diff --git a/.classpath b/.classpath index 94e92eb..2dd540a 100644 --- a/.classpath +++ b/.classpath @@ -1,18 +1,14 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore index 0e96cd3..970ae35 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /bin /gen /assets +/target + diff --git a/.project b/.project index d0e396c..1a96ea7 100644 --- a/.project +++ b/.project @@ -1,33 +1,39 @@ - - - AndroidTwitterGoogleApiJavaClient - - - - - - 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 - - + + + AndroidTwitterGoogleApiJavaClient + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..abec6ca --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/AndroidManifest.xml b/AndroidManifest.xml index b1d4848..2cc22ff 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -3,11 +3,19 @@ package="com.ecs.sample" android:versionCode="1" android:versionName="1.0"> - + + - + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..a91b366 --- /dev/null +++ b/README.md @@ -0,0 +1,108 @@ +##Introduction + +##Software requirements + + +##Project setup + +### m2e-android plugin + +This project is built using the [m2e-android plugin](http://rgladwell.github.io/m2e-android/index.html) to handle its external dependencies. + +When using Eclipse ADT, it assumes that the following components are installed : + +- Eclipse Market Client +- [m2e-android plugin](http://rgladwell.github.io/m2e-android/index.html) +- [maven-android-sdk-deployer](https://github.com/mosabua/) + +### Eclipse MarketPlace + +If you don't have the Eclipse Market Client installed, you can install it by clicking on + +```Help → Install new Software → Switch to the Juno Repository → General Purpose Tools → Marketplace Client``` + +![](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/AndroidMavenSetup/1_available_soft.PNG) + +Once you have the Eclipse Market Client installed, you can proceed to install the m2e-android plugin + +![](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/AndroidMavenSetup/2_marketplace.PNG) + +```Help -> Eclipse Marketplace... and search for "android m2e".``` + +![](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/AndroidMavenSetup/3_android_m2e.PNG) + +More instructions can be found on the [m2e-android plugin](http://rgladwell.github.io/m2e-android/index.html) site. + +### maven-android-sdk-deployer + +Clone the [maven-android-sdk-deployer](https://github.com/mosabua/maven-android-sdk-deployer) and execute mvn install. This will install the required projects into your local maven repository. + +### Environment setup + +Make sure you have your ANDROID_HOME variable pointing to your SDK + +![](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/AndroidMavenSetup/4_env_variable.PNG) + +### Clone and import the project + +Clone the project on your filesystem + + git clone git@github.com:ddewaele/AndroidTwitterGoogleApiJavaClient.git + Cloning into AndroidTwitterGoogleApiJavaClient... + remote: Reusing existing pack: 145, done. + remote: Counting objects: 11, done. + remote: Compressing objects: 100% (8/8), done. + remote: Total 156 (delta 0), reused 0 (delta 0) + Receiving objects: 100% (156/156), 529.74 KiB | 483 KiB/s, done. + Resolving deltas: 100% (33/33), done. + +Import the project in Eclipse ADT. + +When importing the project, select ```Existing Maven Projects```. + +![](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/OAuth1Twitter/adt-import.png) + +Navigate to the place where you cloned the repository (ex: /Users/ddewaele/Projects/AndroidTwitterGoogleApiJavaClient) and click Finish. + +![](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/OAuth1Twitter/adt-import2.png) + +After that, Eclipse ADT and the Maven M2E plugin should import your project and setup all the dependencies. + +![](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/OAuth1Twitter/adt-import3.png) + + +### Twitter OAuth application and keys + +As this application allows you to interact with Twitter, you need to go to to the [Twitter Developer page](dev.twitter.com) to [register a new application](https://apps.twitter.com/app/new). + +Here are a couple of steps you need to follow + +- Register a new application in the Twitter dev console + +![](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/OAuth1Twitter/app-create.png) + +- Verify that the application was created succesfully. + +![](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/OAuth1Twitter/app-list.png) + +- Set the correct permissions + +![](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/OAuth1Twitter/app-permissions.png) + +- Copy the key and secret from the app. + +![](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/OAuth1Twitter/app-keys.png) + +- Put the key and secret in the [Constants file](https://github.com/ddewaele/AndroidTwitterGoogleApiJavaClient/blob/master/src/com/ecs/sample/Constants.java) + +Replace the placeholders below with the actual KEY and SECRET + + public static final String API_KEY = "PUT YOUR TWITTER API KEY HERE"; + public static final String API_SECRET= "PUT YOUR TWITTER API SECRET HERE"; + + +Launch the application and you should see the following screens. + +![Twitter login](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/OAuth1Twitter/2-twitter-login.png) +![Twitter authorization](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/OAuth1Twitter/3-twitter-authorize.png) +![Twitter tweets](https://dl.dropboxusercontent.com/u/13246619/Blog%20Articles/OAuth1Twitter/4-twitter-stream.png) diff --git a/default.properties b/default.properties deleted file mode 100644 index b74c488..0000000 --- a/default.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, -# "build.properties", and override values to adapt the script to your -# project structure. - -# Project target. -target=android-4 diff --git a/lib/twitter4j-core-2.1.11.jar b/lib/twitter4j-core-2.1.11.jar deleted file mode 100644 index b0fb214..0000000 Binary files a/lib/twitter4j-core-2.1.11.jar and /dev/null differ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..973baa9 --- /dev/null +++ b/pom.xml @@ -0,0 +1,86 @@ + + + 4.0.0 + com.ecs + com.ecs.android.twitter.ouath + 0.0.1-SNAPSHOT + apk + com.ecs.android.twitter.ouath + + + UTF-8 + 4.1.1.4 + 3.6.0 + 1.18.0-rc + UTF-8 + + + + + com.google.android + android + ${platform.version} + provided + + + xpp3 + xpp3 + + + + + + com.google.api-client + google-api-client + ${com.google.api-client.version} + + + + com.google.http-client + google-http-client-jackson2 + ${com.google.api-client.version} + + + xpp3 + xpp3 + + + + + + org.twitter4j + twitter4j-core + 4.0.1 + + + + + + + + ${project.artifactId} + + + + com.jayway.maven.plugins.android.generation2 + android-maven-plugin + ${android.plugin.version} + true + + + + + + com.jayway.maven.plugins.android.generation2 + android-maven-plugin + + + 16 + /Users/davydewaele/Soft/adt-bundle-mac-x86_64-20130522/sdk + + + + + + diff --git a/project.properties b/project.properties new file mode 100644 index 0000000..a3ee5ab --- /dev/null +++ b/project.properties @@ -0,0 +1,14 @@ +# 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 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-17 diff --git a/res/drawable-hdpi/ic_launcher.png b/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000..288b665 Binary files /dev/null and b/res/drawable-hdpi/ic_launcher.png differ diff --git a/res/drawable-hdpi/icon.png b/res/drawable-hdpi/icon.png deleted file mode 100644 index 8074c4c..0000000 Binary files a/res/drawable-hdpi/icon.png and /dev/null differ diff --git a/res/drawable-ldpi/icon.png b/res/drawable-ldpi/icon.png deleted file mode 100644 index 1095584..0000000 Binary files a/res/drawable-ldpi/icon.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_launcher.png b/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000..6ae570b Binary files /dev/null and b/res/drawable-mdpi/ic_launcher.png differ diff --git a/res/drawable-mdpi/icon.png b/res/drawable-mdpi/icon.png deleted file mode 100644 index a07c69f..0000000 Binary files a/res/drawable-mdpi/icon.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_launcher.png b/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000..d4fb7cd Binary files /dev/null and b/res/drawable-xhdpi/ic_launcher.png differ diff --git a/res/drawable-xxhdpi/ic_launcher.png b/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..85a6081 Binary files /dev/null and b/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/res/layout/login.xml b/res/layout/login.xml new file mode 100644 index 0000000..b5578f3 --- /dev/null +++ b/res/layout/login.xml @@ -0,0 +1,23 @@ + + +