Software Development on Nexus 7

    In a recent post, Tablet - not a luxury, it was a question of using tablets running Android not only for entertainment, but also for business purposes. I want to continue this topic and talk about how I use my Nexus 7 during long trips and program applications on it for this very Android.

    Here is a list of tasks that the tablet should solve for me during this pastime:

    • syntax highlighted source code editing for Java, XML and C;
    • compilation of the simplest C code into native binaries for Android (i.e. use Bionic instead of libc, etc.);
    • Build a Java project in an APK application;
    • git, ssh, familiar GNU console tools in all their diversity.


    And this is what I got.



    Code editing



    Perhaps this is the most important point. Without the possibility it is comfortable (as much as possible on a tablet with a 7 "screen and without an iron keyboard) to write code, all the other points make no sense. I started trying various text editors back in the days of Android 1.6 on a phone with a 3.5" screen. As a result, I opted for the paid version of DroidEdit , how it differs from the free one I don’t remember. Inside there is a really convenient UI, highlighting a bunch of languages, support for shortcuts, a million all sorts of goodies, and even partial ZenCoding / Emmet support for HTML lovers. In general, I don’t even know how to make a mobile text editor better.

    The next important code editing application is the keyboard. Again, after numerous tests, I choseThumb Keyboard (by the way, now they have a 50% discount). Advantages of this keyboard: a large number of settings, layouts for different devices, the presence of auxiliary keys such as arrows, tabs and others, plus a custom row of keys where you can add additional keys and functions such as Copy and Paste. There is also a key to invoke a user dictionary, where I personally stuffed frequently used expressions in Java. For example, public void () {}. As a result, with two tapas, I insert an advertisement for a new method. In general, it turned out very comfortable. Considering that DroidEdit accepts the volume up key for Ctrl (configured in the application), now the usual shortcuts also work for me: ctrl + s, ctrl + o, etc.

    Conclusion: you can write code! The desktop or laptop cannot be replaced, due to the lack of a full keyboard and mouse, but you can upload the prototype application or urgently fix the configs on the remote server without any significant problems. Therefore, we boldly move on to the second point.



    Compilation and assembly



    I needed to compile the code in C and Java. For the first, I first thought of using GCC in chroot, but it was too lazy to deal with the Android toolchain. As a result, I installed CCTools-free . Inside there is some kind of primitive code editor, as well as a compiler already configured for Android environment. For small utilities, it came in handy. I do not advise collecting large projects - in view of the slow speed of the memory, compiling something large will take a lot of time. If there is a need for such an assembly, it is better to pick up the remote build server, upload the code to it and collect it there.



    I use AIDE to build Android applications. The free version has a bunch of limitations, so the “activator of all chips” was immediately purchased. The kit comes with a very miserable code editor and even a working auto-completion of code with git support does not save it. Therefore, I use it exclusively as a compiler. He knows how to collect almost any Android application, sign them with a debug key and run on the device. In addition, there is an export of applications in release mode with a normal key. In general, using AIDE, you can not only write and test the application, but also put it on the market. Oh yes, he understands Eclipse projects. This is useful.

    Conclusion: on the tablet you can not only write a prototype, but also make a fully working application and even put it on the market.



    GNU Utilities



    The best way to use GNU utilities is to install a full-fledged Linux distribution. Since I only needed console utilities, I installed a minimal installation of Ubuntu. The Linux Deploy application (the author, by the way, is Russian) helped me a lot in this . The w3bsit3-dns.com forum has a topic where you can find all the information on how to use Linux Deploy and chat with the author. Therefore, I will not go into details. I installed Ubuntu Quantal for myself under the armhf architecture, I didn’t install any servers or GUI. In addition, he indicated in the settings to mount the SD card folder so that you can access the files with which I work in Android.

    A few words about architectures. There are two types: armel and armhf. The first is ARM without support for floating point operations at the iron level. Usually, these are old devices with ARMv6 chips, however Tegra2 also does not support floating point numbers, although the chip is not so old. I set myself armhf - Tegra3 supports such operations and thanks to this, all Linux software runs many times faster.

    After installation, the input to chroot is performed by the console command / data / local / linux / chroot and the Ubuntu greeting is displayed in our console, and we immediately have root rights (within Ubuntu, of course). Now you can deliver the missing utilities via apt-get and safely use them in the console.

    It is worth noting that installing Linux in chroot requires root privileges in Android.

    Conclusion: GNU utilities are available and ready to go.



    Conclusion



    At the moment, I wrote only one application using the Nexus 7 tablet. However, its sales on the Play Market have already paid for the price of the tablet. In the process of writing, a laptop at home was also used to bring the application to mind. However, the first version was entirely written on the tablet. The only serious problem at the moment is that AIDE does not know how to build projects with reference dependencies (ADT feature in Eclipse). Therefore, building an application using libraries like ActionBarSherlock is very problematic. I can imagine a solution to the problem, but I have not delved into it yet. If you do not use references, then there will be no problems.

    Conclusion: modern Android tablets are fully ready for use as working tools for programmers and admins in conditions of maximum mobility.

    Also popular now: