On writing this article I was inspired by the post habrovchanina ilichme - Desktop - come on, bye! . Therefore, today we will talk in more detail about whether there is life on Mars as much as possible and conveniently to write code on an Android device on board. Immediately make a reservation - I will discuss only the tablets, as the coding on the charms on the smartphone and everything is clear. Although it is not about writing code, but about the organization of the working space, which will be as convenient as possible for development in conditions where there are no favorite IDEs, etc.
At one time, when I bought the tablet, one of the selection criteria was the presence of a convenient keyboard, since I then knew why I was buying this device. And since the choice in this sector is small, I stopped at the ASUS Transformer. This is me to the fact that if you have a real need to write code “on the knee”, in conditions that do not contribute to this, then the article means for you. Although she does not claim to be a detailed guide and solution to your problems (as everyone has different requests). And if you already talk about requests - this is likely to become an occasion to develop the topic in more detail and share experiences. I am sure that somewhere there is more than one solution to such problems, for different levels of work. ')
What are we going to discuss?
Actually, I will talk about web development, as I myself am doing just that. For this, I bought a tablet — to have the ability to write and edit the code at any time, and simply do not lose time when there is an idea to implement something, but there is no usual working space.
So, some time ago, I realized that I was losing a lot of useful time on the road. Of course, you can just enjoy your vacation, but sometimes unexpected solutions to various working problems that need to be worked out right now come to mind, because then you lose your thought. Or you just want to write code - it often happens. In general, you can not lose time. But, unfortunately, Android is not the most convenient system for web development. For some reason, developers are not in a hurry to make convenient code editors or local debugging servers. Yes, you yourself know and understand.
Technical task
Now, finally, I will proceed to the description of the development environment itself. I will make a reservation what exactly and for what tasks I was looking for:
Convenient code editor, with syntax highlighting, with the ability to view the result in the browser, undo \ redo functions, with the choice of encoding, etc.
Local web server (meaning full - with PHP, MySQL). Of course, you can separately install PHP as? and hands to tighten MySQL, but I wanted everything at once
I also wanted to have a built-in ftp to work with a remote server (not yet critical)
In general, this is the minimum set that is needed in the absence of a traditional workplace. Of course, you can add many more points here, but this is a matter of taste, and let's not forget that this is just a tablet, and only a temporary solution to the problem. As the need and demand grows, I will look for new solutions, but for now this is enough.
What i found
So, having spent some time, I rather quickly found applications that almost completely satisfied me.
Built-in virtual keys for tags and popular key phrases;
Undo / Redo
There are two versions - Pro and Standard. Pros sell for $ 5, in the free version there is no preview function in the browser and only one can be chosen from the list of drop-down tags. So there will have to fork out. But this is for its own benefit and convenience. Here are some screenshots:
For those who did not like this editor, as an alternative, I can advise DroidEdit . It also exists in two versions. But as for me, it is inferior to WebMaster's HTML Editor. But, this is a matter of taste. I didn’t like all the other editors at all, as they have problems with either encoding or working with large files. And is it important.
FTP client
To work with FTP, I chose the AndFTP program - a link to the free version and to the Pro version . On the WebMaster's HTML Editor page in PlayMarket, the developers of the editor themselves recommend using this client, and even before that I met some good reviews about it, so I immediately made my choice. Regarding ftp, I didn’t go into great detail, as it’s not critical for me to work, although sometimes I need to fix something on the fly. Perhaps over time, this need will be weighty, and I will think about the best optimization.
The program allows you to save connection configurations (server, login, password), and also provides the ability to download / upload files, synchronize the directory on the network with the directory on a mobile device, delete and rename files, change access rights. To protect your data, the program allows you to use SSH RSA / DSA keys. In general, a standard set of a normal ftp-client, only folder synchronization, support for SCP, and import settings from a file are available in the PRO version, which costs a little more than $ 5.
Local web server
And now let's talk about the most interesting - about the local development environment and debugging written code. Agree, without a local web server, the whole idea of ​​developing on a tablet would be worth nothing. And so you have to endure the inconvenience with ftp, so if you still had to work with a remote web server, it would be quite inconvenient. As for me, this is a very important moment.
I had already agreed to use them, but suddenly I came across a very interesting product - KSWEB - server + PHP + MySQL and I immediately realized that this is what I was looking for for so long.
KSWEB is a web developer package for the Android platform. It includes: web server, PHP programming language version 5.4 and MySQL version 5.1 DBMS. KSWEB makes it possible to organize on your Android device a platform for launching and debugging web applications (sites). All you need is to install the application. The folder htdocs will be created in the root of the device’s memory where it is necessary to save your files. Everything, as in any normal web server. After installation, the server management window will open.
First of all, I installed phpMyAdmin (it is not installed by default). You must click on the corresponding button in the menu, the program will ask where to install (leave the default path, since it should be installed in the web server folder). All files are downloaded and unpacked by the server. After that, you can go to phpMyAdmin through the server control panel or through a browser, registering localhost: 8080 / phpmyadmin . phpMyAdmin fully functional, version 3.5.2
In order to run your file, you need to press the GO TO button in the control panel. The default browser will immediately open, the path to the server (localhost: 8080 /) will already be registered in the address bar, you just need to add the file name. From the control panel, you can also restart the server if necessary. The Minimize button minimizes the server to tray, and the Exit button closes the application.
The settings panel looks like this: Here you can specify the port through which the server will work, you can select another folder for the server, make it immediately boot into the tray without opening the main menu when launching. By default, KSWEB contains configured server configuration files, PHP and MySQL. However, if you want to change something in them, in the server options, click on the “INI Files” item. Files with settings will be transferred to the SD card of your device at the address "/ mnt / sdcard / ksweb / ini /", if available. Clicking again on the settings item “INI Files” will use the internal settings files.
In the Market there is no possibility to buy a paid version, you can do this through the program options panel. The license costs a little more than $ 2 - a ridiculous price for such a convenient and useful application.
That is, in fact, all the necessary minimum. Of course, all this is subjective, and I will be glad to hear additions and new solutions. I, in parallel with personal growth and new problems, will look for new ways and means of solving. Maybe in the end, and gather the perfect development environment on Android) Thank you for your attention.