facebook-android-sdk

Facebook SDK for Android - set Application ID programmatically

邮差的信 提交于 2019-11-30 05:21:30
I have a native Android app that needs to connect to a different Facebook app (different Application ID) based on an app setting that can be changed at runtime. Imagine the app can be set to point to DEV, TEST, or PROD. When pointed to DEV the FB Application ID should be "1". When pointed to TEST the FB Application ID should be "2". etc. The problem is the UiLifecycleHelper from the Facebook SDK automatically reads the "com.facebook.sdk.ApplicationId" from the AndroidManifest.xml during the onCreate phase. There doesn't appear to be a way to set this programmatically. Is it possible to use

How to get facebook profile picture of user in facebook SDK Android

萝らか妹 提交于 2019-11-30 05:17:37
I used facebook 3.6 sdk . i want to get profile picture from graph user , last time i got image but now it returns null Bitmap. I used following code private void onSessionStateChange(Session session, SessionState state, Exception exception) { if (session.isOpened()) { Request.newMeRequest(session, new Request.GraphUserCallback() { @Override public void onCompleted(GraphUser user, Response response) { if (user != null) { try { URL imgUrl = new URL("http://graph.facebook.com/" + user.getId() + "/picture?type=large"); InputStream in = (InputStream) imgUrl.getContent(); Bitmap bitmap =

How to avoid showing already-authorized to app dialog in Android Facebook SDK

霸气de小男生 提交于 2019-11-30 05:17:32
I'm getting a completely useless page when I use the Single Sign on for Facebook's Android SDK. "You have already authorized app. Press "Okay" to continue. This page would destroy user experience. How can I remove this screen? Thanks in advance. Note: we won't see this issue If the FB app is installed in device. It will be raised only if the FB app is not available in device. Jesson Atherton I am using the latest Facebook SDK 3.6 I believe and have tested so far on HTC One & Galaxy s3 mini . This page does not display itself for me at any point. I followed the API guide here... https:/

android facebook publish photo

你说的曾经没有我的故事 提交于 2019-11-30 04:08:00
After looking on the net for 2 days I finally decided to post on SO. Well I simply want to publish a photo in my android app on to facebook. AM using the official android-facebook-sdk. I imported to example project and in the upload section add my code to upload photo. like mUploadButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { Bundle params = new Bundle(); params.putString("method", "photos.upload"); Bitmap temp = BitmapFactory.decodeResource(getResources(),R.drawable.facebook_icon); ByteArrayOutputStream baos = new ByteArrayOutputStream(); temp.compress(Bitmap

How to solve Facebook tools:replace=“android:theme”?

为君一笑 提交于 2019-11-30 02:40:31
I have compile 'com.facebook.android:facebook-android-sdk:4.16.0' My manifest: <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" ... <application android:name=".YandexProvider" android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AutoTheme" tools:replace="android:theme"> How to solve compile error: Error:Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : Attribute activity#com.facebook.FacebookActivity@theme value=(@android:style

Is it possible to extend Facebook tokens with extendAccessTokenIfNeeded in an Android app?

吃可爱长大的小学妹 提交于 2019-11-30 00:36:53
I think this might effect a lot of Facebook/Android developers and yet there does not seem to be that much discussion on the topic... My question Has anyone successfully refreshed a token using the extendAccessTokenIfNeeded function? If you did have success, what version was the device (or emulator) running? Background I received an email from Facebook saying the offline_access permission will be deprecated from May 1st 2012 and Facebook recommended upgrading to their latest SDK. Fine. I upgraded to the latest SDK, the official Facebook app is installed on my device and (eventually!) Single

How to get facebook profile picture of user in facebook SDK 3.0 Android

两盒软妹~` 提交于 2019-11-30 00:29:48
i am using facebook SDK 3.0 i have to get profile picture of user login. Here is the code I use: URL image_value = new URL("http://graph.facebook.com/"+id+"/picture" ); profPict=BitmapFactory.decodeStream(image_value.openConnection().getInputStream()); But I don't get the desired result. Hai nguyen You should change your code following: URL image_value = new URL("http://graph.facebook.com/"+id+"/picture" ); Possible GET parameters for the URL can be found here: https://developers.facebook.com/docs/graph-api/reference/user/picture/ Use https:// instead of http:// i faced the same problem. URL

Android - Facebook SDK 3 - How to login programmatically without LoginButton

孤街浪徒 提交于 2019-11-29 22:10:54
I am writing an app that integrates with Facebook SDK, to share some (string) content as a wall post. Now, I made the HelloFacebookSample work. However It uses their LoginButton to log the user in. I don't want that. All I want to do is click my share button in the actionbar and share it to facebook. Therefore I want to login programmatically, I tried to emulate what the LoginButton does but no success so far. I get 12-06 15:34:33.180: E/AndroidRuntime(19493): java.lang.UnsupportedOperationException: Session: an attempt was made to reauthorize a session that has a pending request. public class

Creating a class for Facebook SDK 3.0 on Android

蹲街弑〆低调 提交于 2019-11-29 17:54:14
Is it possible to create a class to encapsulate the Android SDK on android? i.e - I don't want to clutter my activity with all the FB sessions and stuff, I want to have a class that I can call and it will do the job. For example, FacebookSDK sdk = new FacebookSDK(); sdk.publish(); For now I couldn't find a way to do this, without using Fragments or cluttering my activity with the facebook code. Many Thank! In short, no. Your activity needs to be notifying the Facebook SDK of lifecycle events in order to properly store state and handle the UI flow to and from the Facebook SDK activities.

how to integrate facebook in android using facebook sdk 4.10

好久不见. 提交于 2019-11-29 16:55:41
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:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android