我正在开发Android应用程序。我在ftp服务器上有我的pdf文件。现在我需要使用pdf阅读器在我的Android应用程序中显示它们。那可能吗?我怎样才能做到这一点?请帮助我。
提前谢谢
答案 0 :(得分:0)
您可以通过FTP下载并将其保存在SD卡上查看how get ftp file with android,这就是您在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);