Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.

Setup project

Sergey Tikhonov edited this page Mar 7, 2016 · 17 revisions

Gradle

  1. Add dependency (jCenter):

    allprojects {
        repositories {
            jcenter()
        }
    }

    Easily reference the library in your Android projects using this dependency in your module's build.gradle file:

    dependencies {
        compile 'com.sromku:simple-fb:4.1.1'
    }
  2. Add to your string.xml your app_id:

    <string name="app_id">728615400528729</string>
  3. Update the manifest.xml of your application and add next lines:

    <uses-permission android:name="android.permission.INTERNET" />
    
    <activity android:name="com.facebook.FacebookActivity"
    	android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
    	android:theme="@android:style/Theme.Translucent.NoTitleBar"
    	android:label="@string/app_name" />
    
    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/app_id" />

    If you are going to use publishing actions with dialog then add to you manifest this:

    <provider
            android:name="com.facebook.FacebookContentProvider"
            android:authorities="com.facebook.app.FacebookContentProvider728615400528729"
            android:exported="true" />

    You can see that the name of authorities is: com.facebook.app.FacebookContentProvider<app_id>
    Replace <app_id> with you application id.

Eclipse (Not supported anymore)

This setup is relevant to old versions of this library. The latest version that supports facebook sdk 4.2> wasn't adapted for Eclipse. Please start coding with Android Studio.

  1. Clone Facebook SDK or download it. Then, import the project to your workspace.

  2. Clone and import this (Simple Facebook) project to your workspace.

  3. Add reference from Simple Facebook project to FacebookSDK project.

    Screenshot

  4. Now, you can add reference from your app to Simple Facebook project.

Clone this wiki locally