Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Intel C++ Compiler for Android - KitKat+ support?

lucan1d
Beginner
556 Views

The FAQ doesn't mention this so does Intel C++ Compiler for Android 14 support the latest version of Android namely 4.4 KitKat?  Also, given that there are radical changes in the works with Android moving over to ART, will this compiler support ART now or in the future?

0 Kudos
6 Replies
Alexander_W_Intel
556 Views

Hi,

Good question. The Intel C++ Compiler for Android (ICC) is validated against certain versions of the Android* NDK. For the 14.0 version of ICC this is NDK version 8b. As long as applications build with the NDK version 8b run on Android 4.4 (KitKat) you can also use ICC to build them. 

ART is the new Android runtime. ART changes the way how Java based applications are compiled and executed compared to Dalvik. I don't think this has an impact for the native parts of an application. As long as ART is experimental it's hard to tell the final impact. All the applications compiled with ICC I tried so far worked well on an ART enabled device. 

Does this answer your questions?

Thanks,
Alex

0 Kudos
lucan1d
Beginner
556 Views

Thanks Alexander - you have answered my questions!

But I have another... how does the performance of the ICC compiled app compare to one compiled for/by ART on the same device?  I realise you may not be able to answer this :-)

Also, you refer to NDK 8b - is this the latest version?  If not, do you plan to keep up with the latest versions of the NDK?

0 Kudos
Alexander_W_Intel
556 Views

Hi,

ART is still marked as experimental. So I'm not sure how reliable performance measurements are. There is a good article with a lot of benchmarks comparing ART with Dalvik. I found only one benchmark that really compares Davlik, ART and NDK based applications. 

If you have a native Android application you can download an evaluation copy of the Intel® C++ Compiler for Android here and try it out yourself :-). 

The latest NDK version is 9b at the moment. We try to support the latest version of the NDK at the time we release a new compiler version. I'm using the compiler since a while now with NDK 9b and didn't found any issues so far. So if you want to use the latest NDK with our compiler you can give it a try. 

Alex

0 Kudos
lucan1d
Beginner
556 Views

Thanks again Alexander - you have been most helpful.

I would like to ask you one final question altough I realise it may be a little off topic.

How much of a typical Android app can be written using ICC?  I see on the Android NDK website that it says things like "don't use C++ unless you have a very good reason", "using C++ rarely gives performance gains over Dalvik" and "don't use C++ just because you like C++".

They seem to miss the point for why *I* want to use C++ on Android which is principally because I have a lot functionality for other platforms written in C++ and I would rather reuse it than start from scatch with Google's version of Java.

So is it possible to develop most or all of an Android app using ICC?

0 Kudos
Alexander_W_Intel
556 Views

Hi,

primary development language for Android is Java. That means you will have the best API support for it and most development tools are focused on Java development. As long as you develop in Java you also don't need to care about the architecture the application run on. So there are good reasons why Google recommend to write code primarily in Java. 

The main reasons why people usually develop native applications are performance and reusing of existing code. Reusing existing code is more or less self explaining. C++ code can also be compiled for most of the different hardware platforms available regardless if it's a mobile system, embedded, the desktop or a big server. With asm.js you can even compile C/C++ code to Javascript. 

Talking about performance is much more difficult: First you need to ask yourself if you need the performance. A lot of typical mobile applications are not performance critical e.g. productivity apps or chat applications. If the code executed for an action takes 10 milliseconds or 1 millisecond makes no visible difference to the user.
If you have a performance critical app like a 3D game  you need to make sure that the actual performance bottleneck is the CPU and not the GPU. If your application is GPU bound, optimizing the CPU workload will not help much.
So if you have a performance critical CPU bound application native code might improve performance or might not. This always depends on the type of workload you have. To get a solid answer it's best if you write a small benchmark describing your particular workload in Java and C/C++ code and compare the results. 

If you have a NDK based application you can simply download an evaluation copy of ICC and try it out to see if you get an additional performance improvement. 

You actually be able to write apps entirely in native code, but I wouldn't recommend it. There are a lot of APIs that are only accessible through Java. Most people have a thin Java layer and are using the Java Native Interface (JNI) to call the native side of the app. 

Alex

 

0 Kudos
Alexander_W_Intel
556 Views

Small addition: there is a very interesting article about the performance of mobile applications. It's focused on HTML/Javascript but it still gives an interesting background: http://sealedabstract.com/rants/why-mobile-web-apps-are-slow/

Alex

0 Kudos
Reply