News:

SMF - Just Installed!

Main Menu

Recent posts

#1
ePub Reader / Re: HTML Entities
Last post by kweckwor - August 08, 2024, 12:29:15 AM
Here is my current game plan for "named/character entity" substitution:
  • Automatically substitute the following entities:
    •  = 
    • ©=©
    • ®=®
    • ™=™
    • –=–
    • —=—
    • ‘=‘
    • ’=’
    • “=“
    • ”=”
    • …=…
  • For any named entity that is not mapped, display a space character. This should prevent truncating the content with a parsing error, which doesn't seem to me like a good user experience.
  • If your books have any other named entities that you would like to render, you can add those to the tool by updating a file called entity.txt in the app shared storage folder. I'll include more details in the online documentation for how to accomplish that when I release the updates.

If you (or anyone else reading this thread) have suggestions for other entities that should be handled by default, let me know and I'll consider adding those as well.

I've already implemented the above, but I want to test it more thoroughly, along with some other updates that are already in progress. I think I'll be able to release in the next 2-3 weeks.

Karl
#2
ePub Reader / Re: HTML Entities
Last post by kweckwor - August 06, 2024, 11:58:38 AM
Yes, ePub is made up of XHTML files and not HTML, and XHTML doesn't support all named entities as far as I know. In fact I think it only really supports a small set of about 5 entities. It should support the decimal version of the entity though (e.g. — can be substituted with — - I've verified that works fine).

I think the level of support for named entities varies with the browser and what is defined in the DTD that is applicable for the document type. In the case of my app, I'm using the Android WebView component (based on Chromium, which is lower level component and not a full browser like Chrome). In any case, the error displayed by the WebView renderer is that the mdash name is not defined. I was able to add the definition to the document using an !ENTITY tag and that works as well, but that's not something I can do in my app dynamically (once the document is rendered I can't inject the definition any longer).

So if you have control over the ePub content, you can substitute the decimal version of the entity rather than using the named version.

In the mean time, I'm going to see if I can do that substitution automatically. I don't think it should be a problem, but I don't know what the impact to performance will be. So I'll see how that goes. If all goes well, I might only support a subset of what I think are the more common named entities that I think might be used.

I'll post again with more details once I figure things out better.

Karl
#3
ePub Reader / HTML Entities
Last post by mgmino - August 05, 2024, 03:56:54 PM
It appears that some HTML Entities are not supported. The epub book has — which causes an error.
#4
ePub Reader / Re: Books not found with scan
Last post by LDad - June 04, 2023, 11:20:34 PM
Thank you!

The solution with this version of Android is a modification of your obb fix.
The folder exists within the "master" profile on the device, however it is invisible to the "child" profile.
Loading the books from the PC into the main obb folder works however there is a blockage in the permissions within the Fire OS to prevent the "child" profile from accessing USB connection control, so the only way to create the folder for that user is within the eLibrary software, within the Android file structure, but it snaps right into shape at that point.

Thanks much!
#5
ePub Reader / Re: Books not found with scan
Last post by kweckwor - June 03, 2023, 07:22:44 PM
OK, I've done some exploring with multiple profiles and here's what I can make out:


  • Most of my exploration was done in Android emulators, so it may not match exactly what you will experience in FireOS. FireOS 7.3.2.7 is supposed to be based on Android 9, however, so I suspect that the behaviour I see in the Android 9 emulator should match what you will see.
  • Each profile has it's own "sandbox" area in primary storage that it has access to. In this way, each profile is isolated from others so that any customization (most anyway - there are some exceptions which I won't get into here) are unique to that profile and don't impact any other. That isolation includes all files visible to the profile, not just files private to individual apps.
  • As I alluded to in my last post, secondary profiles don't have access to the SD card. This might be controlled by device manufacturers though, so may not be universally true. In the emulators (and in the physical devices I've tried), I had no access to SD card data from non-system applications in anything other than the primary profile.
  • All of the above means that a secondary profile won't have access to book files that are stored in the primary profile "sandbox". In order to make book files visible to secondary profiles, you'll need to copy those files to the secondary profile sandbox.
  • When you connect your device to a PC via USB, the PC exposes the primary storage area as a drive for the active user profile (and only one profile can be active at a time). So to load books into the secondary profile sandbox, you should switch to that profile (making it active) and then connect. The drive exposed on your PC will be the sandbox for that profile. If you copy book files there, they should be visible to the secondary profile on your device. Of course that means you need to have multiple copies of books files on your device, one for each profile, which means you'll eat up more storage.

On Android 9 (and presumably lower) there is a trick that works for me to share a single set of book files across profiles, thus avoiding the need to have duplicate copies of those files for each profile. It seems to be a hole in the profile sandbox implementation that Google left open up to Android 9, but appears to have been closed after that (in Android 10 the trick does not work for me). Whether the trick works for FireOS 7 or not I don't know, but since it is based on Android 9 it might. So I'll describe it here in case you want to try it:


  • With the primary profile active, navigate to folder /Android/obb. If the folder does not exist, create it. You should be able to do this through the PC while connected through USB or on the device using a file manager app.
  • Copy book files into this folder. You can create sub-folders to organize the files if you want.
  • Switch to the secondary profile. In the secondary profile you probably won't see the same /Android/obb folder automatically (I didn't anyway), but you can create one. Once created, the folder seems to get linked to the same shared folder used by the primary profile so any book files you copied there while that profile was active should "magically" appear in the new /Android/obb folder you just created in the secondary profile.
  • You should be able to scan that folder in my app now (after adding an appropriate root folder of course).

The obb folder seems to be the mechanism that older Android versions used for sharing files across profiles. Google appears to have disabled that (probably only for non-system app is my guess) as of Android 10, but it might still work prior to that.

Hopefully some of that information might help.

Karl
#6
ePub Reader / Re: Books not found with scan
Last post by LDad - June 02, 2023, 06:46:01 PM
Thanks!
In our case, no, not using an SD card, just the internal storage with roughly 500 books.
On the main profile I've had very few issues, and no trouble with the inventory showing up on a search, it's jus the kid profile that can't view the material. No issues opening the app, just viewing the books.
#7
ePub Reader / Re: Books not found with scan
Last post by kweckwor - June 02, 2023, 04:33:24 PM
It's been a little while since I've tried using multiple profiles in Android, but from what I remember, I was only able to see the device SD card from the primary profile and not from any secondary profiles. That seemed (at the time at least) to be intentional behaviour in Android (for reasons that I didn't really understand - it doesn't make much sense to me to restrict the device that way).

I don't know if that is related to what you are seeing or not. If you're not using an SD card for book files then it wouldn't be. But I thought I'd mention it.

I'll try setting up profiles and see if I can get anything to break. I'll post back when I've had a chance to test it out.

Karl
#8
ePub Reader / Re: Books not found with scan ...
Last post by LDad - June 02, 2023, 01:31:35 PM
I'd like to add a note on this thread, since I assume it's related.
I can find the books I've loaded on my profile, however I have the application on my kid's, and it refuses to see any books.
I've tried the following solutions myself:
I have tried to export (not successful, but I figure that's supposed to be for an additional devise anyhow)
I've tried to add a sub-folder (unsuccessful through the PC, the App can see it, but it doesn't find the books within it)
I added a root folder in app (unsuccessful, and the PC can't see the folder to include material).
I had run this app successfully on a child profile on an older Fire, and it was great because I could isolate the internet and my kid would be reading books rather than webbing and gaming and all over the place. I'd really like to be able to continue to do that!
my elibrary build is 5.0.1/162/54
my Fire is an 8th gen running 7.3.2.7
Thank you!
#9
eLibrary Manager / Re: VERSION 4.5.2 (2023-02-05)...
Last post by kweckwor - February 28, 2023, 12:52:45 AM
Version 4.5.4 is now live on the Amazon App Store.

For anyone who has been out of commission over the last couple of weeks, I apologize. You should be able to update to get the fix now.

Karl
#10
eLibrary Manager / Re: VERSION 4.5.2 (2023-02-05)...
Last post by kweckwor - February 26, 2023, 02:32:45 PM
An update on this issue:

I've gotten my hands on a Fire (5th gen) with FireOS 5.7.0.0 and have been able to figure out what the issue is with version 4.5.2 of my app. Version 4.5.4 does in fact fix the issue (as confirmed above).

The issue should only happen if you have a Fire device on FireOS 5.x with a recent version of WebView (i.e. 100). If your Fire has FireOS 5.x with older WebView (i.e. version 59), or if your FireOS version is anything other than 5.x (either older or newer), then you should not have a problem with version 4.5.2. If you are experiencing the issue though, you will need version 4.5.4 of my app (or any version other than 4.5.2 - the issue is specific to that one).

Unfortunately, Amazon is still dragging its feet clearing up my Amazon App Store submission status for both Full and Basic versions of my app, so as of this morning, I am still unable to post the fix to that app store. I will let you know when I finally release 4.5.4 with the fix.

If you have access to other app stores like Google Play, or if you are OK with side-loading, I've posted details about those options above.

Sorry for how long this is dragging out, but I'm not sure what else I can do other than communicate with Amazon through public forums to try and get some focus on the issue - which I have been doing but with as of yet limited success.