Sunday, September 22, 2013

How to use your Android device as a PHP/MySQL development environment with free apps

Actually smartphones and tablets are very versatile devices, and people use them to do lot of things that a little time ago were possible only on a PC: web browsing, social networking, gaming, etc. So, why not using them also for programming? Surfing the Google Play Store, I discovered that doing dynamic web development on an Android device is possible, also using only free apps (for dynamic web I intend PHP/MySql).
These are the apps I tried and found very useful for web development on Android.

AndroPHP

This application is the only free Android dynamic webserver I found on the Play Store, but it isn't very popular on the Store. You can download it here. It has a very simple GUI, but it does what it promises: runs a full PHP/MySql server. It doesn't needs root privileges unless you want to use ports between 0 and 1024 (but the default port, 8080, is perfect for development). It also includes PhpMyAdmin to easily manipulate databases.
To use AndroPHP, just open the setting screen and set the server's root directory, then place there your website/webapp. Next, come back to the app's main screen and move the switch to on: now you will be able to acces your site by opening your browser and typing localhost:8080 in the address bar.
Here some screenshots:
AndroPHP's main screen
AndroPHP's setting screen

Chrome showing the serve's phpinfo

Chrome showing PhpMyAdmin's login screen

DroidEdit free

To edit the code of your web application, you obviously need an editor: I chose DroidEdit free (download): it's a very powerful editor that supports lots of programming, scripting and markup languages, including HTML, CSS, JS and PHP. There is also a paid version with additional features, like cloud support and Emmet/ZenCoding support (you can buy it here).
Here a screenshot:
A PHP file opened in DroidEdit free
Note: I tested this app on my tablet, but I think that programming on a phone's screen wouldn't be very easy; in both cases, I suggest to use Hacker's keyboard, a developer-friendly input method.

No comments:

Post a Comment