3rd party apps that can open EPUB files via Intent? - Android Software Development

Say I want to do the following:
Code:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/epub");
At the moment I'm having a tough time finding an app out there that has a filter setup for epub, and was wondering if anyone has any ideas.
My intent is to load an epub file in an external application, which will be initiated from mine. Tried using Aldiko, but it doesn't seem to have any filters setup for this.

Related

[Q] Problem with Astro & ePub files

When I first rooted my Nook without installing a ROM, I followed the instructions in this thread to set up shortcuts to ePub files using Astro (I was unable to ask this question in that thread). It worked perfectly until I recently installed CM7. Now I can't get Astro to open any ePub files. Previously it would just open up in the default Nook Reader. Now I get a message saying that Astro cannot open an ePub file. I verified that the extension was listed in the Extension Editor, but still had no luck.
I followed subsequent instructions in that same thread to install Linda. The only problem is that the Android Nook App is not showing up as a possible app to use to open an ePub file. I'd rather stick with the Nook app rather than downloading some other ePub reader. Can anyone suggest why this worked before installing CM7 but does not work now, and suggest a possible solution?
Android apps advertise to the operating system what their capabilities are by registering what's called an "intent". So, a picture viewer app might register an intent that says "I can open JPG and PNG files". Then whenever another app uses that intent, you'll get the pop-up that lets you choose which app to handle the request.
My guess is that the Nook Reader in the stock firmware has an "ePub reader" intent registered, but the Nook App from the market does not, which is where the whole thing is breaking down. Try installing another reader app (FBReader, Aldiko, etc) that has the proper intent registered, and see if you can make it work that way. If you can, then you know the problem is not with CM7, but with the Nook app. If the problem is with the Nook app, there's not much you can do, other than asking B&N to include that intent in a future update of the app.
Skunkeye said:
Android apps advertise to the operating system what their capabilities are by registering what's called an "intent". So, a picture viewer app might register an intent that says "I can open JPG and PNG files". Then whenever another app uses that intent, you'll get the pop-up that lets you choose which app to handle the request.
My guess is that the Nook Reader in the stock firmware has an "ePub reader" intent registered, but the Nook App from the market does not, which is where the whole thing is breaking down. Try installing another reader app (FBReader, Aldiko, etc) that has the proper intent registered, and see if you can make it work that way. If you can, then you know the problem is not with CM7, but with the Nook app. If the problem is with the Nook app, there's not much you can do, other than asking B&N to include that intent in a future update of the app.
Click to expand...
Click to collapse
That must be the problem. It works with Aldiko. I guess I'm stuck with it.
Thanks for the reply.

[Q] How to export Notes and Highlights on Touch? Cppy and Paste?

Hello,
Thanks in advance. I searched the forum and elsewhere for these answers.
Can one export Notes and Highlights with a rooted Nook Touch. If so, how and which app should one download? Which are best?
If one puts Kindle app on a Nook Touch, does one get the functionality of exporting notes that I believe the Kindle app has?
Is there an a reader app that allows for Copying/Pasting/exporting? There is this unanswered thread that I think covers the same topic or similar:
http://forum.xda-developers.com/showthread.php?t=1180368
Much to my dismay, I just discovered that I can not export or backup Notes and Highlights that I create on a Nook Touch. I wonder what % don't realize this when they buy the device.
I do not think that "Nook For PC" does any of this as it only syncs bookmarks across devices:
http://www.barnesandnoble.com/u/nook-for-pc/379002322/
Once again thank you
I've been able to export from moon reader plus on my nook color - if this app works on nook touch it's the best solution I've found.
any solution found?
I want to root my nook, but I don't want to lose my highlights...!!!
I have been on the same quest for a few days now. I have not found a particularly good solution, but I do have a way to preserve highlighting.
When you use the kindle app on android and sideload a book in .mobi format (i.e. you place the .mobi file in /sdcard/kindle folder), and then make highlights or notes, it creates a .mbp file in the same directory. You can then move the .mobi and .mbp file into other kindle apps (other device, pc, etc), and your notes and highlights are preserved.
If I could find a way to get the .mbp file in /sdcard/kindle to automatically sync to the appropriate PC folder, it would be nearly perfect.
The advantage of .mobi files have over .epub is that .epub standard does not seem to include annotations. At the moment, you are somewhat confined to the Amazon ecosystem, but for now, this seems the best solution I've found so far.
---------- Post added at 10:18 AM ---------- Previous post was at 10:04 AM ----------
I have been on the same quest for a few days now. I have not found a particularly good solution, but I do have a way to preserve highlighting.
When you use the kindle app on android and sideload a book in .mobi format (i.e. you place the .mobi file in /sdcard/kindle folder), and then make highlights or notes, it creates a .mbp file in the same directory. You can then move the .mobi and .mbp file into other kindle apps (other device, pc, etc), and your notes and highlights are preserved.
If I could find a way to get the .mbp file in /sdcard/kindle to automatically sync to the appropriate PC folder, it would be nearly perfect.
The advantage of .mobi files have over .epub is that .epub standard does not seem to include annotations. At the moment, you are somewhat confined to the Amazon ecosystem, but for now, this seems the best solution I've found so far.
Any updates
Does anybody have any updates on this? I've been looking at how to save my highlights and notes because I want to update to 1.1.
I noticed that Calibre is testing saving notes from the Kobo reader. I think this would be the best way if they ever do it for the NST. However, that would be a long term solution because I don't see them doing it within the next month or so.
Any help on this would be greatly appreciated. Thanks,
The first post in this thread shows how to backup highlights and annotations. http://forum.xda-developers.com/showthread.php?t=1346748 I haven't tried it yet but I will check back when I do it.
this is a a feature really needed...anybody working on it??
Here's a direct link to the post referenced above. Highlights and notes are stored in databases.
http://forum.xda-developers.com/showpost.php?p=20069243&postcount=5
I haven't tested it yet.
Anyone interested in exploring -- you may want to look into some of the apps in the Android Market that allow for viewing and editing databases on a rooted device:
https://market.android.com/search?q=root+database+viewer&c=apps
Please post any findings!
MJ
mjj777 said:
Please post any findings!
Click to expand...
Click to collapse
It’s easy to write SQL script, but it’ll be few manual steps - not for everybody.
I’m not good enough yet to write GUI app, but it looks like nice and easy one to start with.
The problem is B&N doesn’t provide any API to work with nook specific features, like display book thumbnail, get books in library, get books on shelf, etc.
Once this framework is available, “assembling” apps should be piece of cake.
Manual Solution...
Besides backing up highlights and annotations (mentioned above) http://forum.xda-developers.com/showpost.php?p=20069243&postcount=5
I am following this thread that just started on somebody asking a possible way to do this automatically to dropbox or something similar. Which I think would be awesome! http://forum.xda-developers.com/showthread.php?t=1676579. However, this really doesn't solve the issue of easily reviewing highlights and annotations or exporting them to excel or word for a more pleasant viewing experience.
In the meantime as I am reading I have my iPhone open and I am writing down comments and passages and then marking the page number. I am doing this in the Onenote app which can be synced to my computer.
It makes reading not as fun when you have to go to a different device and type something in. However, I am guaranteed not to loose it, and it stays organized in a onenote folder I named "books" and section is the books title. Putting the page number also allows me to later go back and go to that specific page for further details and it is my understanding it should also match with the paper-bound version page number.
I find it amazing there is not an easier way. However, I have heard rumors the backing up a annotations and highlights might/could happen in Calibre. I think they began trying it with the Kobo reader. I think this would be ideal.
CoolReader can highlight, take notes and export.
The only problem is that it doesnt have DRM so it cannot read
books with DRM (purchased or rented books).
--
Is there any news on this side?
to me would be enough to having the possibility to share via mail.
does anyone knows if an app for android would work for this and if it feasible ?
Ok
i've just create a very basic app that export the highlithed text to an txt file inside the sd card.
source code is here (i started yesterday with android, so it's crappy).
https://github.com/esseti/NookTouchExporter
here the apk https://github.com/esseti/NookTouchExporter/tree/master/bin
it requires root permission.
feedbacks/collaborations anything is welcomed.
Off-hand, you might want to use a constructor for Annotation instead of setting things:
Code:
public class Annotation
{
private String book;
private String hltext;
public Annotation(String book, String htltext)
{
this.book = book;
this.hltext = hltext;
}
}
question
Hi, first, thanks for placing the apk and second, how do I use it?
I already install, I gave root permission, but nothing happens when you touch the icon
thanks
I forgot to subscribe to the thread. i made some changes, now it should have a button.
apk is here https://github.com/esseti/NookTouchExporter/tree/master/out/production/NookExporter
esseti said:
I forgot to subscribe to the thread. i made some changes, now it should have a button.
apk is here https://github.com/esseti/NookTouchExporter/tree/master/out/production/NookExporter
Click to expand...
Click to collapse
I've just tried this (md5sum: fc31f1bd16a95ebd5c41823cb9bbc57d) on my 1.2.1 UK Nook rooted with NookManager, and it has some problems.
When I start it, it asks for root via SuperUser and I grant it root permissions permanently. However, the attempt to copy annotations.db fails:
Code:
I/ActivityManager( 788): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x14000000 cmp=it.stefanotranquillini.nookexporter/.TestDatabaseActivity }
I/System.out(24021): books 1here we are
W/System.err(24021): io ex
W/System.err(24021): java.io.FileNotFoundException: /data/data/com.bn.nook.reader.activities/databases/annotations.db
E/TC ( 1035): KPICollector: 1368871897842 ActivityManager background {"component":"com.harasoft.relaunch/.AllApplications"}
E/TC ( 1035): KPICollector: 1368871897875 ActivityManager foreground {"component":"it.stefanotranquillini.nookexporter/.TestDatabaseActivity"}
Needless to say, the file does exist:
# ls -l /data/data/com.bn.nook.reader.activities/databases/annotations.db
-rw-rw---- app_0 app_0 11264 2013-05-07 15:57 annotations.db
Click to expand...
Click to collapse
I think you probably need to build a command line (e.g. su /system/xbin/cp /data/data/com.bn.nook.reader.activities/databases/annotations.db blahblah/databases.db) then exec() it. exec()ing su doesn't, AFAICS, give your app the power to do anything it likes as root. Chainfire wrote a nice doc: http://su.chainfire.eu/.
If I use an adb shell to manually copy the file over, it seems to export OK. I'd suggest, though, dumping all the columns so that adding import functionality later is possible.
cowbutt said:
I've just tried this (md5sum: fc31f1bd16a95ebd5c41823cb9bbc57d) on my 1.2.1 UK Nook rooted with NookManager, and it has some problems.
When I start it, it asks for root via SuperUser and I grant it root permissions permanently. However, the attempt to copy annotations.db fails:
Code:
I/ActivityManager( 788): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x14000000 cmp=it.stefanotranquillini.nookexporter/.TestDatabaseActivity }
I/System.out(24021): books 1here we are
W/System.err(24021): io ex
W/System.err(24021): java.io.FileNotFoundException: /data/data/com.bn.nook.reader.activities/databases/annotations.db
E/TC ( 1035): KPICollector: 1368871897842 ActivityManager background {"component":"com.harasoft.relaunch/.AllApplications"}
E/TC ( 1035): KPICollector: 1368871897875 ActivityManager foreground {"component":"it.stefanotranquillini.nookexporter/.TestDatabaseActivity"}
Needless to say, the file does exist:
I think you probably need to build a command line (e.g. su /system/xbin/cp /data/data/com.bn.nook.reader.activities/databases/annotations.db blahblah/databases.db) then exec() it. exec()ing su doesn't, AFAICS, give your app the power to do anything it likes as root. Chainfire wrote a nice doc: http://su.chainfire.eu/.
If I use an adb shell to manually copy the file over, it seems to export OK. I'd suggest, though, dumping all the columns so that adding import functionality later is possible.
Click to expand...
Click to collapse
i've no idea why it fails .
anyway i'll take a look later on. if you want code is on github and you can change it and submit as a patch (or whatever they called it), then i'll merge it.
Hello,
I haven't found a solution to the original question posted on this forum but I would like to share something that I think most Kindle users will benefit from.
Amazon has made it possible for Kindle users to make notes and highlights on their favorite passages or selection and these can be accessed again on their site. However, it can take up time and be difficult to obtain sometimes.
There is an iOS app that will be released this November 2013 called Snippefy that will make it easier for Kindle users to read and share their notes and highlights all in one place. They will also be able to export these to Evernote, Dropbox and email. I'm not able to post the link to the site here but basically it's at "snippefy dot com"
I just wanted to share this with all of you as you might find it useful.
Thanks!
Two ereaders I've found that do a good job of allowing for annotations, and have good export options are Moon+ Reader (version 1.6.5b) and Mantano Reader (version 2.2.12).
They are no longer being developed in a way that supports the Android 2.1 platform, which is what the Nook runs on, so the versions I listed above are the most recent versions that will work on the Nook, you'll have to get the old APKs and sideload them if you want to use that. Their controls and interface are amazing in my opinion, perhaps Moon+Reader 1.6.5b > Mantano Reader 2.2.13, however, the display is in my opinion quite low quality and unacceptable for extended reading.
A better option to keep your eye on is Page Turner (https://play.google.com/store/apps/details?id=net.nightwhistler.pageturner.ads&hl=en]). The developer is very active and mindful that a large portion of the user base uses the Nook ST, and so continues to have features support the Android 2.1 platform. The current beta version which will be released in the next weeks has just added support for highlighting, annotating and bookmarks. The plan for the next version is to allow for simple export process of these additions, so keep an eye on it.

Playing with Otter Intents and Book Shortcuts

Unlike most, I've found myself actually liking the content-oriented otter launcher on stock. But, being a geek, I'm never satisfied so I was playing around with GoLauncher and ADW to see if I could get the best of both worlds. This is what I've uncovered so far.
To launch a specific part of Otter, such as the book library, you need to send the following type of intent:
Code:
Action: com.amazon.kindle.otter.action.SHOW_BOOKS
Category: android.intent.category.HOME
The valid actions are:
Code:
com.amazon.kindle.otter.action.SHOW_BOOKS
com.amazon.kindle.otter.action.SHOW_NEWS
com.amazon.kindle.otter.action.SHOW_APPS
com.amazon.kindle.otter.action.SHOW_DOCS
com.amazon.kindle.otter.action.SHOW_MUSIC
com.amazon.kindle.otter.action.SHOW_VIDEO
com.amazon.kindle.otter.action.SHOW_WEB
If you want to open a specific book, then you send an intent like this:
Code:
Action: android.intent.action.VIEW
Data: kindle://book/?action=open&book_id=AMZNID0%2FB002WB0XW0%2F0%2F
All that you want to change in that data string is the escaped book_id field. '%2F' just means '/', so you can see it's really just 'AMZNID0/(Book ID)/0/'. You can extract the book's ID from any Amazon Kindle product page (go to Manage your Kindle on Amazon.com). So, the book ID in this example is: B002WB0XW0 and the URL of the product page is http://www.amazon.com/dp/B002WB0XW0 (plus some useless SEO keywords and tracking cruft I omitted).
Launching documents is very similar, but I assume each document's id is user specific. To see what it is, fire-up logcat ("adb logcat ActivityManager *:S") and look for a message like this:
Code:
D/ActivityManager( 1452): Starting: Intent { act=android.intent.action.VIEW dat=
kindle://book/?action=open&book_id=AMZNID0%2FAEMEN728GNT2MXUF3VMENDMEY4SDV5AZ%2F
4%2F flg=0x10000000 cmp=com.amazon.kindle/.UpgradePage } from pid 3749
As for how to launch intents, several launchers let you do this. Sadly, Amazon gutted Settings.apk, so we're left with no provider for android.intent.action.pick_activity (ditto for shortcuts and folders). Therefore, we need an app like QCustomShortcut that will allow us to construct a custom intent shortcut, then directly add the icon to the launcher without going through the activities or shortcut menus. Sadly, that's not listed as compatible with the Fire, so you have to install it on another Android device and sideload the APK (which is kept under /mnt/asec, not /data/app, BTW).
In the end, I decided to return to Otter, but figured I could save someone a bit of trouble or hopefully even spark some ideas by posting this. It's all pretty basic stuff, but finding/launching intents and what-not took me a bit to sort through this evening so I suppose there may be others on this neophytic ledge between being a newb and a guru that I keep finding myself on.
Hi izomiac,
I'm interested in what you said. I'm creating an android that can open any kind of documents, including ebooks.
Unfortunately I could not see the kind of information you show in my logcat.
You said :
Launching documents is very similar, but I assume each document's id is user specific.
Click to expand...
Click to collapse
Could you give me an example to how open an ebook not downloaded by the amazon kindle app?
Really thank you for your post, it helps me a lot.
I don't think the Kindle app can directly open Documents/Books that haven't been downloaded. When I just tried that the Kindle App (for ICS) stayed on the splash screen and never loaded anything. I suspect Amazon uses some sort of push service rather than an intent to start an automatic download.
For logcat, what I did was run the logcat command using ADB, then launch the document I wanted to see the ID for on the Kindle using the stock launcher.
izomiac said:
To launch a specific part of Otter, such as the book library, you need to send the following type of intent:
Code:
Action: com.amazon.kindle.otter.action.SHOW_BOOKS
Category: android.intent.category.HOME
Click to expand...
Click to collapse
Hello,
I know this is an old post, but I am trying to get this to work on my HDX. Looking at both the Otter manifest, and the logcat, it seems not a lot has changed (except that now you can install qCustomSHortcut).
However, when I try to create a shortcut to my books library, I get a permission denied error. When I test the shortcut, the output says that this
Code:
com.amazon.SHOW_CONTENT_LIBRARY
action is required. Any thoughts?
The direct book link works well. Thank you.
~Leko

Loading Google Earth through application

Hi,
I am currently trying to open a KML file from my application to view a tour of point locations.
I am creating this KML on a webservice and passing this to the device, then save the string to a file locally with kml extension.
The problem is that when I pass this KML file to Google Earth app it returns a 'Not Found :" error after the google earth app opens.
I am opening the app using the following snippet:
if(file.exists())
{
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file), "application/vnd.google-earth.kml+xml");
ntent.putExtra("com.google.earth.EXTRA.tour_feature_id", "flight");
startActivity(intent);
}
If I browse with Astro to the file location and click on it the Google Earth app will load the tour and start playing!
Any ideas or anyone encountered this problem?
Thanks!

Question: How to set an intent to launch Temblast Reader in Relaunch?

Hey guys, I have a question. I'm sure somebody out there has done this. I am making Rooted NST's for my friends as gifts, and I think it would be really easy for them to be able to use relaunch to open the .epub format books I have included for them. The best reader app I have found is @Renate NST's temblast reader app. It works with the page turning buttons, and in conjunction with @nmyshkin's NoIR app that he made, it makes for a seriously long battery life while reading. I gave my best friend a rooted NST for his birthday (beginning of August). He has read an entire book, and still hasn't charged it. Thanks for that, guys.
Anyway, what I'm trying to do is be able to use Relaunch to open .epub books. I've included a screenshot of the menu that has the ability to set intentions or even to open an application based on the filetype of the file selected. However, temblast reader does not show on the list of possible apps to launch. I tried using Titanium Backup to move temblast reader to system, but still to no avail. Anyone who knows better how to set an intent, and perhaps knows the language needed to do this would probably be much better suited to helping.
Thank you so much in advanced.
PS: That intent that is typed in the line for .epub files is my own feeble attempt at trying to get temblast reader to run as a system app. Please ignore that. :cyclops:
I'm not sure about Relaunch, but this should work fine:
Code:
# am start -a android.intent.action.VIEW -d file:///sdcard/Books/progit.epub
I typed it in like you said, and it didn't work. Maybe it's just not meant to be done on Relaunch.
Here's what it looked like when I tried to launch an .epub file.
Black screen.
I also thought maybe it was because my epub files are in My Files/Books so I added that in, and it didn't change anything.
I really appreciate your help and effort in this. Perhaps you know of an intent simply for "Reading Now"? I could use that in a different application.
Do you actually have that book "Pro Git"?
If you don't, there's no chance that it will be opened.
"Last Book" was actually a broadcast originally. Try:
Code:
# am broadcast -a com.bn.nook.launch.LAST_BOOK

Categories

Resources