The next version of Delphi will include a new compiler for the Android ARM platform. It is a native code compiler, producing binary code (and not Java Dalvik bytecode). Up to now, the only option for native Android apps was using C++ and some low level code. Delphi, instead, offers a higher-level language, ARC like on iOS, and easy-to-use visual component offering user interface development, data access, data binding, sensors, internet and cloud support, and much more.

Delphi for Android requires both the NDK and the SDK to be available (they are both free from Google) on the developer machine, as explained by Jim at delphi.org/2013/08/sneak-peak-android-sdk-ndk-and-device-support-in-delphi/.

Getting back to the Android compiler, this is a sample of the compilation message log:

Checking project dependencies...
Building Droid101.dproj (Debug, Android)
brcc32 command line for "Droid101.vrc"
c:\program files (x86)\embarcadero\rad studio\12.0\bin\cgrc.exe -c65001 "Droid101.vrc" -foDroid101.res
dcc command line for "Droid101.dpr"
c:\program files (x86)\embarcadero\rad studio\12.0\bin\dccaarm.exe -$O- --no-config -B -Q -TX.so -AGenerics.Collections=System.Generics.Collections;
Generics.Defaults=System.Generics.Defaults;WinTypes=Winapi.Windows;WinProcs=Winapi.Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE -DDEBUG
-E.\Android\Debug -I"c:\program files (x86)\embarcadero\rad studio\12.0\lib\Android\debug";"c:\program files (x86)\embarcadero\rad
studio\12.0\lib\Android\Release" -LE"C:\Users\Public\Documents\RAD Studio\12.0\Bpl\Android" -LN"C:\Users\Public\Documents\RAD
Studio\12.0\Dcp\Android" -NU.\Android\Debug -NSSystem;Xml;Data;Datasnap;Web;Soap; -O"c:\program files (x86)\embarcadero\rad
studio\12.0\lib\Android\Release" -U"c:\program files (x86)\embarcadero\rad studio\12.0\lib\Android\debug";"c:\program files (x86)\embarcadero\rad
studio\12.0\lib\Android\Release" --libpath:c:\android\ndk\platforms\android-14||arch-arm\usr\lib --linker:"c:\program files (x86)\embarcadero\rad
studio\12.0\bin\ldandroid.exe" -V -VN -NO.\Android\Debug Droid101.dpr
Success
Elapsed time: 00:00:04.8

The DCCARM compiler we are using is based on the LLVM architecture, like the Delphi for iOS compiler. This implies using a specific linker (see above!) and an entire toolchain tied to LLVM for building and debugging the application on the device. What is produced by this compilation? Quite surprisingly, it is not a regular executable, but a shared object library, libDroid101.so for a project called Droid101.

The reason is that an Android process (or activity) starts invariably with a Java entry point. For an application based on the NDK, you can create a minimal Java class with the only role of loading the native code and call its entry point. Don't worry, though: Delphi will have that class written for you, so all you need to do is write an application as usual and hit the F9 button... As you press F9, after the compilation, Delphi automatically creates an APK (an Android packaged application) with all the required files (manifest, resources, and the binary), deploy the application to your device using platform tools, and start it.

Your device must be enable for debugging (and you might need to install a specific USB driver for the device). There is no need to sign a developer contract with Google for this. There are other ways to deploy the app, though. For example, you could send the APK file as an attachment to a GMail account to any Android user accepting apps from outside of the store, and the user will be able to install your app directly from GMail.

To summarize, Delphi for Android will make it extremely easy to write natively compiled applications calling any NDK or SDK API in a seamless way, and will have the same set of components and visual controls of its iOS counterpart. Single source, multiple platforms, that is.

PS. So if you haven't already done so, buy Delphi XE4 today and take advantage of the maintenance offers as explained on embt.co/XE4RadOffer.