Wednesday, April 25, 2012

Generating App Signature for Facebook Settings -1


Generating App Signature for Facebook Settings

To create facebook android native app you need to provide your Android application signature in facebook app settings. You can generate your application signature (keyhash) usingkeytool that comes with java. But to generate signature you need openssl installed on your pc. If you don’t have one download openssl from here and set it in your system environment path.
Open your command prompt (CMD) and run the following command to generate your keyhash. While generating hashkey it should ask you password. Give password as android. If it don’t ask for password your keystore path is incorrect.
keytool -exportcert -alias androiddebugkey -keystore "<path-to-users-directory>\.android\debug.keystore" | openssl sha1 -binary | openssl base64
check the following command how i generated hashkey on my pc.
keytool -exportcert -alias androiddebugkey -keystore "C:\Users\Ravi\.android\debug.keystore" | openssl sha1 -binary | openssl base64
android facebook generating hash key app signature

Registering your Facebook Application

After generating your app signature successfully, register your facebook application by going to create new facebook application and fill out all the information needed. And select Native Android App and give your hashkey there which you generated previously using keytool.
android facebook register app
and note down your facebook App ID
android facebook app id

Creating Facebook Reference Project

Once you are done with registering your facebook application, you need to download facebook SDK and create a new reference project. This reference project will be used to compile your actual project.
1. Download facebook android SDK from git repositories.
(git clone git://github.com/facebook/facebook-android-sdk.git)
2. In your Eclipse goto File ⇒ Import ⇒ Existing Projects into Workspace and select the facebook project you downloaded from git repository.
android facebook import project

Creating Your Facebook Connect Project

1. Create new Project in your Eclipse IDE. File ⇒ New ⇒ Android Project and fill out all the details.
2. Now we need to add reference of this project to existing facebook project. Right Click on Project ⇒ Properties ⇒ android ⇒ Click on Add button ⇒ select your facebook project ⇒ Click Apply.
android facebook adding reference project
android facebook adding reference project
android facebook adding reference project

No comments: