1
BlackBerryでpdf、doc、ppt、またはxlsをプログラムで開くにはどうすればよいですか?BlackBerryでpdf、doc、ppt、またはxlsを開く
BlackBerryでpdf、doc、ppt、またはxlsをプログラムで開くにはどうすればよいですか?BlackBerryでpdf、doc、ppt、またはxlsを開く
最善のアプローチは、ドキュメントを表示するためにサードパーティのビューアを購入し、それを起動することです:
String path = "file://SDCard/info.doc";
String contentType = MIMETypeAssociations.getMIMEType(path);
Invocation invocation = new Invocation(path, contentType, null, false, ContentHandler.ACTION_OPEN);
Registry registry = Registry.getRegistry(MyApp.class.getName());
try {
ContentHandler[] handlers = registry.findHandler(invocation);
if (handlers != null && handlers.length > 0) {
invocation.setID(handlers[0].getID());
registry.invoke(invocation);
} else {
Dialog.alert("Error");
}
} catch (Exception e) {
Dialog.alert("Error");
}
私は、プログラムを通じてPDF文書を読むことをお勧めします。実際には、iPhoneでwebviewを使ってドキュメントを読むことができます。私の質問は、ブラックベリーのPDF文書を読むためのオプションやコントロールはありますか?前もって感謝します。 – Finder
コンテンツを文字列として取得するか、ユーザーのためにコンテンツを開くことを意味しますか? – Tamar
Webサービスからバイナリデータを取得しています。 – Finder