如何从我的应用上传电子书到 google play book?

How to upload a ebook to google play book from my app?

我想从我的 E-books collection 应用访问 Google Play 图书应用。目前我正在使用 FBReader 从我的应用程序中打开选定的 E-book。

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_
intent.setDataAndType(Uri.fromFile(file), "application/epub");
ComponentName cn = new ComponentName("org.geometerplus.zlibrary.ui.android", "org.geometerplus.android.fbreader.FBReader");
intent.setComponent(cn);

但是现在想上传电子书来玩看书

我的 EPub 类型是 "application/epub+zip",来自 Fragment 使用 getActivity().startActivity(i) 开始 Google Play Book 也 startActivity(i).

Intent i = new Intent();
i.setAction(android.content.Intent.ACTION_VIEW);
i.setDataAndType(Uri.fromFile(aBook.mProductFileName), "application/epub+zip");
getActivity().startActivity(i);

您可以使用MimeTypeMap检测地雷类型

MimeTypeMap myMime = MimeTypeMap.getSingleton();
String mimeType = myMime.getMimeTypeFromExtension("file_ext");