0

I am having a bitmap in my Activity and I tried to convert this into a String like below

Bitmap bitmap = getIntent().getParcelableExtra("data");

  strpostimageurl=   BitMapToString(bitmap) ;

//method to convert bitmap to String

  public String BitMapToString(Bitmap bitmap){
     ByteArrayOutputStream baos=new  ByteArrayOutputStream();
     bitmap.compress(Bitmap.CompressFormat.PNG,100, baos);
     byte [] b=baos.toByteArray();
     String temp=Base64.encodeToString(b, Base64.DEFAULT);
     return temp;

}

And I am sending this String to Facebook Graph api Like below

String res=  

UrltoValue.getValuefromUrl("https://graph.facebook.com/"+Login.facebookid+"/feed?access_token="+accesstoken+"&method="+"post"+"&message="+"hi"+"&picture="+strpostimageurl);

But I am getting illegal Character response

12-06 14:47:16.488: E/post response(21627): Illegal character in query at index 281: https://graph.facebook.com/100001574672236/feed?access_token=AAAGaMRblwW4BAOdRuZCHNSxtpAPd8O05fXBDY0yF10sWf7tv1wlW7xX6WituirF6g7bZAMCflHPb5qLzeNYOmItEZBzeewNZBNF09KrpZBgZDZD&method=post&message=hi&picture=iVBORw0KGgoAAAANSUhEUgAAALcAAAChCAYAAACF4S4ZAAAABHNCSVQICAgIfAhkiAAAIABJREFU

How to send Bitmap to Facebook api to show an image

user1871951
  • 105
  • 3
  • 8

0 Answers0