Skip to content

Commit

Permalink
Revamp Android SDK project configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Soneff committed Jun 2, 2010
1 parent 7744431 commit 5d9f4af
Show file tree
Hide file tree
Showing 20 changed files with 56 additions and 197 deletions.
8 changes: 0 additions & 8 deletions .classpath

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
*.DS_Store
*.class
*java#
*.classpath
*.project
*.settings
facebook/bin/
facebook/gen/
examples/stream/bin/
examples/simple/bin/
examples/stream/gen/
Expand Down
33 changes: 0 additions & 33 deletions .project

This file was deleted.

8 changes: 0 additions & 8 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------------
Expand Down
8 changes: 0 additions & 8 deletions examples/simple/.classpath

This file was deleted.

33 changes: 0 additions & 33 deletions examples/simple/.project

This file was deleted.

1 change: 1 addition & 0 deletions examples/simple/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 0 additions & 8 deletions examples/stream/.classpath

This file was deleted.

34 changes: 0 additions & 34 deletions examples/stream/.project

This file was deleted.

5 changes: 0 additions & 5 deletions examples/stream/.settings/org.eclipse.jdt.core.prefs

This file was deleted.

3 changes: 2 additions & 1 deletion examples/stream/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 0 additions & 6 deletions facebook/.classpath

This file was deleted.

17 changes: 0 additions & 17 deletions facebook/.project

This file was deleted.

12 changes: 0 additions & 12 deletions facebook/.settings/org.eclipse.jdt.core.prefs

This file was deleted.

21 changes: 21 additions & 0 deletions facebook/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -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>
12 changes: 12 additions & 0 deletions facebook/default.properties
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes
6 changes: 1 addition & 5 deletions facebook/src/com/facebook/android/Facebook.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions facebook/src/com/facebook/android/FbDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5d9f4af

Please sign in to comment.