Gist of the Day: Old SL4A Example!

So I’m on very little sleep after a long three days of travel which is not yet done. Nonetheless, the show must go on!
Today I have for you a demo program I wrote for CMI.pm a while back (last July I believe) on how to use Perl with SL4A (Scripting Languages 4 Android). This sample code loads a screen which does one of two things: says “something nice” or exits the program. This program demonstrates how to make an event loop for SL4A, how to load an external XML UI resource for Android, and also uses some very basic functionality of SL4A (TTS speak, in particular).
As I am very tired – three hours of very interrupted sleep – I will not be writing any more than this, but I will, of course show you…

The Code


Please Note

This code totally worked when I posted it, but a lot may have changed in SL4A and Android’s interfaces as exposed by SL4A since then. I have not tested this today.

The Conclusion

Air travel can really suck. It’s nice to have some old sample code lying around when you want to post a gist in a pinch.
I hope you all have had a much better day than I have, and I will try my best to post something nice tomorrow.