Hi
I am working on a projet where i have to download image. I do not understand why on the device simulator i succed in download image but when i install the app in my
android mobile phone i can not download image. Here is the code i use to download the image.
public void Download(String token,String format,String matricule,String annee,String mois) throws IOException{
String url= "
http://195.24.198.42/handlers/mycenadiapi.ashx?matricle="+matricule+"&type=getslipImage&dtype="+format+"&sy="+annee+"&sm="+mois+"&r=0&token="+token;
String home = FileSystemStorage.getInstance().getAppHomePath();
char sep = FileSystemStorage.getInstance().getFileSystemSeparator();
FileSystemStorage.getInstance().mkdir(home + sep + "photos"+sep+"images");
Util.downloadUrlToFile(url,home+sep+"photos"+sep+"images"+sep+"photos.jpeg", true);
String filename = home+sep+"photos"+sep+"images"+sep+"photos.jpeg";
InputStream stream = FileSystemStorage.getInstance().openInputStream(filename);
OutputStream out = FileSystemStorage.getInstance().openOutputStream(home+sep+"mphoto.jpeg");
Util.copy(stream, out);
Util.cleanup(stream);
Util.cleanup(out);
Display.getInstance().execute(home+sep+"mphoto.jpeg");
}
please i need your help