07-23-2012, 03:13 PM | #1 |
Connoisseur
Posts: 58
Karma: 63518
Join Date: Apr 2012
Device: KT
|
Quick and Dirty Tic Tac Toe Kindlet - Kind Let Toe
So, this is my first Kindlet.
It allows you to play the popular TicTacToe game against yourself or an human opponent. I created this mostly for educational purposes and only tested it on the Kindle Touch and would wonder if it would work on any other Kindle without further improvements (For unknown reasons i used JPanels+MouseListeners instead of JButtons+ActionListeners. I think the Actionlisteners would be more likely to work on the KNT) I'm planning to go into detail about the development process, but at the moment i only have limited time and my internet will possible be gone for a few weeks in the future, so i will post this now, before i have forgotten everything i have done. First of all i used the JDK from this site (untrusted source?!) and configured my eclipse to use this JDK (Window->Preferences->Java->Installed JREs->Add... and later in the create-project-dialog select the right JRE) The source .zip file also contains an Applet-class, that can be used to view the Kindlet on your Home-Computer. This was great for testing. When i was done coding, i exported the Project as a Jar-file (not runnable) out of Eclipse and manually edited the META-INF/MANIFEST.MF file to contain Code:
Manifest-Version: 1.0 Main-Class: com.mobileread.mapeper.kindlettoe.KindLetToeKindle Implementation-Title: Kind Let Toe Implementation-Version: 0.1 Implementation-Vendor: MaPePeR Extension-List: SDK SDK-Extension-Name: com.amazon.kindle.kindlet SDK-Specification-Version: 2.1 Toolbar-Mode: persistent Font-Size-Mode: point After that i signed the jar file with an bash script: (also quick and dirty): Code:
keystorefile=${keystorefile:-"developer.keystore"} KEYSTORE_PASS=${KEYSTORE_PASS:-"password"} YOUR_ALIAS=${YOUR_ALIAS:-"test"} jarsigner -keystore ${keystorefile} -storepass $KEYSTORE_PASS $1 dk$YOUR_ALIAS jarsigner -keystore ${keystorefile} -storepass $KEYSTORE_PASS $1 di$YOUR_ALIAS jarsigner -keystore ${keystorefile} -storepass $KEYSTORE_PASS $1 dn$YOUR_ALIAS (I also installed this keystore on my device, for more information on how to install a keystore see the Merged Developer Keystore Thread) finally i renamed the .jar to .azw2 and copyed it to my Kindle documents Folder. For the sake of file extensions i cannot upload the compiled azw2 Greetings MaPePeR |
07-23-2012, 04:55 PM | #2 |
Carpe diem, c'est la vie.
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Thanks for adding it to the Kindlet index. Now you have definately earned the 2600 karma upgrade I gave you before.
Thanks! |
07-23-2012, 05:02 PM | #3 |
Connoisseur
Posts: 58
Karma: 63518
Join Date: Apr 2012
Device: KT
|
Thanks.
I try to be as useful, as i can, but i still have a lot of work to do and a lot of things to learn Good Night MaPePeR PS: When i have successfully moved to the new flat and got my internet running, i will try to write a more complex post about which problems i encountered and how i solved them. |
07-23-2012, 06:04 PM | #4 | |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Nice work! Will surely test it once I can get to it.
Just two minor notes: Quote:
Code:
<attribute name="Toolbar-Style" value="none"/> |
|
07-31-2012, 04:25 AM | #5 | |
Groupie
Posts: 159
Karma: 20390
Join Date: Feb 2009
Device: none
|
Quote:
Also, you mentioned using the ixtab's Font Hack repository keystore key. Is that also included in the large Merged Keystore one? If not, it should be. |
|
07-31-2012, 05:09 AM | #6 | |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
Yes it is. It's using the well-known "test" key which is included in the keystore - and which I recommend that everybody uses, because then we don't need to keep updating that keystore with new certificates. |
|
08-06-2012, 05:36 PM | #7 | |
Groupie
Posts: 159
Karma: 20390
Join Date: Feb 2009
Device: none
|
Quote:
Thanks. I hear ya. Having one key to do it all and using that one for any and all new kindlets just makes sense and much easier for the masses. Last edited by inameiname; 08-06-2012 at 05:38 PM. |
|
09-04-2012, 07:45 PM | #8 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
okay so I got my J2sdk from here http://www.oracle.com/technetwork/ja...4.2_30-sol-JPR
I went with version 1.4.2_19 After realising it was the font declarations for the standard Spoiler:
That were failing to be parsed properly from font.properties (For some crazy reason) I have replaced Eclipse europa with Juno. See how I fare now. Thanks for the pointers. (um and yes I also have the 17 version you quoted for good measure) EDIT: DOH! And still it fails. The fonts are there I checked. Hmm... Warning: Cannot convert string "-b&h-lucida-medium-r-normal-sans-*-140-*-*-p-*-iso8859-1" to type FontStruct Blast... IN OTHER NEWS: Spoiler:
EDIT: I still get the warning, but at least it will jar stuff up now. One step further yay. Last edited by twobob; 09-04-2012 at 10:06 PM. |
09-04-2012, 10:41 PM | #9 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Are there any special Gotchas? for a 3.3? thanks? I have the jar outputted for a hello world, signed, renamed and I'm not seeing it. probably peback.
I'll upload the errant jar... Thanks for your patient attention. The docs are a little foggy on some things but the info is there if you persist. In my case I have a weird persistent error but it's related to the IDE far as I can make out. That I can ignore. Cheers. Hmm. I uploaded an updated effort with the kitchen sink thrown in. still no joy. not wishing to hijack this excellent thread with Kindle 3 noise. I will take this elsewhere in the morning. Thanks : ) EDIT REMOVED VERY BASIC SRC Last edited by twobob; 09-05-2012 at 08:43 AM. |
09-05-2012, 04:22 AM | #10 | |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
Hint: I really, really suggest to use ant to build these packages. You can check the build.xml of any of my projects for examples of how to correctly package and sign things (and for a correct manifest). |
|
09-05-2012, 06:01 AM | #11 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Hokay. Thanks : )
I intentionally left Extension-List: SDK SDK-Extension-Name: com.amazon.kindle.kindlet SDK-Specification-Version: 2.1 Toolbar-Mode: persistent Font-Size-Mode: point out as I develop only for a kindle 3. Are there any special Gotchas? for a 3.3? thanks. Like for example a difference in the manifests... All the 3 examples I find just have the entries I posted. I will resume reading and stop hi-jacking this thread. |
09-05-2012, 06:17 AM | #12 | |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
Code:
Extension-List: twobob twobob-Extension-Name: com.amazon.kindle.kindlet twobob-Specification-Version: 2.1 That's (probably) K5-specific and can (probably) be left out. Note: I'm saying "probably" all the time because I can't speak for models other than the K5. However, the Kindlets I wrote for the K3 (back when I had one) didn't have these entries. |
|
09-05-2012, 06:21 AM | #13 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
okay. well since all this info - much of the source info - is now two years out of date, and my best attempts to get "Best in class" examples amount to a handful of lone-wolf projects. I will annotate somewhere - possibly the wiki - my experiences with getting it going under eclipse - on a 3 - as it stands today.
I am assuming the merged keystore now contains the keys on this thread - as it claims to be the test one. (just stating my assumptions) EDIT: You noted that they are above... Cheers. I'll added them in now. No change. I'll see what else might be amiss - I updated my upload. EDIT: I used your developer.keystore from your font hack thread, and I'm looking into ant now. Last edited by twobob; 09-05-2012 at 06:53 AM. |
09-05-2012, 06:59 AM | #14 |
(offline)
Posts: 2,907
Karma: 6736092
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Almost. Now you forgot the "twobob-Specification-Version: 2.0", so I still can't open it on the K5.
|
09-05-2012, 07:39 AM | #15 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Updated it and shoved the source in for good measure.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tic Tac Toe for kindle touch | aditya3098 | Kindle Developer's Corner | 4 | 03-11-2012 02:53 PM |
New Kindle Game - Tic Tac Toe | koland | Deals and Resources (No Self-Promotion or Affiliate Links) | 2 | 02-05-2011 10:31 AM |
New Western/Mystery Novella From Pete Peterson: CATCH A KILLER BY THE TOE | UntreedReads | Self-Promotions by Authors and Publishers | 0 | 09-02-2010 12:17 PM |