当前位置:网站首页>Collation of basic knowledge of intermediate development of Andrews (for interview)

Collation of basic knowledge of intermediate development of Andrews (for interview)

2022-06-11 07:49:00 The cat in my arms


Preface

In my spare time today, I will sort out the knowledge I often use in my work , More boring and basic , I wish to record , I call it Android octet , Of course, Android has a lot of things , Only common ones are recorded here , That being the case , And a lot more .

The following will be boring , Because it is sorting, so many are links

 Insert picture description here


One 、Android Four components 、 Six layouts 、 Five storage

Android Four components 、 Six layouts 、 Five storage

Four components
 Insert picture description here

Two 、 Android thread principle

1、 Based on using

Inherit Thread class
Realization Runnable Interface
Handler
2、 Compound use

AsyncTask
HandlerThread
IntentService
3、 Advanced use

Thread pool (ThreadPool)
Android Several ways to realize multithreading

3、 ... and 、 Android open source framework

Some mainstream :
Network framework
OKHttp Detailed explanation
android retrofit From ignorance to introduction (retrofit Is based on OKHttp encapsulation )

sqllite Database framework
greendao
room(jecpack)

Data binding
Android ButterKnife( Butter knife ) Use

Responsive programming framework
rxjava

The minority ( Bloggers are involved in their own work , It's still hot , There is no classification here )

andserver( Network framework )
zxing( Sweep code )

Third party access experience , There are many words about this , Alipay, wechat, iFLYTEK, Aurora, etc , quite a lot , You have to have your own experience to say it

3、 ... and 、 Android Architecture MVC、MVP、MVVM

MVC、MVP、MVVM The difference and connection between

Four 、 Design patterns

Though it is java From the perspective of language , But it's really good
Java Summary of common design patterns

Arrange interview questions

Not a big factory , It's the questions that bloggers ask themselves in the interview , More basic , But when I first met him, I really had the problem of whether I could react , The interview questions of the sorted knowledge points are not taken out separately

1.Activity A Jump to Activity B, The execution process of the life cycle

Activity A Jump to Activity B, The execution process of the life cycle
Mom doesn't worry about the series Activity Life cycle of
The title of this article is ... But the content is quite complete

2.Android Radio receiver (BroadcastReceiver) Start priority problem for

Android Radio receiver (BroadcastReceiver) Start priority problem for

3. Five storage ( See above Android Four components 、 Six layouts 、 Five deposits Store )

4.Android Customize view The type of

1. Self drawing control , Inherit view, rewrite onDraw Method , Draw in it , You need to fit the margins yourself, etc
2. Inherit ViewGroup Derived special Layout, It is mainly used to realize custom layout , You also need to adapt the margins
3. Inherit specific View( Such as TextView etc. ), Don't use your own adaptive support wrap_conten,match_parent, You can add new functions to it
4. Inherit specific ViewGroup, for example linearlayout, It is used for combination of multiple controls view, And you don't have to do it yourself
5.( Personal supplement , According to my own experience )activity Set pop-up mode

5.Activity Four startup modes of

standard
  Every time you start, you will re create an instance , No matter this Activity Whether it already exists in the stack . Who started this Activity, that Activity It's running on the one that started it Activity In the stack . use Application Start up Activity When an error , The reason is right and wrong Activity Of Context No task stack . The solution is to wait for startup Activity To develop FLAG_ACTIVITY_NEW_TASH Sign a , This will create a new task stack for it .
singleTop
  If new Activity At the top of the task stack , Then this Activity Will not be recreated , At the same time callback onNewIntent Method .onCreate and onStart Method will not be executed .
singleTask
  This is a single instance mode . If it doesn't exist activity The required task stack , Create a new task stack and a new Activity example ; If the required task stack exists , No instance exists , Create a new one Activity example ; If there are required task stacks and instances , Do not create , call onNewIntent Method . At the same time, make the Activity All above the instance Activity Out of the stack .
Reference resources :taskAffinity Property is used to identify Activity The required task stack , Of the same identification Actvity In the same stack .
singleIntance
  Single instance mode . have singleTask All the features of the pattern , With this mode Activity Can only be in one task stack alone . So a new stack will be created each time .
You can do this from the command line adb shell dumpsys activity Command to view... In the stack Activity Information .

6. How to write three instances in singleton mode

Return different instances according to different times in the empty space ( This is a personal understanding , Please correct any mistakes in the comments section )

Then I asked the group Friends of the technology group to understand what the interviewer wanted to ask , The boss said he probably wanted to ask How to implement different singletons between threads Because the singleton is interprocess , Then the interviewer will order something Didn't ask the point .

And then there is the sharing pattern in the design pattern , Because it's not often used , First, I didn't remember ( Chagrin )

7.Java Four quotations

This problem is solved by weak reference activity Memory leak problem .
Java Four quotations


summary

Standing on the shoulders of giants , It's easy to find a job , The interview will be added later

原网站

版权声明
本文为[The cat in my arms]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206110745155070.html