Rikaikyun 0.15

rikai1
After nearly a year without a major update I managed to motivate myself to push a number of improvements to Rikaikyun. The key one is speed. I found my app to be acting sluggish with files that were 500+KB in size. A single volume of a WEB novel is usually this big and while I can split the volume into chapters, managing this many files becomes annoying. That’s why I rewrote the way the text is presented. Previously all text was dumped into the web view, but that caused those speed issues. On the other hand, I noticed that the dictionary doesn’t affect the speed of the app much, even though it takes some 70MB of memory. So I figured that keeping only the visible text in the web view should make the app work faster and it actually worked (few MB files can be still a bit too clunky to use). This was a bit tricky to implement, but I’ll spare you the details. Let me just say that I kept the scrolling mechanism to keep things simple.

Another thing I did was improve the security of loading random html files. The previous release of Rikaikyun wasn’t 100% resistant to loading external JS or inline JS. The new version however, should strip any JS from loaded document, or at least prevent it from executing.

rikai2

Since many newer Android devices lack physical back button, I added on screen back button to various menus, to make the app easier to use on those devices.

As for the changes that are visible more easily, I added chapter positions to progress bar and navigation submenu. The navigation submenu allows you to jump chapters and also jump to specific position in the document.

As usual, the APK can be grabbed from here.

Advertisements

Rikaikyun Beta released

I reached the stage at which Rikaikyun appears to be fully usable (though I haven’t made a lot of tests), so I decided to release it to public (not that it was hidden from public before). You can grab the APK and source code from here. Note the APK will probably not work on anything less than Android 4.

screenshot

You can also test the app in Chrome using the device emulation mode (you have to run Chrome with the –allow-file-access-from-files flag on). For running the app in chrome there is also a special Chrome hack option that allows emulating pressing back button by going back in browsers history.

Rikaikyun – a reader app for Japanese text on Android

On desktop computer there are such wonderful browser plugins like Rikaichan, Rikaikun and Rikaisama that will translate Japanese words for you if you move your mouse over them.

Apparently Rikaichan might have (or have not) worked in an older version of FireFox for Android, but currently your best bet, when it comes to dictionary supported reading of Japanese on your Android device of choice is Jade Reader (it even works on a E Ink Android device like Onyx Boox T68 Lynx). However, this app haven’t seen an update in ages and is missing quite a few functions. The source code is available on the internet here. I tried my luck altering the code, but I only managed to make small alterations to an older version of the app. The never version uses different external libraries and it’s not well documented, so I had issues even compiling it…

I was trying to make an app that uses Rikaichan (Rikaikun to be exact) in Node-Webkit and by accident I found out that the Rikaichan core code runs even if I run it directly on a html page. This made me believe that it might be possible to run Rikaichan in PhoneGap. As it turned out, it can be used inside PhoneGap (I suspect it won’t work on any Android younger than 4.0.4 due to the amount of RAM it requires)!

Above I mentioned core code, what I meant by that is that I didn’t manage to make Rikaichan work as a whole, but just the dictionary module (data.js). Thankfully the dictionary module can be used on it’s own and the fancy display can be always recreated from scratch. Using it is actually quite simple, though I had hard time telling what is what inside Rikaikun plugin. Maybe I’ll make another post about that.

So, I started a new project name Rikaikyun. Currently it’s not very impressive as it just loads first chapter of Genji Monogatari (you can’t pick a specific file yet) while offering no customization whatsoever, but the point is the basic functionality is there. By basic functionality I mean, you can tap a word and it will open a dictionary popup. I have big plans for this app (furigana, word stats etc.), but I’m not sure how far I can push the thing performance-wise (PhoneGap isn’t the most efficient platform, though newer Android devices seem to handle it well enough).

Anyway, the project is still in a very early stage and it can be found at https://github.com/jahu00/Rikaikyun. It should be possible to even test it without putting it on your Android device. Both Chrome (with –allow-file-access-from-files option) and FireFox should be able to handle the file (though touch events and zoom won’t work in FireFox). To test it on desktop just run the index.html found in www folder. For android, you would have to make PhoneGap build it for you, or use the PhoneGap developer app.

If there is any progress with this app, I’ll try posting info about it here.