Google’s open source Android mobile operating system is taking the smartphone market by storm. Unlike Apple, which has stringent guidelines and requirements for developers who want to offer their applications on the iPhone App Store, Google has left the Android platform wide open. You can even write Android applications in PHP now. The folks at Irontech have created a PHP port to run on Android, and with the Scripting Layer for Android (SL4A), you can build PHP Android applications.
In this article, I’ll explain how to install, set up and use PHP for Android and SL4A, I’ll present a demo application as an example, and I’ll give a first-hand account of the PHP for Android developer experience.
Installing PHP for Android
To install PHP for Android, you have to have a phone or emulator running Android version 1.5 or higher and you must enable “Unknown Sources” under Application settings. After you have that set, you simply install the SL4A environment and the PHP for Android APK.
Installing the SL4A is straightforward, but after you install the PHP for Android application, you need then click “install” again for it to be fully installed and functioning. If you have trouble with the installation, there’s a handy video demonstration available on Vimeo to walk you through the process.