📜 ⬆️ ⬇️

Software development for Nexus 7

In a recent post, the Tablet is not a luxury, we are talking about 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 for it under this very Android.

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


')
And that's what I did.



Code editing



Perhaps this is the most important point. Without the ability to comfortably (as far as possible on a tablet with a 7 "screen and without an iron keyboard) to write code, all other points have no meaning. I tried various text editors back in the days of Android 1.6 on a 3.5" phone. As a result, I stopped my choice on the paid version of DroidEdit , and I don’t remember how it differs from the free version . Inside there is a really handy UI, highlighting a heap of languages, support for shortcuts, a million all sorts of buns, and even partial support for ZenCoding / Emmet for HTML fans. In general, I do not even know how to make a mobile text editor better.

The next important code editing application is the keyboard. Again, after numerous tests, I stopped my choice on the Thumb Keyboard (by the way, now they have a 50% discount). The 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 call button for a user dictionary, where I personally stuffed expressions that are often used in Java. For example, public void () {}. As a result, with two tapas, I insert the announcement of a new method. In general, it turned out very comfortable. Given that DroidEdit takes the volume up key for Ctrl (configured in the application), then I now also have the usual shortcuts: ctrl + s, ctrl + o, etc.

Conclusion: you can write code! You won't be able to replace the desktop or laptop, since there is no full keyboard and mouse, but you can throw in a prototype of the application or urgently fix configs on a remote server without any significant problems. Therefore, we boldly move on to the second point.



Compilation and build



I needed to compile code in C and Java. For the first one, I first thought of using GCC in chroot, but it was too lazy to deal with the Android tool for Android. As a result, I put CCTools-free . Inside there is some kind of primitive code editor, as well as a compiler already configured for Android. For small utilities, it came in handy. I do not advise you to collect 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 raise a remote build server, upload code to it and build there.



To build Android applications I use AIDE . The free version has a lot of restrictions, so the "activator of all chips" was immediately bought. Included is a very poor code editor, and even a working auto-code extension with git support does not save it. Therefore, I use it exclusively as a compiler. He is able to collect almost any Android applications, 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 an application, but also put it on the market. Oh yeah, 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. In this, the Linux Deploy application (by the way, Russian) helped me a lot. There is a topic on w3bsit3-dns.com where you can find out all the information about how to use Linux Deploy and talk with the author. Therefore, I will not go into details. I put myself Ubuntu Quantal under the armhf architecture, I did not install any servers and GUIs. In addition, I indicated in the settings to mount the SD card folder so that I can access the files with which I work in Android.

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

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

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

Conclusion: GNU utilities are available and ready to go.



Conclusion



At the moment I have written only one application using the Nexus 7 tablet. However, its sales in the Play Market have already paid for the price of the tablet. In the process of writing was also used a laptop at home 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, to build an application that uses libraries like ActionBarSherlock is very problematic. I can imagine the solution to the problem, but I have not yet gone deep. 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 administrators in conditions of maximum mobility.

Source: https://habr.com/ru/post/168769/


All Articles