How to integrate Facebook Api in Android – Mobile App Development, Android App Development, iphone App Development class="post-template-default single single-post postid-3657 single-format-standard wp-custom-logo"

How to integrate Facebook Api in Android

Before you start to generate Facebook App id. Take a look on facebook development.

Facebook allows you to obtain a token to access Facebook’s API on behalf of someone using your app. You can use this feature in place of building your own account system or to add Facebook services to your existing accounts.The Facebook SDK for Android provides methods to implement Facebook Login for your app. And to access this feature into your app you need facebook app id.

Now start to generate facebbok id , you should need a facebook account as a developer or you can use your personal account also.

Step1: Goto facebook developer site and login.

Here is facebook developer link open this and login to developer account.

How to integrate Facebook Api in Android

Step2: click on “Add a New App” and than select your app platform, here we are using Android so click on “Android”.

How to integrate Facebook Api in Android

Step3: Now click on “Create App Id” enter your app details and finally click on “Create App Id”

How to integrate Facebook Api in Android

Step4: Your Facebook App Id is generated, copy this app id and used for your app development.

How to integrate Facebook Api in Android

Step5: If you need facebook app secret key than click on “show” button and you will get your secret key.

Step6: Goto to and download facebook api.

Step6: After download facebook sdk extract it. You will get facebook api project import it to you workspace.

How to integrate Facebook Api in Android

Step7: Create a project name ImageSharing and add facebooksdk lib into your project from properties. And write this codes.

Write this code in

[code lang=”js”]
Write this code in
package com.example.imagesharing;
import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Base64;
import android.util.Log;

import com.facebook.UiLifecycleHelper;
import com.facebook.widget.FacebookDialog;

public class MainActivity extends Activity {
private UiLifecycleHelper uiHelper;
FacebookDialog shareDialog;

protected void onCreate(Bundle savedInstanceState) {
uiHelper = new UiLifecycleHelper(this, null);

// to share photo=================

Bitmap bm = BitmapFactory.decodeResource(getResources(),
List<Bitmap> image = new ArrayList<Bitmap>();
if (FacebookDialog.canPresentShareDialog(getApplicationContext(),
FacebookDialog.ShareDialogFeature.PHOTOS)) {
FacebookDialog shareDialog = new FacebookDialog.PhotoShareDialogBuilder(
} else {

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);

uiHelper.onActivityResult(requestCode, resultCode, data,
new FacebookDialog.Callback() {
public void onError(FacebookDialog.PendingCall pendingCall,
Exception error, Bundle data) {
String.format("Error: %s", error.toString()));

public void onComplete(
FacebookDialog.PendingCall pendingCall, Bundle data) {
Log.i("Activity", "Success!");

protected void onResume() {

protected void onSaveInstanceState(Bundle outState) {

public void onPause() {

public void onDestroy() {
//this function is to get hash key of your project.
//you can check it in log.
public static void showHashKey(Context context) {
try {
PackageInfo info = context.getPackageManager().getPackageInfo(
PackageManager.GET_SIGNATURES); // Your package name here
for (Signature signature : info.signatures) {
MessageDigest md = MessageDigest.getInstance("SHA");
Base64.encodeToString(md.digest(), Base64.DEFAULT));
} catch (NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {

Open string.xml in value folder and write this line
<string name="app_id">1533995260210845</string>
Now finally in your manifest.xml write this codes.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
android:versionName="1.0" >

android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET"/>

android:theme="@style/AppTheme" >
android:label="@string/app_name" >
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<activity android:name="com.facebook.LoginActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/app_id" />
<provider android:authorities=""


Run your app now you will get direct facebook page to share image on

Warning: _() expects exactly 1 parameter, 2 given in /home2/mobilemeri7/public_html/wp-content/themes/mobilemerit/comments.php on line 28

Write a Reply or Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Cracked Accounts Free Netflix Accounts VPN Proxy Shares Hack Programları Hack dökümanları Hack methodsları Wordlist Combolist Warez Scriptler Download Warez Files WhatsApp Numara çekme +90 Abazalardan Para kazanma Telegram Mavi tik alma 2022 Numara sorgulama Azuere Aws Sanal Kart Method WhatsApp vurma Güncel Method 2022 Bedava .Com .Org .Net VDS Premium Host YouTube Sahte Telif Methodu Tıklama hilesi ile para kazanmak Azure Hack method Pubg Mobile Uc Almak Hedef Kişinin herşeyini öğrenmek instagram Telif taslağı 2022 Ölüm Belgesi ile instagram hesap kaptma instagram form ile ebedi hesap kapatma instagram taklitsiz hesap kapatma instagram Çift faktör geçme instagram tiktok hesap çalma method instagram 2 Faktörlü doğrulama geçme instagram hesap kapatma 2022 instagram rever kırmak instagram Revert Kırma Abaza Dayı Methodu Aylık Dolar kazamak 1500 dolar instagram Çalmak istiyorum instagram düşmeyen takipçi instagram hackleme sitesi Whatsapp Kapatma %100 Abaza tokatlayarak para kazanmak Spotify ile para kazanma Günde 100 tl kazanma sınırsız kazanç Yatakta yatarak para kazanma YouTube izlenme arttırme yöntemi Oturduğun yerde para kazanma yöntemi Discord Hack tool Discord hack programları Cerebrus Rat v2 kodları PP Takipçi Çeken Telif Scripti Facebook profil kapatma methodu 2022 instagram yapay ile banned methodu instagram hesap satşı Sosyal medya hesap satışı Sosyal medya hack Leak Forum Crack Forum Cracking Forum Warez Forum Hack Forum illegal Forum Hacking Forum instagram Forum instagram Forumu Hacklink Hack forum php Shell indir Hack haber nakliyatankara nakliyatistanbul nakliyatankara nakliyatJigolodiyarijigolo sitesigerçek jigolo sitesijigolo sitelerimjigolo şirketlerijigolo sitelerijigolo başvurujigolo arayan kadınlara ulaşKocuceKo cuce