6

I'm new for facebook app, so I need help to install the facebook api on android emulator in windows 7.

I have installed the facebook api but I got a library error..

[2013-04-02 16:22:35 - HelloFacebookSample] Unable to resolve target 'android-8'

in library

....\facebook ?

2
  • check this link please stackoverflow.com/questions/13339428/… Apr 2, 2013 at 11:26
  • Thanks, but i already that but occurre error compiler, also change compiler take 1.5 the error occur in <com.facebook.widget.ProfilePictureView android:id="@+id/profilePicture" android:layout_height="wrap_content" android:layout_width="wrap_content" android:gravity="center_horizontal" android:layout_marginBottom="10dp" facebook:preset_size="normal"/> Apr 2, 2013 at 11:42

3 Answers 3

16

You don't install the Facebook API. Neither on a device nor on an emulator.

You make calls to the Facebook API using their SDK for various platforms. In your case, the Facebook Android SDK. This Facebook Android SDK is to be integrated in your application that you develop.

However, if you meant install the Facebook App on the emulator (the OP is mighty unclear), then you will need to grab the .apk file that is included in the SDK bundle that you can download from the link above. To install that APK, follow these steps:

Make sure you have the emulator already running.

  1. Download the SDK package.
  2. Extract the contents of the zip to a folder.
  3. Find the APK file in the extracted folder, in the bin folder and rename it to a simple facebook.apk file name. Copy this file.
  4. Browse to your SDK location on your computer and navigate to the platform-tools folder. (We need the adb here). Paste the facebook.apk file here
  5. In an empty area in the folder, with the Shift key pressed, right click and select Open command Window here (make sure you are not doing this on any file or folder)
  6. Now, at the command prompt, type this command:

    adb install facebook.apk

Following the above steps will install the Facebook application on your emulator.

6
  • Tanks Siddharth Lele, that is useful for me Apr 2, 2013 at 10:55
  • @EngrWaseemArain: Glad to have helped. :-) Apr 2, 2013 at 10:56
  • 1
    hmm insha Allah in future. if u have your own blog send me link that. Apr 2, 2013 at 10:58
  • i have cover these all setps but error is occure in library file... help for that..tnx in advance Apr 2, 2013 at 11:05
  • I have followed exactly the same steps but its giving me error:- Device no found waiting for device MY emulator is running. May 5, 2014 at 13:35
1

If you want to use Facebook as part of your application, you can get hold of the Facebook SDK, which is a Library project to your own. You cannot install Facebook on the Emulator to test, but it will fall back to using the Internet Browser for it's authentication.

The best solution is to test on a real device. You can try using Samsung Remote Labs if you want a real device to test on but don't have one.

2
1

If you want to install the Facebook .APK file, you need to perform the following steps:

1) Download the corresponding Facebook .APK file for your Android SDK. Please check this link: [Facebook SDK for Android v4.x Downloads1

2) If you are on Mac OSX:

Go to Android Studio > Terminal:

cd /Users/[your_username]/Library/Android/sdk (or where is the location of the SDK)

3) ./platform-tools/adb install /Users/admin/Downloads/Facebook-some_version.apk

4) You should see a "Success" message.

Good luck !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.