How to share photo on Facebook through my Android App?
I am trying this, I got success in posting a note but how can I do it for a picture?
import net.xeomax.FBRocket.FBRocket; import net.xeomax.FBRocket.LoginListener; import net.xeomax.FBRocket.ServerErrorException; import android.app.Activity; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; import android.os.Bundle; public class Facebook extends Activity implements LoginListener { private FBRocket fbRocket; int i; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); shareFacebook(); } public void shareFacebook() { fbRocket = new FBRocket(this, "PitchFork TRY","c3968bbdd9dc7f44a8e05b7346f46673"); if (fbRocket.existsSavedFacebook()) { fbRocket.loadFacebook(); } else { fbRocket.login(R.layout.main); } } //@Override public void onLoginFail() { fbRocket.displayToast("Login failed!"); } //@Override public void onLoginSuccess(net.xeomax.FBRocket.Facebook facebook) { // TODO Auto-generated method stub fbRocket.displayToast("Login success!"); Drawable bm = getResources().getDrawable(R.drawable.abook); try { facebook.setStatus("Hi, Friends this is post by me from my Android App, "); fbRocket.displayDialog("Status Posted Successfully!! "); } catch (ServerErrorException e) { if (e.notLoggedIn()) { fbRocket.login(R.layout.main); } else { System.out.println(e); } } } }
from this code I am able to post any text but how can I share photo?
链接地址: http://www.djcxy.com/p/26224.html