Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revamp Android SDK project configuration

  • Loading branch information...
commit 5d9f4af61f01a50a8bfbcc890bb440ebaff69d9b 1 parent 7744431
Steven Soneff authored
View
8 .classpath
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="facebook/src"/>
- <classpathentry excluding="*" kind="src" path="example"/>
- <classpathentry excluding="**/*" kind="src" path="facedroid"/>
- <classpathentry kind="lib" path="/Users/yariv/android-sdk-mac_86/platforms/android-7/android.jar"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
View
4 .gitignore
@@ -2,7 +2,11 @@
*.DS_Store
*.class
*java#
+*.classpath
+*.project
+*.settings
facebook/bin/
+facebook/gen/
examples/stream/bin/
examples/simple/bin/
examples/stream/gen/
View
33 .project
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>android-sdk</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ApkBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
8 .settings/org.eclipse.jdt.core.prefs
@@ -1,8 +0,0 @@
-#Mon May 10 14:32:59 PDT 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
View
30 README.md
@@ -32,33 +32,29 @@ Install necessary packages
git clone git@github.com:facebook/facebook-android-sdk.git
-* Import the Facebook SDK project into your Eclipse workspace.
- * Open the __File__ menu, click on __Import...__ and choose __Existing project into workspace__ under the General group.
- * Select the __facebook__ subdirectory from within the git repository.
- * You should see an entry for __FacebookSDK__ listed under __Projects__. Click __Finish__.
+To build with Eclipse (3.5), do the following:
-* To ensure Eclipse can build the project, you will have to define the ANDROID_DIR build path variable.
- * Right click on the project, select __Build Path->Configure Build Path...__.
- * In the __Java Build Path__ panel, select the __Libraries__ tab, and click __Add Variable..._.
- * In the pop up, click on __Configure Variables...__ and then __New...__
- * In the 'name' field enter __ANDROID_JAR__ and in the 'path' field click on __File...__ and select the android.jar file from the Android SDK directory on your local machine.
+* Create a new project for the Facebook SDK in your Eclipse workspace.
+ * Open the __File__ menu, select New --> Project and choose __Android Project__, then click Next.
+ * Select "Create project from existing source"
+ * Select the __facebook__ subdirectory from within the git repository at the location.
+ * You should see the project properties populated, and you can click Finish to continue.
-__NOTE: If you run into trouble, add the android.jar file directly to the project's build path. You can also try Build Clean... from the Eclipse Project menu or Fix Project Properties in the Android Tools on the context (right-click) menu for your project.__
+The Facebook SDK is now configured and ready to go.
-The Facebook SDK is now configured and ready to go.
+If you already have an Android application, you can add a dependency to your application on the SDK by right-clicking on your project in the Package Explorer, selecting Properties, and adding the dependency in the Library section of the Android tab.
Run the sample application
--------------------------
-To test the SDK, you should run the simple sample application included.
+To test the SDK, you should run the simple sample application. You can do this with Eclipse (3.5) as follows:
-* Import the sample application project into your Eclipse workspace.
- * Import as above, but choose the __examples/simple__ subdirectory from within the git repository.
- * You should see an entry for FacebookSDK-example.
+* Create the sample application in your workspace:
+ * Repeat as described above, but choose the __examples/simple__ subdirectory from within the git repository.
-Update the APP_ID variable in the Example class to your application ID. Create a Run Configuration under Android Application and Launch the default activity.
+Build the new project and update any dependencies.
-To run a sample application on a real device, follow the instructions at http://developer.android.com/guide/developing/device.html
+Create a Run Configuration under Android Application and Launch the default activity. To run a sample application on a real device, follow the instructions at http://developer.android.com/guide/developing/device.html
Create your own application
---------------------------
View
8 examples/simple/.classpath
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
- <classpathentry combineaccessrules="false" kind="src" path="/FacebookSDK"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
View
33 examples/simple/.project
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>FacebookSDK-example</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ApkBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
1  examples/simple/default.properties
@@ -9,5 +9,6 @@
# Indicates whether an apk should be generated for each density.
split.density=false
+android.library.reference.1=../../facebook/
# Project target.
target=android-3
View
8 examples/stream/.classpath
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="gen"/>
- <classpathentry combineaccessrules="false" kind="src" path="/FacebookSDK"/>
- <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
View
34 examples/stream/.project
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>stream</name>
- <comment></comment>
- <projects>
- <project>android-sdk</project>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>com.android.ide.eclipse.adt.ApkBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
5 examples/stream/.settings/org.eclipse.jdt.core.prefs
@@ -1,5 +0,0 @@
-#Tue May 04 17:29:57 PDT 2010
-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.source=1.5
View
3  examples/stream/default.properties
@@ -9,5 +9,6 @@
# Indicates whether an apk should be generated for each density.
split.density=false
+android.library.reference.1=../../facebook/
# Project target.
-target=android-7
+target=android-3
View
6 facebook/.classpath
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="var" path="ANDROID_JAR"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
View
17 facebook/.project
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>FacebookSDK</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
View
12 facebook/.settings/org.eclipse.jdt.core.prefs
@@ -1,12 +0,0 @@
-#Fri May 07 12:11:08 PDT 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
View
21 facebook/AndroidManifest.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2010 Facebook Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.facebook.android">
+ <application/>
+</manifest>
View
12 facebook/default.properties
@@ -0,0 +1,12 @@
+# 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.
+
+android.library=true
+# Project target.
+target=android-3
View
0  facebook/src/icon.png → facebook/res/drawable/facebook_icon.png
File renamed without changes
View
6 facebook/src/com/facebook/android/Facebook.java
@@ -106,7 +106,6 @@ public void authorize(Context context,
}
dialog(context, LOGIN, params, new DialogListener() {
- @Override
public void onComplete(Bundle values) {
setAccessToken(values.getString(TOKEN));
setAccessExpiresIn(values.getString(EXPIRES));
@@ -120,19 +119,16 @@ public void onComplete(Bundle values) {
}
}
- @Override
public void onError(DialogError error) {
Log.d("Facebook-authorize", "Login failed: " + error);
listener.onError(error);
}
- @Override
public void onFacebookError(FacebookError error) {
Log.d("Facebook-authorize", "Login failed: " + error);
listener.onFacebookError(error);
}
-
- @Override
+
public void onCancel() {
Log.d("Facebook-authorize", "Login cancelled");
listener.onCancel();
View
4 facebook/src/com/facebook/android/FbDialog.java
@@ -82,8 +82,8 @@ protected void onCreate(Bundle savedInstanceState) {
private void setUpTitle() {
requestWindowFeature(Window.FEATURE_NO_TITLE);
- Drawable icon = Drawable.createFromStream(getClass().
- getClassLoader().getResourceAsStream(FB_ICON), FB_ICON);
+ Drawable icon = getContext().getResources().getDrawable(
+ R.drawable.facebook_icon);
mTitle = new TextView(getContext());
mTitle.setText("Facebook");
mTitle.setTextColor(Color.WHITE);
Please sign in to comment.
Something went wrong with that request. Please try again.