This repository has been archived by the owner on Aug 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 349
Publish photo
Roman Kushnarenko edited this page Oct 29, 2014
·
2 revisions
You can publish (upload) photo to default album or to any other album you have.
Photo
can be created from:
Bitmap
File
byte[]
Initialize callback listener:
OnPublishListener onPublishListener = new OnPublishListener() {
@Override
public void onComplete(String id) {
Log.i(TAG, "Published successfully. id = " + id);
}
/*
* You can override other methods here:
* onThinking(), onFail(String reason), onException(Throwable throwable)
*/
};
Build photo for publishing:
// This is the image you want to upload
Bitmap bitmap = ...
// create Photo instance and add some properties
Photo photo = new Photo.Builder()
.setImage(bitmap)
.setName("Screenshot from #android_simple_facebook sample application")
.setPlace("110619208966868")
.build();
Publish photo to application (default) album:
mSimpleFacebook.publish(photo, onPublishListener);
Publish photo to specific album:
String albumId = ...;
// publish photo to album
mSimpleFacebook.publish(photo, albumId, onPublishListener);
You can publish photo or up to 6 photos with dialog.
- You can do it without login ✨
- You can do it without permissions ✨
- Currenly only Bitmap is supported
-
setName()
andsetPrivacy()
doesn't matter here, since it can be configured from dialog only - You should verify that you have in you manifest
<provider>
. Read setup project.
Build photo for publishing:
// This is the image you want to upload
Bitmap bitmap = ...
// create Photo instance and add some properties
Photo photo = new Photo.Builder()
.setImage(bitmap)
.setPlace("110619208966868")
.build();
Publish photo with dialog:
mSimpleFacebook.publish(photo, true, onPublishListener);
Build photos for publishing:
List<Photo> photos = ...
Publish photos with dialog:
mSimpleFacebook.publish(photos, onPublishListener);
-
Setup
-
Login/Logout
-
Publish 🔻
-
Requests/Invite
-
Get
-
Additional options
-
Samples