• Forum
  • Lounge
  • What programming language is used for An

 
 
What programming language is used for Android Apps?

The title tells most of it. I know that Java is the main one for Android but I heard that other languages could be used? Can someone help clarify please, thank you.
Last edited on
Java is the main one, there's the NDK which allows for C programming, but you need to recompile for different handsets. Also Renderscript. A C derived language. There's also been ports of Python to Dalvik, as well as some other languages. Theoretically any language that runs on the JVM can be ported to the DVM. Not sure about ART though.
If you want an example of how to work around the Java requirement then helios has a project that he is working on that is almost 100% C\C++: http://www.cplusplus.com/forum/lounge/137878/
Objective-C
Uk Marine wrote:
Objective-C


As far as I know you can't use Objective-C on android.
I agree with Cheraphy I think UK Marine is thinking of iOS.

*corrected by Grey WOlf
Last edited on
I haven't figured out why some hardware is language specific. Is the OS just a giant interpreter for a few languages? If the OS can call machine code any language should be able to compile into that, provided it has an appropriate compiler.
closed account (z05DSL3A)
As far as I know you can't use Objective-C on android.

http://www.apportable.com
Is the OS just a giant interpreter for a few languages? If the OS can call machine code any language should be able to compile into that, provided it has an appropriate compiler.
Well... Sort of. The OS can be considered an interpreter at the API level.

Part of the problem is that new platforms need new runtimes to support a given language. For example, you could probably get a Haskell program to build for Android, but would you want to call the C stdio through the FFI every time you wanted to use the file system?

Another example: although the Android NDK comes with feature-complete C++11 compilers, the standard libraries are still far from complete. So you have a C++ with lambdas but no std::unique_ptr. Older platforms were even worse, though. PSP didn't even have sstream.
Last edited on
you need to recompile for different handsets.

Really ?
I don't remember the last time ( in fact , no instance ) I downloaded a specific apk for my phone's cpu/chipset etc.
APKs may include binaries for more than one architecture.
Alright thank you all for the replies =P
there is Xtend which compiles to Java code and also there is Scala which compiles to Java bytecode.
I didn't know there was a dalvik port for scala O:
I think the generated scala bytecode is compatible with dalvik, although not sure about this
there is a library called Scaloid for Scala
Topic archived. No new replies allowed.