Dipak Keshariya
Dipak Keshariya

Reputation: 22291

How to give SD Card File Path in following Code?

How to give SD Card File Path in following Code?

String s="file:///sdcard/tempImage.png";
parameters.putString("attachment","{\"name\":\"Android Facebook application By Martin\",\"href\":\"http://www.google.com/\",\"caption\":\"By google Technology \",\"description\":\"Description :- Android and iphone application \",\"media\":[{\"type\":\"image\",\"src\":\'"+ s + "',\"href\":\"http://s.facebook.com/connect.php?tab=iphone/\"}],\"properties\":{\"another link\":{\"text\":\"for more tips click here\",\"href\":\"http://www.google.com/\"}}}");

I use Above Code for Upload Image on Facebook Wall from my SD Card. But the Above Code is not Work, Please Help me.

Upvotes: 1

Views: 2783

Answers (2)

String filePath=Environment.getExternalStorageDirectory()+"/tempImage.png";
File mFile = new File(filePath);

Upvotes: 1

ingsaurabh
ingsaurabh

Reputation: 15269

Try below code

File mFile = new File(Environment.getExternalStorageDirectory(), tempImage.png);

Upvotes: 2

Related Questions