2 This directory contains the Android-specific code for building xscreensaver.
4 It is preliminary, and very much a work in progress.
6 If you're messing with this, please let us know!
8 dennis@panaceasupplies.com
12 To set up your Android development environment:
14 Install JDK 7 (http://www.oracle.com/technetwork/java/javase/downloads/)
15 Install Android Studio (http://developer.android.com/sdk/)
16 Install Android NDK (http://developer.android.com/ndk/downloads)
17 Rename or link the "android-ndk-*" directory to "ndk" inside your
18 $ANDROID_HOME (the "sdk/" directory that is the parent of
19 "build-tools/", etc.) That is, it should be "sdk/ndk/".
21 set $ANDROID_HOME to where your SDK is installed, or
22 set "sdk.dir" in project/local.properties.
23 On MacOS, the value you want is probably ~/Library/Android/sdk/
24 Also set "ndk.dir" in project/local.properties.
32 Hopefully an "xscreensaver-debug.apk" file will appear in
33 android/project/xscreensaver/build/outputs/apk/.
35 Load that onto your device and go to:
36 Settings / Display / Daydream
37 or just click on the XScreenSaver icon, which is a shortcut to that.
39 To create and configure an emulator image, use the GUI tool and and
40 give the emulator a name (say, "Nexus_5").
42 $ANDROID_HOME/sdk/tools/android avd
44 Configuration options are in $HOME/.android/avd/*.avd/config.ini
48 $ANDROID_HOME/sdk/tools/emulator -avd Nexus_5
50 Warning! On my system at least, the emulator runs out of memory
51 when trying to display the Daydream page if all of the savers are
52 loaded. This is troubling. You can work around this by editing
53 your *.avd/config.ini and setting vm.heapSize=128; or by editing
54 android/Makefile and paring down the $ANDROID_HACKS list to a
55 smaller subset (60 or so with the default heapSize).
58 To load it into the currently-running emulator or device:
59 $ANDROID_HOME/platform-tools/adb install -r \
60 project/xscreensaver/build/outputs/apk/xscreensaver-debug.apk
62 Extremely verbose log output, including stack traces:
63 $ANDROID_HOME/platform-tools/adb logcat
65 Non-fatal log output for only this app:
66 $ANDROID_HOME/platform-tools/adb logcat \
67 -s xscreensaver:d AndroidRuntime:d libEGL:d
69 Note that sometimes "logcat" will just sit there forever saying
70 "waiting for device". This is because the emulator is a piece of
71 shit and sometimes decides to just randomly not service connections.
72 If you restart the emulator, and wait minutes for the whole damned
73 thing to boot up again, it will probably work next time. Probably.
78 Boilerplate for the Java version of "make":
81 project/xscreensaver/*gradle*
82 project/xscreensaver/build.*
83 project/xscreensaver/*.properties
85 The other half of the Makefile:
86 project/xscreensaver/jni/*.mk
89 project/xscreensaver/src/org/jwz/xscreensaver/*.java
90 project/xscreensaver/res/layout/*.xml
92 Other relevant source code is in ../jwxyz/ and ../hacks/.
95 project/xscreensaver/res/drawable-ldpi/
96 project/xscreensaver/res/drawable-mdpi/
97 project/xscreensaver/res/drawable/
99 Files that we generate:
102 project/xscreensaver/AndroidManifest.xml
103 project/xscreensaver/res/drawable/*.png
104 project/xscreensaver/res/values/settings.xml
105 project/xscreensaver/res/values/strings.xml
106 project/xscreensaver/res/xml/*.xml
107 project/xscreensaver/src/org/jwz/xscreensaver/gen/*.java
109 Other files generated as a part of the build process:
113 project/xscreensaver/build/
114 project/xscreensaver/build/outputs/apk/ -- app appears here
115 project/xscreensaver/jni/
116 project/xscreensaver/libs/
117 project/xscreensaver/obj/
118 project/xscreensaver/res/
119 project/xscreensaver/res/drawable/
120 project/xscreensaver/res/values/
121 project/xscreensaver/res/xml/
122 project/xscreensaver/src/org/jwz/xscreensaver/gen/
124 When adding a new hack, edit android/Makefile, then "make clean" and "make".
127 TODO list, and known bugs:
129 - See the top of ../jwxyz/jwxyz-gl.c for a low level TODO list,
130 but here's what's wrong with the savers from a high level view:
132 - Rotation is wonky (on some devices?)
134 - The Android emulator is a piece of shit and crashes all the time,
135 so it's possible that some of these work fine on real devices.
136 I don't actually have an Android device, so I have no idea.
138 - As mentioned above, the Android emulator runs out of memory if
139 more than about 60 of the Daydreams are installed with the default
140 heapSize. Again, I don't know if this is an issue on real devices.
143 - The code that attempts to grab a screen shot before the Daydream begins
146 - When a saver exits abnormally, we catch the exception and attempt to
147 display the error message in a dialog. The catch works, but the dialog
150 anemone needs thick lines
151 anemotaxis needs thick lines
152 antinspect crashes emulator, sometimes
153 antmaze crashes emulator, sometimes
154 antspotlight crashes emulator, sometimes
155 apple2 text, images into pixmaps doesn't work
156 atlantis crashes emulator, sometimes
162 bsod pixmaps, XCopyArea problems
166 circuit crashes emulator
167 cityflow crashes emulator, sometimes
169 crackberg crashes emulator, sometimes
170 cube21 crashes emulator, sometimes
171 cubenetic crashes emulator, sometimes
172 cubicgrid crashes emulator, sometimes
174 dnalogo codeword is blank
175 dymaxionmap crashes emulator
176 endgame crashes emulator
183 fuzzyflakes thick lines
185 glblur crashes emulator, sometimes
187 glhanoi crashes emulator, but a few seconds in
188 glplanet crashes emulator
191 halftone XFillArc crash
193 hypertorus crashes emulator
194 interaggregate window background should be white
195 jigglypuff incredibly slow
196 jigsaw crashes emulator
197 juggler3d crashes emulator
198 maze no logo, lines look weird
200 moebius crashes emulator
202 molecule crashes emulator
206 pacman launches really slowly; fails at loading XPMs
211 polyhedra crashes emulator
213 projectiveplane crashes emulator
214 pulsar crashes emulator
216 queens crashes emulator
218 skytentacles crashes emulator
220 sonar crashes emulator
222 spheremonics crashes emulator
226 starwars crashes emulator
227 substrate background should be white
228 surfaces crashes emulator
231 twang background should be black
236 xrayswarm thick lines