M
M
Mark Rosenthal2015-10-14 12:43:46
Java
Mark Rosenthal, 2015-10-14 12:43:46

Why are Android apps written in Java?

Hello!
I have not seen a single normal Java program. I really don’t understand how such an ugly technology could spread so widely. The only good news is that soon she will die on windows completely and irrevocably - a quote from the Internet.
Sobsna why many people scold Java because of its "bulkyness and slowness", but development continues on it? I heard a lot of controversy about this, saying that it’s not safe to install Java these days, development on it is complex and generally resource-intensive. Fortunately, I didn't grow up to such wars.
However, what I wanted to ask: is it possible to write an application in C or Python on Android (I heard that it is possible in Python, but for some reason I only meet snakes).

Answer the question

In order to leave comments, you need to log in

8 answer(s)
O
OnYourLips, 2015-10-14
@OnYourLips

I really don’t understand how such an ugly technology could spread so widely.
This is an excellent technology: with just a couple of performance / memory drops, we get a secure reliable system.
Sobsna why many people scold Java because of its "bulkyness and slowness", but development continues on it?
Scolding beginners: they do not understand that for 99% of projects even a tenfold difference in code performance is insignificant.
or Python
It is much slower than Java. And Java is only marginally slower than native code.

O
Oleg Gamega, 2015-10-14
@gadfi

oh you made my day))
from the detscope products jetbrains, netbens and a number of utilities (the first thing that comes to mind, I must admit, I don’t use detscope software very much, even an office in the clouds, someone else will name more)
from server classmates, a tweeter (although there seems to be more scala, but not the point) + many other resources to their set are easily added to web applications written in jvm languages
I haven’t seen a more classic OOP (c# and java are the same eggs in this regard, the difference is in sugar / backward compatibility), let me ask you about your background? what are you comparing with?
yeah, they’ve been talking about this almost since the birth of java, but the number of vacancies is only growing ─ don’t forget that the share of children’s software is basically decreasing, everything goes to the web
cumbersome is not java, cumbersome development in java for the web ─ such is the price for the stability and predictability of the result, these are not language features, the language simply allows you to implement all those patterns and technologies that together are called java ee. This is an enterprise, projects last for years, expand and grow into monsters)) The same c# in this regard is the same combine, this is not bad, this is a market requirement
Quite secure, but yes resource-intensive ─ both in terms of man-hours and in terms of hardware. Quite an acceptable price, just at the cost of memory we get a speed close to c ++
it makes sense to write resource-intensive tasks in c / c ++ ─ processing video, sound, etc., just writing a regular application in c / c ++ is stupid, the overhead costs of calling JNI can be higher than if you just wrote in java
on python under android is generally dark, you work with the same sdk, just catch more kiwi bugs or something like that, by the
way, the speed of python on the web is also much lower than the speed of java, but this is not a problem)

I
Ivan, 2015-10-14
@LiguidCool

In short: "this is how it happened historically." Sun / Oracle actively promoted Java in wearable (and not so) devices. The same Nokia 3310. When the games were like a snake, the performance was quite enough. Modern phones have come to life "by inertia", tk. at least the progers did not want to relearn much. Correct gentlemen, if not right.

A
Alexander, 2015-10-14
@NeiroNx

Because the entire shell is written in Java - for other languages ​​there are "layers" of interaction with Java, the functionality of which is limited. Most games for android work in C ++ - through the included "native" libraries. And all resource-intensive operations are performed through them.
Programs that work without an interface can be written on anything - if there is an interpreter or compiler for the selected processor.

C
chupasaurus, 2015-10-14
@chupasaurus

The dog barks, the caravan moves on. Do not believe everything that is written on the Internet.
Android applications are written in Java, since the OS itself is designed to work with Java applications.
For a family of C-like languages, there is the Android NDK (there is a C API corresponding to the Java API). For Python, there is py4a , which clings to the NDK through C-bindings.

B
bromzh, 2015-10-14
@bromzh

For android, I write in Java because Google has long loved this language, and made its mobile OS (android) in this language. Under the hood there is a special Linux kernel and a redesigned Java virtual machine, which serves as a layer between the applications and the kernel. Those. almost any application runs in this virtual machine, so it must be written in Java (to be more precise, the virtual machine runs the bytecode that is obtained after compiling programs). And most of the libraries are for Java.
You can write in python, but it's slow. And the libraries are much smaller.
You can also write in C / C ++, but there are some troubles. and Google recommends using this only in extreme cases.
For other languages, the infrastructure is also small. So in 95% it is worth taking Java, as intended.
Well, about the fact that Java is terrible, there are no applications on it and it will die soon - this is complete nonsense. The language is simple (albeit verbose), the JVM infrastructure is even better. there is a huge number of libraries for all occasions. Well, his prospects are very good: there are now much more android phones than phones on other platforms, the enterprise loves and uses Java with might and main (the vast majority of Internet banks are in Java), desktop applications can be written in good JavaFX. Those. the scope is very wide. And this is really a cross-platform language, so you can run your crafts almost anywhere. The speed of Java is quite good (for example, in the benchmark of network frameworks , servers in Java are usually in the lead), and verbosity is treated by other languages ​​(scala, kotlin, groovy).

A
Alexander, 2015-10-14
@komjaga

basically the choice fell on Java because of its platform independence

L
leventov, 2015-10-14
@leventov

Because for all the shortcomings, in the middle of the 2000s it was the most adequate managed language.
In the future, Java can be replaced by Dart as a priority language, if it does not die itself. Although Java, of course, will remain.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question