
Soon, new smartphones and tablets based on x86 architecture will appear on the market, Lenovo and Motorola have already announced their plans to release such devices. What is a new set of software developers? This is what I would like to talk about in this article.
But first, a little about the plans and the seriousness of the producers of "iron".
This year, at CES 2012, Intel showed off the first Android-smartphone based on x86 architecture. This smartphone is "atomic", because It works on the Metfield mobile platform and uses the Atom Z2460 chip.
Despite the fact that, in essence, this smartphone is a prototype, it demonstrates good performance in tests for performance and energy efficiency, almost the same as the top smartphone models currently on the market.
')
In the upper graphs, the results of tests for energy-efficiency when using 3G, playing audio and video. Blue marks the results of the Metfield-based smartphone. At the bottom - the results of performance tests. As can be seen from the graphs Medfield has the best performance in all tests.
Prototype prototype, but what about real devices? In the same place on CES, Lenovo showed the first Android-smartphone based on x86 architecture - Lenovo K800. This unit works on the Medfield platform, the processor clock frequency is 1.6 GHz, it has a 4.5-inch display and an 8 megapixel camera. The demonstrated model works on the basis of Android version 2.3, but the manufacturer promises that by the time of release the device will work on Android 4.0.
The first Android-based K800 smartphones from Lenovo will hit the market in the second quarter of 2012.
Motorola, which has entered into a multi-year partnership agreement with Intel, also announced its plans for the release of Android devices based on x86 architecture. Motorola is going to present the first Atom based device in the second quarter of 2012 as well.
In addition to performance, mobile devices based on the Medfield platform will be distinguished by the presence of NFC and WiDi technologies. If the first technology is already penetrating the smartphone market, then the second is unique to Android devices.
WiDi is already used in modern laptops and ultrabooks and will enable new smartphones to view images, videos, play games on large screens, without the use of wires. For example, on TVs that also use WiDi technology, or connected to WiDi adapters.
The first wave of devices, judging by the announced plans, will appear in the second quarter of 2012. From the point of view of consumers, these will be new devices with a number of distinctive features such as performance, energy-efficiency, WiDi availability. From the developer's point of view, a new hardware platform will be added, and, in some cases, it will be necessary to adapt existing applications to the new platform.
In which cases adaptation may be required? Before answering this question, let us briefly consider how to create an application for Android.
All Android applications can be divided into two types -
Dalvik applications and applications using
NDKDalvik is a virtual machine that is part of the Android platform. Dalvik allows you to run and run applications written in Java.
NDK is a set of tools that allows you to create and use libraries written in C \ C ++ in your application. You have to resort to the help of NDK in cases where there is a need, for example, to use ready-made C ++ code written for a different platform (in order not to lose ready-made developments), when you need to increase application performance (no matter how good Dalvik would be but lose to the “native” code in terms of performance).
If you are an application developer, it will not be difficult for you to determine whether the application uses NDK libraries or not. If you got the application from the side, in order to determine whether the application uses the NDK library or not, you need to open the APK file (which is essentially a ZIP archive) of the application using any archiver (for example, 7-Zip) and check for the presence of the
lib subdirectory.
If there is one, the name of the internal subdirectories will indicate the presence of NDK libraries for various hardware platforms.
You can also use the utility
APK Info , available in the Android Market. Using this utility, you can view a list of installed applications and obtain, among other things, information on the availability of NDK libraries.
What will happen with the advent of the new platform? For Dalvik applications, nothing will change, because they run on top of the virtual machine, and ensuring the compatibility and performance of this machine on a new hardware architecture is the task of the Dalvik developers.
For many NDK applications, in fact, nothing will change either. Despite the fact that the architecture will be new, most NDK applications will not notice the difference. The reason is a binary translator, also announced and demonstrated by Intel at CES 2010. The meaning of the translator is simple - it interprets ARM code in x86 code, which ensures compatibility of applications with the new architecture.
The translator will solve the problems of compatibility of applications with x86 and the developer of the NDK application will not have to think about adding support for a new hardware platform. On the other hand, if a developer is interested in “squeezing” everything that is possible from a new platform and creating an application that is efficient in terms of performance and energy-consumption, he will need to add support for the new architecture to his application.
Fortunately, this is very easy to do. Support for the x86 platform appeared in the NDK last year with the release of the
Android NDK 6 .
The first thing you need to do is make sure that you have Android NDK version 6 or higher installed. Download the latest version of Android NDK available on the
official page .
Next, you need to add a new target to build in the make file for building libraries. Usually in this file is written something like:
APP_ABI := armeabi armeabi-v7a
Add
x86 to this line:
APP_ABI := armeabi armeabi-v7a x86
In the latest, at the moment, version of
Android NDK 7 added a new parameter -
all .
By specifying it, you can build an application for all supported hardware platforms:
APP_ABI := all
After building the libraries, they need to be included in the APK file and “perezalit” application package in the Android Market.
The developer will not have to create a separate version of the application for the x86th platform. It can include x86 libraries in an already existing installation package and thus ensure compatibility of one package with all hardware platforms.
There is no need to make any changes to the control panel of the Android Market applications either. Android Market itself will take care of checking the compatibility of the application and the target platform.