Hej,
Jag har lyckats ladda upp en bildström till Facebook med denna kod:
Kod:
byte[] data = null;
try {
Uri localSnapshotUri = getTempUri();
ContentResolver cr = getContentResolver();
InputStream fis = cr.openInputStream(localSnapshotUri);
Bitmap bi = BitmapFactory.decodeStream(fis);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bi.compress(Bitmap.CompressFormat.JPEG, 100, baos);
data = baos.toByteArray();
} catch (FileNotFoundException e) {
e.printStackTrace();
}
Bundle params = new Bundle();
params.putString("method", "photos.upload");
params.putByteArray("picture", data);
AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(mFacebook);
mAsyncRunner.request(null, params, "POST", new SampleUploadListener());
Har dock lite problem att få bilden till ett förutbestämt album på min profil.
Någon som har en exempelkod för att göra detta?
Tack på förhand.
/Chris