Is Java the only way to write Android apps?

I searched the Internet for an answer, but I can only find answers that are too old, confusing, or people don’t answer the question, but rather speak to learn Java.

My main questions are:

  • Is Java the only way to write Android apps?

  • This question will contradict # 1. Since Adobe AIR can now work on Android phones, does this mean that I can write in AS3 without Java, or do I need to wrap the AIR application inside Java?

  • Applications like Facebook for Android, Angry Birds and all these fancy games made only in Java?

  • If # 1 == false && me == JAVA_HATER, which language or SDK do you recommend. This is my main question.

+4
source share
4 answers
  • This is the only method supported by Google. There are others, such as Adobe Air; and if you want to do some work to understand the connection with the standard Android classes, you can copy and modify Ant recipes in the SDK to work with any JVM-oriented language.
  • Air applications, like any other platform, run on the Air virtual machine, which runs on the target platform “natively”. (Which for Android means that it is probably written in Java, compiled into JVM bytecode, then converted to Dalvik bytecode.) Note that you can write your own (usually ARM) code and associate it with the Java base base although there are a number of limitations for such code. I would suggest that Appcelerator mentioned elsepage, translating Javascript to something else (there are several Javascript-to-Java translators).
  • Most Android apps are written in Java. Some applications, especially those that say they won’t work in versions of Android below 2.0, have their own code libraries. See No. 2.
  • Java works out of the box. With a little work, as I mentioned above (No. 1), you should be able to write code in any language that creates JVM bytecode and knows how to reference Java class libraries. (I fully expect someone to provide a Scala connection. :)
+8
source

Adobe Air for Android takes care of the integration for you - you don’t need to write Java to make it work. This is really a direct AIR application, and if the device user has Air for Android, then your application will work, just like that.

The native code (java) against the discussion in AIR has been going on for a long time - depending on the type of application you are doing, you MAY see the benefits of writing Java, as this is one less layer in the project. On the other hand, the difference is minimal if you do not animate a billion forms or something else - in many cases, AIR is excellent.

Another option you have is to create your application using HTML / JavaScript and just embed it in a Java or ObjC shell that compiles into your native Android / iPhone application - many applications, especially those that are just user interfaces for which dataset, use this approach.

So, depending on your use case, you have many options! :)

+2
source

You can try the appcelerator . You write in javascript, and somehow it translates it into an Android app.

0
source

Android NDK provides:

A set of tools and assembly files used to generate custom code libraries from C and C ++ sources.

0
source

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


All Articles