I'd like to introduce myself to this nice forum (where I've been lurking since the start of last December when I got my Kindle 3 Wifi) with a Kindlet :-)

As I like to fiddle with my devices I was eager to learn how to program it. For a start (after giving up building a native toolchain, it was too boring) I resorted to learn about Kindlets. Well, I do not have KDK access, but nevertheless, the openly accessible documentation is growing. And I like to say thanks for the kapp rudimentary application published on the forum here.

So if you like to just play Sudoku or need another app to see how things can be done, here it is: a Sudoku kindlet. And yes, I'm aware there are others available.

For now, it can read .sdm databases (one line per 81 field sudoku puzzle). Use the menu to open a puzzle database file. You can find some on the web, e.g. here: http://www.sudocue.net/download.php
The kindlet will tell you in the file dialogue the folder where to put them.

In order to run the kindlet you need to prepare your devices developer keystore to accept the keys the kindlet is signed with. The corresponding developer.keystore file is attached to this posting. It's the one from the "kapp" demo kindlet published in the "how to write Kindlets" thread here.

Probably you will want to run other kindlets too. In order to run kindlets signed with different keys, you will have to merge your keystores.
You can merge keystores by issuing the following command on your desktop (the keytool application must be in the path):

The keystore must be put onto the device, _outside_ the area accessible while in USB storage mode. It goes at "/var/local/java/keystore/developer.keystore". You need to put the keystore there either by creating a fitting upgrade package (I did not do that yet) or by other means (I copied via scp, by means of USB networking, but Wifi would work as well).

The kindlet itself just goes into the usual "documents" folder.

Have fun with the kindlet and its source code.

A few words on the source: it's a netbeans project but only needs "ant" to compile. Just issue "ant jar" and it will build and sign a jar file (you need to rename it to .azw2 suffix when copying). The automated signing will only work on POSIX (read: Linux) shells, though, Windows users might need to do that manually.
Sources expect a folder "KDK" on the same level as the kindlet project basedir, containing a folder "lib", which itself should contain the jars from the device, as there are "Kindlet", "log4j", "json-simple", "xerces". You find the exact file names needed in the sources in the .properties file in the "lib" folder.

Update, 2011-01-06, 15:10 UTC: fixed manifest to make it run, fixed bug in isSolved()
and another note: You move the cursor with the direction keys, enter numbers with 0-9 if you have them, otherwise either the top row (qwer...) or the block qweasdzxc. You toggle between solving and notetaking with "m".

When I compile this and install it, it fails with a crash.log entry saying that there's a failure due to Network-Access-Grants in the manifest. I took that out (does it use the network?) and it still failed. Any idea?

When I compile this and install it, it fails with a crash.log entry saying that there's a failure due to Network-Access-Grants in the manifest. I took that out (does it use the network?) and it still failed. Any idea?

Darn, that's my fault. I'll upload updated sources ASAP. For now, open the manifest.mf file and edit the network policy to "Sponsored", then recompile. I edited that after my last test (I intended to do another test on this) and totally forget about it. I'll give updated files in a few hours when I'm back home from work. I'll also try and make a screenshot then to show what you can expect.

thank you, quite right, that's what you get for doing C&P too much :-)

The manifest fix as well as a fix for this bug should now be in the freshly-updated files.

Sooner or later I should upload it to github or Google Code, I think. That will probably happen the coming weekend. I'd like to include some puzzles from the start and maybe link to a suitable pseudo-firmware-update file for including (or even better: appending to) the keystore. Also, a menu item for jumping to a specific puzzle within the current database would be handy, too. And in the longer run, it would be nice if the Kindlet remembers all solutions already done so you have proper state for all puzzles within a certain database. That would be database- and puzzle specific state storage. In the much longer run, some puzzle generators could be included. Maybe some open source code could be re-used for that.

PS: I would be very fond of a public "experimental" developer.keystore that includes all currently known developer keystores and brings the possibility (by including the private key and publishing its password, such as has been done by the kapp-demo-kindlet author) to sign further software. That way we could have _one_ main entry point for users whishing to run custom, non-KDK (i.e. inofficially) built Kindlets.

Darn, that's my fault. I'll upload updated sources ASAP. For now, open the manifest.mf file and edit the network policy to "Sponsored", then recompile. I edited that after my last test (I intended to do another test on this) and totally forget about it. I'll give updated files in a few hours when I'm back home from work. I'll also try and make a screenshot then to show what you can expect.

I already had tried sponsored (with a lower case s) and got the same result. It appeared to complain about network-access-grants whether it containined no line at all, a bogus one "whatever" or sponsored.

Working fine now thanks. It appears that when I recomplied with different manifest contents and scp'd them over to the kindle, it was somehow caching the old manifest or something until I cleared it all out and refreshed it.

Yes, I noticed during development that you need to do a full framework restart to drop the cached manifest. That was when I was thinking about a proper title for the Kindlet :-) So when changing the manifest, you'll need a "/etc/init.d/framework restart" on the device. A full reboot will do, too.

Hi,
...
Probably you will want to run other kindlets too. In order to run kindlets signed with different keys, you will have to merge your keystores.
You can merge keystores by issuing the following command on your desktop (the keytool application must be in the path):

I use the one that comes with a regular JDK. In my case it's OpenJDK, here running on ArchLinux. But I certainly remember grabbing the description from somewhere on the web and it was not looking like it was OpenJDK specific but rather general JDK stuff...

http://www.sudoku.com/boards/viewtopic.php?t=6291
The Patterns Game Results: Contain puzzles with various degrees of difficuly that all have the same initial shape. The last figure on each puzzle line is the rating according to Sudoku Explainer.