Facebook Login – Android

facebook-android

Steps
1. Register/Create a new app on Facebook

2. Add Android section

3. Generate Key Hash with your keystore and put to Facebook Developer
keytool -exportcert -alias your.alias -keystore your.keystore > key.bin
openssl sha1 -binary key.bin > sha.bin
openssl base64 -in sha.bin -out output.txt

4. Import Facebook SDK into your Eclipse

5. Eclipse > Project > Properties > Android > Reference. Add Facebook SDK.

6. Follow Facebook tutorial at
https://developers.facebook.com/docs/android/login-with-facebook#config

7. Facebook tutorial missed out two part. First is the meta-data with appid.
< meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id" />
Then put your app id in string.xml

8. Add the com.facebook.LoginActivity to your AndroidManifest.xml.

Done.

發表留言