Giter Site home page Giter Site logo

facebook-android-sdk's Introduction

This open source Java library allows you to integrate Facebook into your Android application. Except as otherwise noted, the Facebook Android SDK is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html)

Getting Started

See our Android SDK Getting Started Guide

Sample Applications

This library includes two sample applications to guide you in development.

  • simple: A bare-bones app that demonstrates authorization, making API calls, and invoking a dialog.

  • stream: This slightly beefier application lets you view your news feed.

To install a sample application into Eclipse (3.5):

  • Create the sample application in your workspace:
  1. Select File -> New -> Project, choose Android Project, and then click Next.
  2. Select "Create project from existing source".
  3. Choose either examples/simple or examples/stream. You should see the project properties populated.
  4. Click Finish to continue.
  • Build the project: from the Project menu, select "Build Project".

  • Run the application: from the Run menu, select "Run Configurations...". Under Android Application, you can create a new run configuration: give it a name and select the simple Example project; use the default activity Launch Action. See http://developer.android.com/guide/developing/eclipse-adt.html#RunConfig for more details.

Testing

Here are some tips to help test your application:

  • You will need to have the Facebook application in your test environment. The SDK includes a developer release of the Facebook application that can be side-loaded for testing purposes. On an actual device, you can just download the latest version of the app from the Android Market, but on the emulator you will have to install it yourself:

    adb install FBAndroid.apk
    
  • Use a signed build. You can sign with a debug key, but make sure that the key you used to sign matches the Key Hash field in the Facebook developer settings.

  • Make sure to test both with and without the Facebook application. The SDK will fall back to a Webview if the Facebook app is not installed.

  • You can use this guide to developing on a device.

Debugging

Here's a few common errors and their solutions.

  • Build error: "missing gen files".

    This should go away when you rebuild the project. If you have trouble, try running Clean... from the Project menu.

  • Error: "invalid_key"

    This error means that the Facebook server doesn't recognize your Android key hash. Make sure that you correctly generated and copy/pasted your key hash into the Facebook developer settings console (http://www.facebook.com/developers/apps.php), and make sure that your application has been signed with the same key you registered with Facebook.

  • Dialog won't load or shows a blank screen.

    This can be tricky to debug. If the logs don't give an indication of what's wrong, I suggest installing tcpdump on your device and getting a trace. Tutorial: http://www.vbsteven.be/blog/android-debugging-inspectin-network-traffic-with-tcpdump/

    If you still can't tell what's going on, then file an issue and please include the HTTP trace.

  • I can't upload photos with photos.upload.

    Make sure the Bundle value for the photo parameter is a byte array.

Report Issues/Bugs

http://bugs.developers.facebook.net/enter_bug.cgi?product=SDKs

facebook-android-sdk's People

Contributors

sso-google avatar sugree avatar bgold avatar jimbru avatar

Stargazers

Tim Spann avatar Roberto Pelaez avatar Shereef Marzouk avatar  avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.