![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Dec 2013
Device: Pocketbook lux 4
|
![]()
Help, I have pocketbook lux 4, I know java but I'm willing to learn C for this.
I really really really want to have a function which allows me to randomly open a book in my library. For those moments when I can't decide what to read among my 200 ebooks. First, Is this doable? As in, what are the limits of the apps. Second, where can I find actual documentation. What I find is like 10 years old, so not sure I can use on lux 4. Seeing how active this forum is, thought I might ask here. I did find some recent github projects but not sure if i can program something that has access to the library. |
![]() |
![]() |
![]() |
#2 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 177
Karma: 100516
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
|
Speaking off the head without looking into, but I have the impression that for that a shell script in the applications/ directory should be easier to put together than a compiled executable linked with whatever sdk. Like in, count all the *.epub files in candidate directories, pick the $RANDOM-th pathname, and call the reader app with that as argument. Of course there might be fancier or obscurer ways, like querying the native book database.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
|
Shell script is easiest way to go
Some psedo code(not tested just how I would approach it) #!/bin/sh #Get connection to DB and select the count of book IDs declare -a numOfBooks=$(sqlite3 /system/explorer-3/exlplorer-3.db "SELECT ID FROM BOOKS_IMPL") #Use random to get an ID size=${#numOfBooks[@]} randomBookID=$(($RANDOM % $size)) #Somehow, invoke reader program to open the ID |
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Dec 2013
Device: Pocketbook lux 4
|
that is a great starting point! thank you!
![]() |
![]() |
![]() |
![]() |
#5 | |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46
Karma: 388296
Join Date: Aug 2022
Location: USA
Device: Pocketbook Inkpad Color 3
|
Quote:
It sound like an overkill but this way you can also populate your to-read list. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 78
Karma: 7126
Join Date: May 2023
Device: PocketBook Era
|
See my GitHub link for a sample shell script I made that interacts with the databases for a better idea than the pseudo code I wrote above.
https://github.com/jjrrw174/PocketBo...ith-PB-Library |
![]() |
![]() |
![]() |
#7 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13
Karma: 95478
Join Date: Mar 2022
Device: Pocketbook X (1040), Pocketbook 602 pro
|
If you really want to learn some C or C++ you still can!
Not much has changed and the "10 years old" documentation is pretty relevant today. I found the code examples from https://github.com/pmartin/pocketbook-demo/tree/master very helpful. For the SDK usage, I followed https://github.com/Skeeve/SDK_6.3.0. I guess it should be possible to connect to PB's sqlite databases similarly to the scripts from this thread. Also, there are some projects allowing you to write programs in other languages:
|
![]() |
![]() |
![]() |
#8 |
Enthusiast
![]() Posts: 34
Karma: 10
Join Date: Jun 2018
Device: Tobo Touch 2.0; Kobo Aura One; PocketBook Era
|
KOReader is mostly in Lua - and that runs on PocketPooks.
You could just copy the code they use for invoking Lua, and then write in that. |
![]() |
![]() |
![]() |
Tags |
programming, random book |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to sync Pocketbook eReader with Pocketbook Android App | duskwind | PocketBook | 13 | 04-01-2020 04:00 PM |
PocketBook Basic 2 Screen Advice | Staphoent | PocketBook | 5 | 10-30-2014 01:21 PM |
App advice for a newbie? | ryublu | Android Devices | 23 | 08-28-2011 05:30 AM |
Need advice from Pocketbook 902 Users | Anthony.h80 | Which one should I buy? | 2 | 08-14-2011 05:22 AM |
Android Interested in Developing an Android App, but Deficient in Programming Skills? | walt526 | enTourage Archive | 6 | 07-13-2010 11:49 AM |