android-pdfview
android-pdfview copied to clipboard
display pdf from url
how i can display pdf from url or from server
From server we can not load , need to download to local memory using volley and render from the local memory in to view.
how i cam make user not able to see downloaded file or open it with any installed app
you can save the files in your application memory, like get your application package path and then save there. Just google we can
private File getOutputMediaFile(){ // To be safe, you should check that the SDCard is mounted // using Environment.getExternalStorageState() before doing this. File mediaStorageDir = new File(Environment.getExternalStorageDirectory() + "/Android/data/" + context.getPackageName() + "/Files");
// This location works best if you want the created images to be shared
// between applications and persist after your app has been uninstalled.
// Create the storage directory if it does not exist
if (! mediaStorageDir.exists()){
if (! mediaStorageDir.mkdirs()){
return null;
}
}
// Create a media file name
String timeStamp = new SimpleDateFormat("ddMMyyyy_HHmm").format(new Date());
File mediaFile;
String mImageName="MI_"+ timeStamp +".jpg";
mediaFile = new File(mediaStorageDir.getPath() + File.separator + mImageName);
return mediaFile;
}
Just try this method to save the pdf at this location
thanks , sir