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

4

1 回答 1

0

您可以通过 FTP 下载它并将其保存在您的 SD 卡上,看看如何使用 android 获取 ftp 文件,这是您可以在 PDF 阅读器中打开它的方法:

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);
于 2013-07-26T02:46:32.663 回答