Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > PocketBook > PocketBook Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-15-2020, 04:13 AM   #1
GerReader
Connoisseur
GerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of it
 
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
Currently porting the SGT Puzzle collection, need some coding help

Hi,

I bought a Pocketbook Touch HD 3 start of this year, and I used the covid lockdown to look into the PocketBook SDK, and ported the open source "Simon Tatham's Portable Puzzle collection" to my device.

By looking at several code repositories with other PocketBook apps that I found at GitHub and elsewhere, I made some quite good progress and am now at a stage where it is turning into a serious and usable app:

https://github.com/SteffenBauer/PocketPuzzles

(MIT License, so completely open source and free, no commercial interest at all, just personal enthusiasm)

To further progress with developing the app, I have some questions:

- Is there anything comparable to Menus and Dialogs in the SDK for Buttons? So far I low-level coded buttons by drawing bitmaps, catching screen tap events and checking if the x/y coordinates are within the button bitmap.

- I'd like to switch the game chooser screen to a scrolled area, similiar to the book browser library. There are functions like `AddScrolledArea` in `inkview.h`, but I'm unsure how to use this exactly. Is there example code somewhere?

- There is a special type of menu (for example when long-tapping a book in the home screen) that opens with some kind of 'arrow' pointing to the tapped object. What object in the SDK is this?

- One big element that is still missing in my app is individual configuration of game parameters. There is something like `ConfigEditor` in the SDK, but I'm completely unsure if I can use this, or if I need to low-code manual configuration.

Would be really great if somebody could help me out, thanks a lot for answers!
GerReader is offline   Reply With Quote
Old 10-15-2020, 08:41 AM   #2
nhedgehog
Guru
nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.
 
Posts: 746
Karma: 619508
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
That project sounds very interesting.
I can't help with the specific questions but there are some pocketbook programming projects at Sourceforge which could probably give some more insights. To name a few that could help with your project.
https://github.com/pmartin/pocketbook-demo
https://github.com/blchinezu/pocketbook-coolreader
https://github.com/yuryfdr/pbtk
nhedgehog is offline   Reply With Quote
Advert
Old 10-15-2020, 09:31 AM   #3
GerReader
Connoisseur
GerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of it
 
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
Quote:
Originally Posted by nhedgehog;4047263
To name a few that could help with your project.
[url
Hi, thanks for the links. Unfortunately these are exactly those that I used to consult for getting into PocketBook app development

The code at `yuryfdr/pbtk` indeed hints that there is no high-level button interface in the SDK, so buttons need to be coded low-level.

By the way, my app is actually quite usable so far with only few things missing (as mentioned the main missing thing is individual config, there are pre-configured presets for all games), and I have included a compiled binary at `build/SGTPuzzles.app`. I'd also be very glad for people who try it out (installation of course on own risk) and report bugs or improvement tips. Either as issue reports at GitHub, or here in this thread.

I'm also interested if the app works on other devices than the Touch HD 3. I would update my top post to include a list of devices where it also works.
GerReader is offline   Reply With Quote
Old 10-15-2020, 10:00 AM   #4
EastEriq
Groupie
EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!
 
Posts: 169
Karma: 100516
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
I had a go with a couple of games on my PB631, and think that Towers didn't want to accept my right solution (bug of the puzzle, whatever....)
Anyway, that means that the app runs ok on the device. No crash, no display problem, fine for HD.

I also did a quick search on github for "pocketbook". I got 294 matches. Many are not relevant (several e.g. seem to interpret PocketBook as one of several variations of a chinese electronic wallet app for android), but there are beyond the three links mentioned above. Maybe you were there too.

For instance, I ran into this, which appears to implement a button with low level drawing operations. Which is anyway not a proof that an API method is missing.
EastEriq is offline   Reply With Quote
Old 10-15-2020, 10:11 AM   #5
GerReader
Connoisseur
GerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of it
 
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
Cool to see that it works also on another device

I'm not quite sure what happened in your round with the Tower puzzle, how exactly did it not accept your solution? Was the "Puzzles is solved!" popup missing? If this happens again, could you make a screenshot?

Yeah, my GitHub repository for this app is currently not very much known and has no watchers or stars, so when searching for "PocketBook" it appears somewhere very late on page 26 or so... It appears quite at the top when sorting by "Recently Updated".
GerReader is offline   Reply With Quote
Advert
Old 10-15-2020, 10:13 AM   #6
nhedgehog
Guru
nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.
 
Posts: 746
Karma: 619508
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
Congrats, it is a nice addon to the PB devices.
Tested it on PB 631 and PB 740, working fine so far.
Some games need a manual thought, something like this:
https://www.chiark.greenend.org.uk/~...doc/index.html
nhedgehog is offline   Reply With Quote
Old 10-15-2020, 10:16 AM   #7
GerReader
Connoisseur
GerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of it
 
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
Quote:
Originally Posted by nhedgehog View Post
Some games need a manual thought, something like this:
https://www.chiark.greenend.org.uk/~...doc/index.html
This should actually already be included in the app, when launching a game and clicking on the game menu button, there should be an entry "How to play". I have copied at least the basic game rules from the SGT documentation pages there.
GerReader is offline   Reply With Quote
Old 10-15-2020, 10:59 AM   #8
nhedgehog
Guru
nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.
 
Posts: 746
Karma: 619508
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
Found it. Had only a quick look into everything without going deeper before.
nhedgehog is offline   Reply With Quote
Old 10-15-2020, 12:06 PM   #9
EastEriq
Groupie
EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!
 
Posts: 169
Karma: 100516
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
Quote:
Originally Posted by GerReader View Post
- Is there anything comparable to Menus and Dialogs in the SDK for Buttons? So far I low-level coded buttons by drawing bitmaps, catching screen tap events and checking if the x/y coordinates are within the button bitmap.

- I'd like to switch the game chooser screen to a scrolled area, similiar to the book browser library. There are functions like `AddScrolledArea` in `inkview.h`, but I'm unsure how to use this exactly. Is there example code somewhere?

- There is a special type of menu (for example when long-tapping a book in the home screen) that opens with some kind of 'arrow' pointing to the tapped object. What object in the SDK is this?

- One big element that is still missing in my app is individual configuration of game parameters. There is something like `ConfigEditor` in the SDK, but I'm completely unsure if I can use this, or if I need to low-code manual configuration.
Maybe pbterm has a bit of all four? I don't know how an inkview call should look like in the code, but I don't spot at first sight anything in its codebase which screams of tedious low level



EastEriq is offline   Reply With Quote
Old 10-15-2020, 12:27 PM   #10
EastEriq
Groupie
EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!
 
Posts: 169
Karma: 100516
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
Quote:
Originally Posted by EastEriq
Maybe you were there too.
Quote:
Originally Posted by GerReader View Post
Yeah, my GitHub repository for this app is currently not very much known...
I meant, maybe you have already skimmed through the list of matches "pocketbook".


EastEriq is offline   Reply With Quote
Old 10-15-2020, 12:42 PM   #11
EastEriq
Groupie
EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!
 
Posts: 169
Karma: 100516
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
deleted

Last edited by EastEriq; 10-15-2020 at 12:55 PM.
EastEriq is offline   Reply With Quote
Old 10-15-2020, 03:16 PM   #12
EastEriq
Groupie
EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!EastEriq rocks like Gibraltar!
 
Posts: 169
Karma: 100516
Join Date: Jan 2018
Device: Cybook Orizon, PocketBook Touch HD
Small redrawing bugs:
  • pink: nodes dragged above the top edge, motion is correctly limited at the margin, but part of the temporary image is not erased
  • blue: a node can be dragged below the drawing area and becomes invisible. The empty dot at the former position is no more a draggable handle; the node reappears once the screen is tapped somewhere else
Attached Thumbnails
Click image for larger version

Name:	scr0009.png
Views:	329
Size:	53.5 KB
ID:	182758  
EastEriq is offline   Reply With Quote
Old 10-16-2020, 03:47 AM   #13
GerReader
Connoisseur
GerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of it
 
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
Quote:
Originally Posted by EastEriq View Post
Small redrawing bugs:
Good catch

Already on it. The first one looks trivially to fix. Second one is more tricky.
GerReader is offline   Reply With Quote
Old 10-16-2020, 08:44 AM   #14
GerReader
Connoisseur
GerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of it
 
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
Quote:
Originally Posted by GerReader View Post
Already on it. The first one looks trivially to fix. Second one is more tricky.
I hopefully fixed both, and I uploaded an updated binary.

I searched a little bit more in GitHub, and might have made progress towards my initial questions, could be of interest to also other PocketBook app developers:

a) https://github.com/pmartin/plop-reader : I found something there called "ContextMenu", this could be the solution to my third question (the 'special' menus pointing to an object)

b) https://github.com/svn2github/pocket...master/memorum : This looks like a project using the ConfigEditor.
GerReader is offline   Reply With Quote
Old 10-18-2020, 08:03 AM   #15
ezdiy
Zealot
ezdiy can grok the meaning of the universe.ezdiy can grok the meaning of the universe.ezdiy can grok the meaning of the universe.ezdiy can grok the meaning of the universe.ezdiy can grok the meaning of the universe.ezdiy can grok the meaning of the universe.ezdiy can grok the meaning of the universe.ezdiy can grok the meaning of the universe.ezdiy can grok the meaning of the universe.ezdiy can grok the meaning of the universe.ezdiy can grok the meaning of the universe.
 
Posts: 121
Karma: 156515
Join Date: Oct 2019
Device: KT, KPW4, PB740-2
For context menu, and scrollable list of bitmap entries:

https://github.com/ezdiy/arm-pocketb...nkview.h#L1800

The modal dialog (icon + text + 1-3 buttons beneath):

https://github.com/ezdiy/arm-pocketb...nkview.h#L1849

+ there are some other utilities (progress bars and such). For the rest, you're left with the drawing primitives (ie FillAreaRect + DrawString and such).
ezdiy is offline   Reply With Quote
Reply

Tags
app, programming, puzzles, sgt puzzles


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simon Tatham's portable puzzle collection? Biep Kobo Developer's Corner 2 12-27-2021 10:42 AM
Introducing Sgt. Steve Sgt Steve Introduce Yourself 2 03-14-2013 05:32 PM


All times are GMT -4. The time now is 07:45 PM.


MobileRead.com is a privately owned, operated and funded community.