Code2care : TechZone Apps & Tutorials

How to check if Facebook App is installed on Android Device

While working with Facebook SDK for Android, we may have to check if Facebook application is been installed on the device, to do so we need to check if the package com.facebook.katana is present or now.

public Boolean checkFbInstalled() {

   PackageManager pm = getPackageManager();
   boolean flag = false;
    try {
     pm.getPackageInfo("com.facebook.katana",
     PackageManager.GET_ACTIVITIES);
     flag = true;
   } catch (PackageManager.NameNotFoundException e) {
      flag = false;
  }
   return flag;
 }






Popular tags
android
x 175
eclipse
x 29
notepadplusplus
x 20
macosx
x 14
sharepoint
x 14
html
x 14
mac
x 13
androidstudio
x 11




1000+ C Programs     PHP Tutorial     JSON Tutorial     Swift Tutorial     India Pinocdes     About Us     Privacy Policy


Code2care © 2012-17