Create The Perfect PHP Development Environment In Android

It turns out you can actually code on Android productively. For the longest time, it has been accepted that whilst computers are for productivity and creativity, Tablets exist purely to allow the passive consumption of content.

I believed that as well. I’m a software developer by trade, and I use a 13″ Macbook Pro to write all my code. I wouldn’t have it any other way. OS X comes with everything I need to be productive as a developer, and I’ve built my workflow around that.

Android Development Macbook   Create The Perfect PHP Development Environment In Android

Android on the other hand? I’ve never really thought about writing code on Android. Using a ghastly virtual keyboard to write a Facebook status update is bad enough. Writing code on Android? Perish the thought. It doesn’t even have a built-in file manager!

But then I bought a decent Bluetooth keyboard, and everything changed. I’ve now built a PHP development environment around my 2012 Nexus 7 tablet, and I love it. Here’s how it works.

Editing Text

The text editor is the cornerstone of any development environment. It should go without saying that discussing the merits of an individual text editor can be a hugely contentious topic in the development community. Indeed, the rivalry between fans of the Vi/Vim and Emacs text editors is referred to as the Editor War.

I’m firmly in the Vim camp. This powerful text editor is installed by default on OS X and most Linux distributions, and makes it easy to rapidly and accurately edit large documents and code files.

android dev vim   Create The Perfect PHP Development Environment In Android

For something that is fundamentally keyboard oriented, I was surprised to see that someone had implemented Vim for the Android platform. This comes in the form of VimTouch. I don’t do hyperbole, but this might actually be the best Android text editor on the market.

What makes it so good? It comes with numerous plugins, including syntax highlighting which is especially handy for those of us who use a text editor to edit code. It’s also hugely customizable, and adapts Vim to be usable on a touchscreen whilst remaining faithful to the original Vim philosophy.

anddev vim config   Create The Perfect PHP Development Environment In Android

Vim addicts will know that Vim is customizable through something called a ‘.vimrc’ file. Whilst VimTouch makes it easy to add features and behavior through a nice touch-friendly interface, you should know that you can still customize things by editing a .vimrc configuration file, as you would on a normal computer.

VimTouch is free from the Google Play store, and is licensed under an Apache 2.0 Open Source license.

I Love LAMP

LAMP stands for Linux, Apache, MySQL and PHP, and is one of the more popular server configurations for people who develop PHP based web applications.

The server I use to host my web applications on my Tablet is called Palapa Web Server. This has been designed from the ground-up for low memory and CPU consumption, which is ideal for the somewhat weedy CPUs found within most mobile devices.

android dev palapa   Create The Perfect PHP Development Environment In Android

It runs a slightly Welsh-sounding server configuration called LLMP. This isn’t too different to LAMP, except Apache – which is notoriously heavy – has been replaced with Lighttpd. I was pretty impressed to see that all constituent parts of Palapa Web Server are reasonably current, with the installation of the PHP programming language being the latest version.

android dev php   Create The Perfect PHP Development Environment In Android

The version of MySQL is pretty current, too. With that said, there’s no obvious way to interact with it by means of the command line. Fortunately, Palapa comes baked in with a copy of PHPMyAdmin. Granted, it’s not my preferred way of dealing with MySQL, but it works well enough.

There’s also a web interface where you can configure certain aspects of the web server, including the database and the installation of PHP. For some reason unbeknown to me, the default timezone in pretty much everything is Asia/Jakarta. If you’re not actually in Indonesia, you might want to change that.

android dev web admin   Create The Perfect PHP Development Environment In Android

You’re probably wondering if Palapa actually works. Well, the answer is yes. Yes, it does. Rather well, actually.

wordpress localhost   Create The Perfect PHP Development Environment In Android

I should also mention that if you have Palapa installed on your device, you’ll have all you need to run a local install of WordPress on your tablet or smartphone. Crazy, right?

Conclusion

I’m catching a flight tomorrow. It’s not a long one, but it’s long enough for me to get some work done.

I normally would have taken my Macbook Pro with me. I would taken it out of my bag and let it be swabbed as I went through security. And when my flight took off, I would have perched it awkwardly on the little drop-down table, sat precariously next to my £4 cup of black airline coffee.

But now I don’t need to do that. Android has done the unthinkable, and replaced my trusty Laptop for something it previously didn’t excel at: Web development. That’s not to say that using Android as my main development platform doesn’t have its limitations. I’m yet to work out how to install PHP extensions in Palapa, and using a 7″ screen for too long can be quite painful.

Do you use Android as your development platform? What’s your setup like? Let me know in the comments below.

Photo Credit: John Biehler Via Flickr, Macbook Pro (Joseph Thornton), Rework (nyuhuhuu)

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

7 Comments -

Tom W

If I had a decent tablet, I would probably give this a go. Although I have been doing Android development in Eclipse recently, and I’ve gotten rather used to a fully featured IDE.

geekologie_me

I use “Linux deploy” Android application without desktop environment, then I install JuiceSSH to connect and I developed with Vim. I made a tutorial in French here : http://www.geekologie.me/2013/11/android-comment-installer-lamp.html

antonis

I’m doing Android development on Eclipse on my PC and on AIDE on my Nexus 7 2013 with a BT keyboard. I keep them synchronized using Dropbox. It’s a neat setup!

Axel C

Thank you for that info.

I will definitely try that out. Perfect for fooling around with scripts and little tools. :)

Adetunji O

Great!, I have once tried some options like installing a linux os on my galaxy tab 10.1 to enable me code on the go, but this is much better and lighter.

Mike

I use this “palapa Web server” a lot on my developing particularly on the go. I find the “DroidEdit” text editor more convenient for me in coding purposes.

Hede

Well, it’s not a android applicaton article. It’s a html5 web page for mobile devices. But usefull.