0

I am working on android application. I have my pdf files in ftp server. Now I need to display them in my android application using a pdf reader. Is that possible? How can I achieve this? Please help me in this regard.

Thank you in advance

Hannoun Yassir
  • 20,583
  • 23
  • 77
  • 112
Amrutha
  • 575
  • 4
  • 9
  • 29

1 Answers1

0

You can download it via FTP and save it on your SD card have a look on how get ftp file with android and this is how you can open it in a PDF reader :

PackageManager packageManager = context.getPackageManager();
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("application/pdf");
packageManager.queryIntentActivities(intent,PackageManager.MATCH_DEFAULT_ONLY);

Intent pdfintent = new Intent();
pdfintent.setAction(Intent.ACTION_VIEW);
Uri uri = Uri.fromFile(yourfile);
pdfintent.setDataAndType(uri, "application/pdf");
context.startActivity(pdfintent);
Community
  • 1
  • 1
Hannoun Yassir
  • 20,583
  • 23
  • 77
  • 112
  • Hi thank you for the response...but small clarification..you said that we can download it from ftp server...do you mean downloading manually and storing in sdcard or you mean via coding we can download? – Amrutha Jul 26 '13 at 05:39
  • You can download it programmatically from the ftp server – Hannoun Yassir Jul 26 '13 at 18:40