forked from spring-attic/spring-android-samples
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved Facebook and Twitter examples out of the Showcase to separate s…
…ample apps
- Loading branch information
1 parent
6e3de15
commit fb81900
Showing
126 changed files
with
4,788 additions
and
3,793 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.DS_Store | ||
bin | ||
gen | ||
target | ||
.project | ||
.classpath | ||
.settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="org.springframework.android.facebookclient" | ||
android:versionCode="1" | ||
android:versionName="1.0" > | ||
|
||
<uses-sdk android:minSdkVersion="7" /> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
|
||
<application | ||
android:name=".MainApplication" | ||
android:icon="@drawable/spring_android" | ||
android:label="@string/app_name" > | ||
<activity | ||
android:name=".FacebookActivity" | ||
android:label="@string/app_name" > | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name=".FacebookWebOAuthActivity" | ||
android:excludeFromRecents="true" | ||
android:noHistory="true" /> | ||
<activity android:name=".FacebookProfileActivity" /> | ||
<activity android:name=".FacebookHomeFeedActivity" /> | ||
<activity android:name=".FacebookWallPostActivity" /> | ||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Spring for Android Facebook Client | ||
|
||
## Introduction | ||
|
||
This sample app includes an Android client which connects to Twitter. This illustrate the integration of [Spring Social](http://www.springsource.org/spring-social) with [Spring for Android](http://www.springsource.org/spring-android). The Android client project requires set up of the Android SDK. See the main README at the root of this repository for more information about configuring your environment. | ||
|
||
## Build and Run the Android Client | ||
|
||
1. Navigate to the client directory: | ||
|
||
$ cd spring-android-facebook-client | ||
|
||
2. Build the app: | ||
|
||
$ mvn clean install | ||
|
||
3. Start the emulator using the Android Maven Plugin: | ||
|
||
$ mvn android:emulator-start | ||
|
||
Alternatively, you can start the emulator using the Android command line tools: | ||
|
||
$ emulator @Default | ||
|
||
_IMPORTANT: Ensure the emulator is fully initialized and ready or the deploy will fail._ | ||
|
||
4. Deploy the app to the emulator: | ||
|
||
$ mvn android:deploy | ||
|
||
5. Start the sample app: | ||
|
||
$ mvn android:run | ||
_Note: the Android Maven Plugin will attempt to deploy and run the app to all available devices, both emulators and physical devices attached to your computer._ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.springframework.android</groupId> | ||
<artifactId>spring-android-facebook-client</artifactId> | ||
<version>1.0.0.RELEASE</version> | ||
<packaging>apk</packaging> | ||
<name>spring-android-facebook-client</name> | ||
<url>http://www.springsource.org/spring-android</url> | ||
<organization> | ||
<name>SpringSource</name> | ||
<url>http://www.springsource.org</url> | ||
</organization> | ||
|
||
<properties> | ||
<android-platform>15</android-platform> | ||
<android-maven-plugin-version>3.2.0</android-maven-plugin-version> | ||
<maven-compiler-plugin-version>2.3.2</maven-compiler-plugin-version> | ||
<java-version>1.6</java-version> | ||
<maven-eclipse-plugin-version>2.8</maven-eclipse-plugin-version> | ||
<com.google.android-version>4.0.1.2</com.google.android-version> | ||
<!-- Available Android versions: 1.5_r3, 1.5_r4, 1.6_r2, 2.1.2, 2.1_r1, 2.2.1, 2.3.1, 2.3.3, 4.0.1.2 --> | ||
<org.springframework.android-version>1.0.0.RELEASE</org.springframework.android-version> | ||
<org.springframework.social-version>1.0.2.RELEASE</org.springframework.social-version> | ||
<org.springframework.social-facebook-version>1.0.1.RELEASE</org.springframework.social-facebook-version> | ||
<org.springframework.security-version>3.1.0.RELEASE</org.springframework.security-version> | ||
<org.codehaus.jackson-version>1.9.7</org.codehaus.jackson-version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.google.android</groupId> | ||
<artifactId>android</artifactId> | ||
<version>${com.google.android-version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.android</groupId> | ||
<artifactId>spring-android-rest-template</artifactId> | ||
<version>${org.springframework.android-version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.android</groupId> | ||
<artifactId>spring-android-auth</artifactId> | ||
<version>${org.springframework.android-version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.security</groupId> | ||
<artifactId>spring-security-crypto</artifactId> | ||
<version>${org.springframework.security-version}</version> | ||
<exclusions> | ||
<!-- Exclude in favor of Spring Android Core --> | ||
<exclusion> | ||
<artifactId>spring-core</artifactId> | ||
<groupId>org.springframework</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.social</groupId> | ||
<artifactId>spring-social-core</artifactId> | ||
<version>${org.springframework.social-version}</version> | ||
<exclusions> | ||
<!-- Exclude in favor of Spring Android RestTemplate --> | ||
<exclusion> | ||
<artifactId>spring-web</artifactId> | ||
<groupId>org.springframework</groupId> | ||
</exclusion> | ||
<!-- Provided by Android --> | ||
<exclusion> | ||
<artifactId>commons-logging</artifactId> | ||
<groupId>commons-logging</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.social</groupId> | ||
<artifactId>spring-social-facebook</artifactId> | ||
<version>${org.springframework.social-facebook-version}</version> | ||
<exclusions> | ||
<!-- Provided by Android --> | ||
<exclusion> | ||
<artifactId>commons-logging</artifactId> | ||
<groupId>commons-logging</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<!-- Using Jackson for JSON marshaling --> | ||
<groupId>org.codehaus.jackson</groupId> | ||
<artifactId>jackson-mapper-asl</artifactId> | ||
<version>${org.codehaus.jackson-version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<repositories> | ||
<!-- For testing against latest Spring snapshots --> | ||
<repository> | ||
<id>springsource-snapshot</id> | ||
<name>SpringSource Snapshot Repository</name> | ||
<url>http://repo.springsource.org/snapshot</url> | ||
<releases> | ||
<enabled>false</enabled> | ||
</releases> | ||
<snapshots> | ||
<enabled>true</enabled> | ||
</snapshots> | ||
</repository> | ||
<!-- For developing against latest Spring milestones --> | ||
<repository> | ||
<id>springsource-milestone</id> | ||
<name>SpringSource Milestone Repository</name> | ||
<url>http://repo.springsource.org/milestone</url> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
</repository> | ||
<!-- For developing against latest Spring releases --> | ||
<repository> | ||
<id>springsource-repo</id> | ||
<name>SpringSpring Repository</name> | ||
<url>http://repo.springsource.org/release</url> | ||
<snapshots> | ||
<enabled>false</enabled> | ||
</snapshots> | ||
</repository> | ||
</repositories> | ||
|
||
<build> | ||
<finalName>${project.artifactId}</finalName> | ||
<sourceDirectory>src</sourceDirectory> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.jayway.maven.plugins.android.generation2</groupId> | ||
<artifactId>android-maven-plugin</artifactId> | ||
<version>${android-maven-plugin-version}</version> | ||
<configuration> | ||
<sdk> | ||
<platform>${android-platform}</platform> | ||
</sdk> | ||
<deleteConflictingFiles>true</deleteConflictingFiles> | ||
<undeployBeforeDeploy>true</undeployBeforeDeploy> | ||
</configuration> | ||
<extensions>true</extensions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>${maven-compiler-plugin-version}</version> | ||
<configuration> | ||
<source>${java-version}</source> | ||
<target>${java-version}</target> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-eclipse-plugin</artifactId> | ||
<version>${maven-eclipse-plugin-version}</version> | ||
<configuration> | ||
<downloadSources>true</downloadSources> | ||
<downloadJavadocs>true</downloadJavadocs> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
<pluginManagement> | ||
<plugins> | ||
<!--This plugin's configuration is used to store Eclipse m2e settings | ||
only. It has no influence on the Maven build itself. --> | ||
<plugin> | ||
<groupId>org.eclipse.m2e</groupId> | ||
<artifactId>lifecycle-mapping</artifactId> | ||
<version>1.0.0</version> | ||
<configuration> | ||
<lifecycleMappingMetadata> | ||
<pluginExecutions> | ||
<pluginExecution> | ||
<pluginExecutionFilter> | ||
<groupId>com.jayway.maven.plugins.android.generation2</groupId> | ||
<artifactId>android-maven-plugin</artifactId> | ||
<versionRange>[3.1.1,)</versionRange> | ||
<goals> | ||
<goal>proguard</goal> | ||
</goals> | ||
</pluginExecutionFilter> | ||
<action> | ||
<ignore></ignore> | ||
</action> | ||
</pluginExecution> | ||
</pluginExecutions> | ||
</lifecycleMappingMetadata> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <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 *; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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-15 |
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.
21 changes: 8 additions & 13 deletions
21
...t/res/layout/facebook_activity_layout.xml → ...t/res/layout/facebook_activity_layout.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:layout_centerVertical="true" | ||
> | ||
android:orientation="vertical" > | ||
|
||
<TextView | ||
android:id="@+id/text_view_description" | ||
android:text="@string/facebook_description" | ||
android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center_horizontal" | ||
android:padding="10dip" | ||
/> | ||
android:text="@string/facebook_description" /> | ||
|
||
<AbsoluteLayout | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
> | ||
|
||
android:layout_height="fill_parent" > | ||
|
||
<ListView | ||
android:id="@+id/facebook_activity_options_list" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
/> | ||
|
||
android:layout_height="fill_parent" /> | ||
</AbsoluteLayout> | ||
</LinearLayout> | ||
|
||
</LinearLayout> |
Oops, something went wrong.