I am trying to get the URL of a image I have saved to a SD card/ external storage of device. I need the
string of URL to pass to setPicture(string url) of facebook share dialog SDK so I can upload this image to FB from device.
So far have tried getting the URL from URI of a file path to string:
File imagePathFile = new File(savedImagePath);
try{
userImageURL = imagePathFile.toURI().toURL();
Log.d(TAG, "File URL for saved image on FB: " + userImageURL);
}catch(MalformedURLException ex)
{ //ex.printStackTrace();
}
userImageURLString = userImageURL.toString(); setPicture(userImageURLString)
//userImageURLString = "file:/storage/emulated/0/dive_photos/image4373.png";
But keep getting error:
(#100) picture url not properly formed
any input much appreciated.
Ciaran