Skip to content
This repository

Simon Tatham's puzzles, with my Android port added. See README for build instructions.

Octocat-spinner-32 .externalToolBuilders Further crime against VCS/build systems: add the docs, so contributor…
Octocat-spinner-32 .settings Revert Windows-ness in build (to be fixed portably later); add new Ec…
Octocat-spinner-32 assets Obvious translations for Pearl. Non-obvious TODO...
Octocat-spinner-32 gen mv *.c jni/ to avoid Eclipse build failure; remove crash handler as i…
Octocat-spinner-32 icons Merge branch 'upstream'
Octocat-spinner-32 jni mv *.c jni/ to avoid Eclipse build failure; remove crash handler as i…
Octocat-spinner-32 po Obvious translations for Pearl. Non-obvious TODO...
Octocat-spinner-32 res mv *.c jni/ to avoid Eclipse build failure; remove crash handler as i…
Octocat-spinner-32 src Fix a couple of warnings.
Octocat-spinner-32 unfinished New puzzle! Or rather, new-ish, because this one has been lying around
Octocat-spinner-32 .classpath mv *.c jni/ to avoid Eclipse build failure; remove crash handler as i…
Octocat-spinner-32 .cproject Enable stylus-based mode, e.g. rotational UI in Net.
Octocat-spinner-32 .gitignore Ignore pearl binary.
Octocat-spinner-32 .project Multi-column chooser; extract chooser/file picker dialogs to classes.
Octocat-spinner-32 AndroidManifest.xml mv *.c jni/ to avoid Eclipse build failure; remove crash handler as i…
Octocat-spinner-32 Buildscr Comment the Mac build out of Buildscr, since I no longer have a
Octocat-spinner-32 CHECKLST.txt Updates to the new-puzzle checklist, since the world has moved on.
Octocat-spinner-32 LICENCE Merge branch 'upstream'
Octocat-spinner-32 Makefile.doc Further crime against VCS/build systems: add the docs, so contributor…
Octocat-spinner-32 PuzzleApplet.java Remove a stray diagnostic.
Octocat-spinner-32 README Try to make life even easier in Eclipse - add the icons, so no need t…
Octocat-spinner-32 README-non-android Try to make life even easier in Eclipse - add the icons, so no need t…
Octocat-spinner-32 Recipe Add a section to mkfiles.pl to build a makefile that compiles the OS X
Octocat-spinner-32 android-TODO Try to make life even easier in Eclipse - add the icons, so no need t…
Octocat-spinner-32 build.properties Allows building with r19 build tools.
Octocat-spinner-32 build.xml Revert Windows-ness in build (to be fixed portably later); add new Ec…
Octocat-spinner-32 chm.but Ability to build a .CHM for Puzzles. I haven't yet arranged for it
Octocat-spinner-32 chm.css Ability to build a .CHM for Puzzles. I haven't yet arranged for it
Octocat-spinner-32 devel.but Patch from Jonas Koelker for the developer docs, fixing a couple of
Octocat-spinner-32 i18ncheck.pl mv *.c jni/ to avoid Eclipse build failure; remove crash handler as i…
Octocat-spinner-32 makedist.sh Left puzzles.rc2 out of the tarball. Oops.
Octocat-spinner-32 mkfiles.pl Add a section to mkfiles.pl to build a makefile that compiles the OS X
Octocat-spinner-32 noicon.rc MinGW windres doesn't like an empty resource file, so invent a resour…
Octocat-spinner-32 osx-help.but Improve OS X help: split back up into multiple files (thanks to
Octocat-spinner-32 osx-info.plist First cut at online help under OS X. I just built the HTML version
Octocat-spinner-32 osx.icns Added a framework for putting things other than the binary into a
Octocat-spinner-32 osx.m Merge branch 'upstream'
Octocat-spinner-32 padtoolbar.bmp Dariusz Olszewski's changes to support compiling for PocketPC. This
Octocat-spinner-32 proguard.cfg Allow building in Eclipse - requires a less compartmentalised file la…
Octocat-spinner-32 project.properties Revert Windows-ness in build (to be fixed portably later); add new Ec…
Octocat-spinner-32 puzzles.but Merge branch 'upstream'
Octocat-spinner-32 puzzles.rc2 Dariusz Olszewski's changes to support compiling for PocketPC. This
Octocat-spinner-32 wceinf.pl I still haven't managed to get the WinCE port building via bob, but
Octocat-spinner-32 website.url Build an installer for Puzzles.
Octocat-spinner-32 winiss.pl Build an installer for Puzzles.
README
How to work on the Android port of Simon Tatham's Portable Puzzle Collection
============================================================================

...without writing any code
---------------------------

Good bug reports and well-thought-out feature suggestions are always helpful.
The issue tracker is:
http://github.com/chrisboyle/sgtpuzzles/issues

Simon has an excellent page on how to write a good bug report:
http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Translation efforts are in progress at:
http://www.getlocalization.com/android_puzzles/
(I did *not* choose their country names...)

Coders should read on...

Prerequisites
-------------

Some knowledge of Android Development and/or C, and ideally JNI, depending
on what you want to work on: the puzzles themselves are in C, most
Android-specific code is in Java, and JNI (Java Native Interface) is the
API bridge between the two.

If you have the option, a Linux-based development machine, as I haven't
tried to build on Windows or OSX, and it will need some tweaks.

Android SDK
http://developer.android.com/sdk/
...and its dependencies: http://developer.android.com/sdk/installing.html

Android NDK (Native Development Kit)
http://developer.android.com/sdk/ndk/

Your life will be easiest if the above two are at (or are symlinked at)
/opt/android-sdk and /opt/android-ndk , otherwise edit the paths later.

Either Eclipse...
http://eclipse.org/downloads/ ("Java Developers" or "Classic" recommended)
+ http://developer.android.com/sdk/eclipse-adt.html (Android Dev Tools)
+ http://www.eclipse.org/cdt/  (C/C++ Dev Tools)
+ http://www.eclipse.org/egit/ (optional: use Eclipse as a git client)

...or Ant:
http://ant.apache.org/ (or "apt-get install ant")

...and I probably missed a few things. File a bug when you find them. :-)

Getting/configuring the source
------------------------------

The source lives at http://github.com/chrisboyle/sgtpuzzles - you can
either clone/download it from there, or make your own fork on github
(the Fork button near the top right). A fork means you can easily send
me a "pull request" of your change, and I can review and integrate it,
all within github.

You'll also find a branch called "upstream", which is Simon's code whenever
I last synced. Handy for diffs, to see what I broke on Android. :-)

If your SDK/NDK aren't in my suggested locations, add a file local.properties
to override the locations in build.properties. If using Eclipse, also edit
the paths in:

Project / Properties / Builders / NDK builder
Project / Properties / C/C++ General / Paths and Symbols / Includes / GNU C

You should now be able to edit, build and launch the app like any other Android
project (except a lot of it is in C). Don't forget that you'll be signing with
a dev key, so to test on a device that already has the Market version,
uninstall that first.

Architecture / where to find stuff
----------------------------------

Simon has some excellent docs here:
http://www.chiark.greenend.org.uk/~sgtatham/puzzles/devel/

Go and read those, at least the Introduction.

The Android front-end (android.c) is basically just glue, passing everything to
Java. The Java classes providing the UI layer, game chooser, crash handler,
etc. are in "src".  The main class SGTPuzzles has the native methods that
android.c implements. The game area on screen is a GameView, which basically
just has a bitmap for the puzzle to draw on. Note that almost no native code is
run until the user has chosen a game (unless there's a previous game to
resume).

The original build system for all the other platforms, before I recently
"simplified" (broke/ignored) it for Android, uses "mkfiles.pl" and "Recipe" to
produce Makefiles (e.g.  Makefile.osx for OSX) among other things. "Makefile"
(no extension) is for Linux/GTK. So to check you haven't broken a game on
another platform, run ./mkfiles.pl (once) and make (or make -f Makfile.foo) to
build the other platform's binaries.

If your change is relevant to other platforms, you should definitely ping Simon
about it as well as me, but test on at least one other platform first (see
above).

Major changes e.g. adding a game
--------------------------------

At this level you especially need to think carefully about other platforms.
One of the best features of this collection is its relative consistency across
different environments, and the Android port should continue that.

If adding a game, definitely read the relevant chaper (6) of Simon's
development docs, and also re-run mkfiles.pl, and add the new game to the
places I've gone and duplicated the list just for Android...

jni/Android.mk
res/values/arrays.xml
res/values*/strings.xml
Eclipse: Project / Properties / Builders / NDK builder / Build Options / Specify Resources
.gitignore
icons/Makefile (actually that one was Simon)
...then add icons/foo.sav, cd icons && make (on a Linux box with GTK)


Happy hacking! :-)

--Chris Boyle
Something went wrong with that request. Please try again.