/learn

Demo sample used in Social Media Week, February 25th 2016

Primary LanguageJava

Learn Demo App

Overview

Learn is a sample Android app to demo Facebook integration features for the Social Media Week developer event.

Note: Demo tested with v4.10.0 of the Facebook SDK for Android.

Installing

As a pre-requisite, you should have Android Studio and a working emulator or device to test with. The minimum API level supported is 15 (version 4.0.3).

  1. Clone this repository
  2. Open Android Studio
  3. From the welcome Quick Start, select Open an existing Android Studio project
  4. Navigate to the project located in starter/LearnApp and open it
  5. Click Run

You should see the app running in your emulator/device.

During the demo walk through, Facebook Platform features are added. To get ready for this, do the following:

  1. Create a Facebook app
  2. Add the Android platform to the app
  3. Configure your Android settings by adding the following:
    1. Google Play Package Name: com.facebook.samples.learn
    2. Class Name: com.facebook.samples.learn.MainActivity
    3. Key Hashes: add your developer key hash
  4. Upload the images located in the images directory in the App Details section
  5. Add a tester for the app, it could be someone you know or a test user

Refer to the Facebook SDK for Android documentation for more information on how to set up and configure your Facebook app.

Note: Some of the Facebook functionality requires the native Facebook app installed and one requires the Messenger app installed. For testing these features, you can run on a device.

Walk-through

The walkthrough\LearnApp project contains various steps of the demo walkthrough. You can compare the branch changes under that directory to follow along as features are added:

  1. Set up the Facebook SDK
  2. Add Facebook Login
  3. Personalize
  4. Share on Timeline
  5. Share with Messenger
  6. Add the Native Like Button
  7. Implement App Invites
  8. Add App Events

Note: When viewing the branch diffs, you can safely ignore the IDE-related changes found in the *.idea folder files.

Completed app

An APK of the final app is included in the builds directory. You can install this to see the finished application.

To install the APK using ADB tools:

$ cd <YOUR_ADROID_SDK_PLATFORM_TOOLS_DIRECTORY>
$./adb install <PATH_TO_REPO_CLONE>/learn/builds/app-release.apk 

The code for the completed app is available in the repo's completed folder, in the master branch. You can also open up this code in Android Studio:

  1. Open Android Studio
  2. Close any currently open projects
  3. From the Quick Start, select Open an existing Android Studio project
  4. Navigate to the project located in completed/LearnApp and open it
  5. Click Run

Additional Resources

Facebook SDK for Android documentation can be found at https://developers.facebook.com/android/