facebook-android-sdk

java.lang.RuntimeException: Failure delivering result ResultInfo while logging using Facebook

泪湿孤枕 提交于 2019-12-04 05:25:23
My application is working fine on emulator. So I decided to run my application on my Android phone. I am trying to login to Facebook account using my application and it works fine on emulator. And as soon as I run my application on android phone I always get this exception- 01-30 11:06:08.400: E/AndroidRuntime(7463): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=64206, result=0, data=null} to activity {com.facebook.samples.sessionlogin/com.facebook.LoginActivity}: java.lang.NullPointerException Below is my code- @Override public View onCreateView

Facebook Login button: apply custom style

青春壹個敷衍的年華 提交于 2019-12-04 03:49:07
i'm facing a strange problem by using new Facebook android sdk 4. With older sdk version i was using: <com.facebook.login.widget.LoginButton xmlns:fb="http://schemas.android.com/apk/res-auto" android:id="@+id/fb_button" style="@style/FacebookLoginButton" android:layout_width="485dp" android:layout_height="64dp" android:layout_centerHorizontal="true" android:layout_marginBottom="-17dp" fb:login_text="@string/login_with_facebook" fb:logout_text="Logout" /> FacebookLoginButton section of style.xml looks like <style name="FacebookLoginButton"> <item name="android:background">@drawable/button

Writing tests for an android app that logs into Facebook: UIAutomator can't fill in text in Facebook's username field

主宰稳场 提交于 2019-12-03 22:46:00
From this question/answer I got the idea to use UIAutomator to test my app that requires logging into Facebook. Writing tests for an Android app that logs into Facebook I tried UiObject2 editText = mDevice.findObject(By.clazz("android.widget.EditText")); editText.setText("test@email.com"); As well as other things but whatever I do I can't get it to fill out the field. I used hierachyviewer tool to see that it was an EditText. It's a webview, though, so I don't know. Is this possible? My full test code class is attached below: package com.greenrobot.yesorno.test; import android.os.SystemClock;

Facebook Login and Post To Wall works for first time only

*爱你&永不变心* 提交于 2019-12-03 21:46:02
I have a strange situation.I am trying to integrate facebook with my app.But the login and post to wall works only for the first time.I am struck for the past 2 days and could not find a solution. Here is the code snippet: //.............Facebook.......................... private static final String APP_ID = "My app id"; // Instance of Facebook Class private Facebook facebook = new Facebook(APP_ID); private AsyncFacebookRunner mAsyncRunner; private SharedPreferences mPrefs; String access_token; long expires; //............Facebook..............................// else if(actionId == ID_FACEBOOK

How to get user likes from Facebook with Android sdk 3.0

一曲冷凌霜 提交于 2019-12-03 21:36:12
I would get user likes from facebook using Android sdk 3.0 beta. How do I do this? Provided that you have a valid session, this is the code to get the user likes Session session = Session.getActiveSession(); Request.Callback callback = new Request.Callback() { @Override public void onCompleted(Response response) { // response should have the likes Toast.makeText(getApplicationContext(), response.toString(), Toast.LENGTH_LONG).show(); } }; Request request = new Request(session, "me/likes", null, HttpMethod.GET, callback); RequestAsyncTask task = new RequestAsyncTask(request); task.execute(); 来源

Reduce the size of android facebook SDK

北城余情 提交于 2019-12-03 19:58:21
We are using facebook sdk to login the users to our app. But the SDK is pretty large hence it is increasing our apk size. Since we use only the login feature we do not require other modules of SDK (share, messenger etc). Is there any way we can add only the required features of SDK in the project? In case of google play services , additional maven artifacts have been added to the Google Repository that contain single domains of functionality.This means that we can include just those portions of Google Play services that your app uses. dependencies { compile 'com.google.android.gms:play

how to integrate facebook in android using facebook sdk 4.10

落爺英雄遲暮 提交于 2019-12-03 18:15:59
问题 Hi when I am using Login button in my XML, I am getting exception like "The following classes could not be instantiated: - com.facebook.login.widget.LoginButton (Open Class, Show Error Log)". how can I solve this.and I need to display login page how can I do this? and this is my XML <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android

Android & Facebook SDK : decoding pictures from /me/picture graph call

这一生的挚爱 提交于 2019-12-03 16:55:54
问题 EDIT: Anwser at the end of this post. I am trying to get a Facebook user's profile picture thanks to the inbuilt Facebook SDK's function Request() . I am using a /me/picture call to get the profile picture and convert it into a Bitmap . The call is working fine but I don't know how to interpret and parse the result returned from Facebook Here is the JSON that I get: { "FACEBOOK_NON_JSON_RESULT" : "����\u0000\u0010JFIF\u0000\u0001\u0002\u0000\u0000\u0001\u0000\u0001\u0000\u0000��\u0000\u0004*

Facebook - Post to wall from Android application

随声附和 提交于 2019-12-03 15:09:18
Post to wall from Android application... parameters.putString("app_id", mAppId); parameters.putString("picture", "http://fbrell.com/f8.jpg"); parameters.putString("name", "Facebook Dialog"); parameters.putString("caption", "Reference Documentation"); parameters.putString("description", "Dialogs provide simple interface applications..."); parameters.putString("message", "Facebook Dialogs are easy!"); I have specified above parameters and every time I am getting blank dialog (with title "Post to your wall") - and when I click on "Publish" button - it post correct values on given account... so

Facebook SSO example not working - “An error ocurred. Please try again later”

守給你的承諾、 提交于 2019-12-03 15:01:48
I'm trying to integrate facebook into my app and so have followed the tutorial at: Facebook Android but I can't get the first example (Single Sign-On) to work. When my app loads up I get the facebook dialog but it just says "An error occurred. Please try again later." with a facebook-style "Ok" button at the bottom and there is nothing in logcat: I followed the steps in the tutorial but I'm guessing there is something wrong with the APP ID or the hashkey generated by keytool. Here are the steps I followed: clone fb git. create fbSDK project. create own fb project and link the fbSDK as a