-6

I want to download PDF from link when first time user views them if webview.

After that want to save them in SdCard and when user request to view, Display stored PDFs in my application's activity.

I know about download things but stuck with PDF rendering and displaying.

Any help will be highly appreciated

Thanks in advance.

MobileEvangelist
  • 2,583
  • 1
  • 25
  • 36
  • Ok I got I can't update assets, what about pdf rendering or viewing in my own Application's Activity. – MobileEvangelist Jan 16 '13 at 09:59
  • Thanks for answers But Why you all or focusing on same thing can't you get another half of question.???? – MobileEvangelist Jan 16 '13 at 10:03
  • people down voting: either they know answer is pretty easy or they like to play with that down vote button. If you understand then point out whats wrong or give the answer. Down vote is not solution to my problem... :( – MobileEvangelist Jan 16 '13 at 10:08

3 Answers3

2

You cannot update assets.

instead you can download the file to sdcard and access the file from sdcard

Ram kiran Pachigolla
  • 20,897
  • 15
  • 57
  • 78
0

update assets is not possible. So You can save that file in to FileSystem(Internal or external based on your requirement) and retrive it back like below example.

Storing File in to InternalFileSystem.

  FileOutputStream fos = null;
try {
    fos = context.openFileOutput(filename, Context.MODE_PRIVATE);
    fos.write(pdfData.getBytes());
    fos.flush();
    fos.close();

} catch (FileNotFoundException e) {

} catch (Exception e) {

} finally {
    if (fos != null) {
        fos = null;
    }
}
Raj
  • 1,843
  • 2
  • 21
  • 47
0

once the apk is build of the project ,we cant modify the apk file. As the assets folder in inside the apk,so we cant copy the pdf file in assets folder. save it externally or internally in phone memory or sdcard.

deepak825
  • 432
  • 2
  • 8