Mobile App Development in PicoLisp - III: Installing Demo Applications
3 min read
In the last post, we have seen how to install the PilBox in Android (i. e.: just download it from the Google PlayStore). But there is not much we can do with this app yet, as it is just a container for our future PicoLisp apps.
Luckily, there are already some demo apps available: Let's take a look.
PilBox Demo Apps
At the point of writing this post, there are 10 demo apps available as .zip-File:
Let's take a look at "Radio" as example. You can download the zip-file from
http://software-lab.de/radio.zip or do it directly from the app:
- Touch the "settings" wheel and type "radio" into the input field of the "PILs" tab.
- Click on "Download". A new entry called "binary" will appear in the table.
- If you go back to the home screen (PicoLisp symbol on the upper left), you will see a button "Radio".
- Clicking on it shows several web radios.
Reminder: Just like you shouldn't download files from unknown sources, you should also be careful what kind of zip-files you are loading into your pilbox. I'm pretty sure there is no PicoLisp malware out in the wild, but better safe than sorry :)
Next, let's test the functionality. It is pretty simple: When we tap a station name, the radio starts playing (obviously internet connection is needed). When you tap the "stop" button at the bottom, the radio stops.
When you tap the settings wheel, you will also find a few setting options, namely "alarm", "stations" and "language".
It does what you expect - you can set an automatic alarm at a given time (format HH:MM:SS), you can change the pre-defined stations and the language.
Examine the source code
Now tap on the radio symbol until you get back to the home screen, and then click on settings. From there, we can examine the app's source code by clicking on "radio", which will list all files included in the app.
By clicking on each of the files, we can see the respective code.
Demo Apps Overview
The main purpose of the demo apps is to demonstrate how to write your own apps and access system functions. We will go further into that in one of the next posts.
Below you can find the available apps and what features they are demonstrating:
hello.zip: A "hello world" app, which just prints a "Hello World!" headline to the screen.
steps.zip: Needs access to the physical activity. It is a simple step counter. It gets the "steps" from the step counter built into the phone, and compares it cumulatively against a daily target.
wecker.zip: a simple notifier. You can set date, time and title, and a automatic notification will pop up.
radio.zip: streams web radio. You can set an alarm too.
chess.zip: A chess game against a (not very strong) AI. You can set the difficulty by defining the "search depth".
browser.zip: A simple web browser. You can also set bookmarks and start pages. Also, you can set the header's user-agent to arbitrary values.
battery.zip: displays the battery status of the current device (charging rate and capacity).
calc.zip: a bignum calculator (only integers).
demo.zip: a collection of demo examples for typical smartphone applications: GPS, Camera, QR scan, Notification, Gaphics with canvas (the forest fire]), the Game of Life, input fields and charts.
crash.zip: error handling example (division by 0).
Note: Unfortunately it can happen that the PilBox app terminates the process while running in the background. The screen will show "Zombie" when you re-open it. In this case, just swipe it out and restart it.