Why Android convention does not follow plain Java

So, I have been working on android for about two years, and about 6 with java, from the very beginning I liked the fact that I found them where Java Convetion is , this guide that will help me write more understandable code that you know, typical CalmelCase Upper for the class below for the method, or getter and setter JavaBean, etc. But what I also saw, Android itself sometimes does not follow from them,

I would like to know why?

The private attribute is not declared and follows the pattern getter and setter. Is it as vicious as some say? or they just leave it like that, for example, for purposes.

Do they start a member with the prefix 'm'? for me it is sometimes annoying, but are there hidden truths? or just indicate the participants?

It seems they like a static class until I used them?

Do you know anyone you want to share?

+4
source share
3 answers

I found several answers to your questions when I have questions like yours. Here's a link:

Android: performance design

+3
source

A code / style / language convention is simple: convention , this is convention. You do not have to follow the Java convention, as if it were the only correct way to write Java code. It is important to follow some kind of convention, especially in a team, but the one you are following does not matter.

Android only has some differences from the proposed Java, which probably relates to some extent to the mobile technology itself and to some extent to the preferences that Google engineers had when they wrote all this :).

+1
source

When I was working with Android files, I found that the design of Android is not in the โ€œgood object orientedโ€ style. For example, I found several classes with 2 thousand lines of code. And yes a lot of hard code too. Regular Java programmers will be angry with you if you do. The link in one of the previous posts shows that we can increase productivity using large objects, static variables and direct access to fields. Also, the Android code is well divided into services that perform different tasks and have different responsibilities.

It looks like Google engineers were balancing between a โ€œgoodโ€ design and performance.

+1
source

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


All Articles