当前位置:网站首页>Mobile Internet development major, an interview experience about JVM
Mobile Internet development major, an interview experience about JVM
2022-04-22 00:41:00 【mb6260162caa201】
Introduction
It's interview season again , I had to take part in the battle myself , In fact, it started from the end of last year ,Android There are not many good opportunities , But it's ok ,3 year + Of android There are still some interview opportunities for the development experience , But the threshold is not as low as it was a few years ago , The general experience is that small start-ups pay more attention to whether your project experience fits with your own , Just come and be alone .
In addition to focusing on the project experience, big factories , Also pay more attention to the breadth of your knowledge , It's breadth 、 In depth and solutions , You should accumulate enough work at ordinary times and brush questions temporarily. It's estimated that you can't pass the test if you only talk about superficial questions . The following is a summary of some knowledge points that will be asked in the interview of large factories , I sorted out the best videos on the Internet , There are all kinds of styles .
The interviewer asked a question , Let's see A、B and C How are the three students doing
A
interviewer : say something Application The role of .
A:Application It is a system component that will be created after the application process is created , So you can use it to do some initialization ;Application The life cycle is as long as the application process , So it can be used to provide... For class libraries Context; Because in all Context You can get Application So it can be used to save and pass global variables .
interviewer : You usually put global variables in Application ? The app is recycled in the background , What if the value is lost when reopening ?
A: yes , Very convenient , Just make a fault-tolerant judgment
interviewer : well , Go back and wait for the announcement
B
interviewer : Say yes Application The understanding of the
B: effect : Do initialization 、 Provide context . in addition Application It's a Context , It inherits directly ContextWrapper ; This ContextWrapper Member variables of mBase Can be used to store the system implementation ContextImpl, So we're calling Application Of Context When the method is used , They are finally called to... Through static proxy ContextImpl Methods . We call ContextWrapper Of getBaseContext The way to get it ContextImpl Example
interviewer : You usually put global variables in Application ? The app is recycled in the background , What if the value is lost when reopening ?
B: Can't , Save global variables with static variables , Or a single example can gather them in a more appropriate position .
Avoid application recycling and data loss , When you can pass parameters to a page , adopt Intent Pass parameters , This is recycled and reopened from Intent There is still value in taking parameters . If the amount of data is large, you can also consider data persistence ; Another way is through onSaveInstanceState and onRestoreInstanceState Save the corresponding data when it is recycled and restore the data when it is reopened .
interviewer : Let's talk about Application Life cycle of
B: comparison Activity ,Application The life cycle of is simply not too simple . First, the constructor will be called when it is created , Then the system is ready ContextImpl adopt attachBaseContext( Context ) Method injection into Application, Then call our most familiar onCreate Method .API There's one more onTerminate Method will call back when the process is killed , But only if the simulator works , You don't need to pay attention .
interviewer : Then you can go on Application The initialization process of ?
B: Basically the ones mentioned above , I didn't understand it in detail
interviewer : well , Go back and wait for the announcement
C
interviewer : The way Application Initialization process of
C:Application The initialization of is after the application process is created :
ActivityThread call AMS Of Binder object ( IActivityManager ) Of attachApplication Method
AMS After receiving the request, call ActivityThread Of bindApplication Method
ActivityThread We received a request here to assemble another AppBindData object , Encapsulate all parameters , Re pass handler Send to the main thread to execute
The main thread loop To this message , call handleBindApplication To actually handle initialization Application
handleBindApplication Talk to us “Context” That ,Activity The initialization of is almost the same . Take a look back. :
ClassLoader load Application class , Instantiation
initialization Applicaction With ContextImpl
adopt Application.attach( Context ) Method , call attachBaseContext( Context ) take ContextImpl Injection into Application
Last call Application.OnCreate()
such Application Initialization is complete
interviewer : Why don't you call directly when the process is created handleBindApplication To create Application Well , Go again AMS There was a circle over there
C: call AMS Of attachApplication Not just to create Application , In addition, before the process is created, the four components of the application may be called but cannot be started ; Now the process is created , Create good Application Also deal with these components to be started . So you have to go through AMS Unified scheduling , If Application Creation and onCreate If the callback takes time , It will also affect the startup time of these components to be started
interviewer : Sure , Let's talk about something else .
Last
For the convenience of friends who need to learn , I organized the materials into a video tutorial ( In fact, it took a lot more energy than expected ), Due to limited space , It's all in my GitHub On , Click to get free !
Androidndroid Architecture video +BAT Interview topics PDF+ Learning notes
It's easy to be a programmer , To be a good programmer is to keep learning , From junior programmer to senior programmer , From junior architect to senior architect , Or go to management , From technical manager to technical director , Each stage requires different abilities . Set your career direction early , In order to get rid of peers in work and ability improvement .
- No matter how good you are, you must Continuous learning No chicken soup , Others seem effortless , In fact, it took a lot of effort , These four words are my advice !!
- I hope everyone who works hard to live IT The engineer , Will get what they want , Because we work hard , We deserve it .
It's easy to be a programmer , To be a good programmer is to keep learning , From junior programmer to senior programmer , From junior architect to senior architect , Or go to management , From technical manager to technical director , Each stage requires different abilities . Set your career direction early , In order to get rid of peers in work and ability improvement .
No matter how good you are, you must Continuous learning No chicken soup , Others seem effortless , In fact, it took a lot of effort , No one can succeed at will .
come on. , Mutual encouragement .
版权声明
本文为[mb6260162caa201]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204212349052065.html
边栏推荐
- On the happiness of fishing -- April 20
- [Golang]力扣Leetcode - 657. 机器人能否返回原点(模拟)
- Selenium automatically logs into QQ space (headless and evasive)
- LeetCode_62 不同路径
- 2022 Beijing Eye Health Exhibition, Beijing glasses exhibition, Beijing myopia correction exhibition, optometry Exhibition
- 面试题8——捕获的雨水
- L1-043 阅览室
- 一文读懂MES系统生产调度管理功能
- 移动互联网app开发,字节跳动 京东 360 网易面试题整理
- Multiple forms of alternate printing implemented by multithreading
猜你喜欢
![【C语言】深度剖析文件操作 [进阶篇_ 复习专用]](/img/49/2e1554780cd67ba336c051d08e1e1a.png)
【C语言】深度剖析文件操作 [进阶篇_ 复习专用]

Response result definition specific error code

GPU的未来方向是什么?
![[Golang]力扣Leetcode - 657. 机器人能否返回原点(模拟)](/img/50/7e483e2d2761b60f05c3ae8a928137.png)
[Golang]力扣Leetcode - 657. 机器人能否返回原点(模拟)

Memory management

When the notebook expands the external display, the mouse cannot move to another screen outside the main display

It is said that MES can improve the production efficiency of enterprises. What are the specific aspects?

OJ每日一练——水仙花数

.NET 20周年学习挑战赛| .NET 移动应用

excel下拉框引用另外一个sheet
随机推荐
[C language] in depth analysis of document operation [advanced special for review]
等待wait(),wait(long),wait(long,int)/通知机制notify(),notifyAll()
MinIO,Zuul
R-Dropout
SEO keyword expansion - Automatic Keyword expansion software free download
Redis (I): basics of redis - Introduction to redis, basic data types, general instructions, jedis
零基础转行网工,我是如何拿到月薪20K的,网工系统学习路线分享
Architecture practice battalion - module III - operation
On the happiness of fishing -- April 20
微服务简介,Euraka,Ribbon,openFeign
C language structure
MYSQL8硬盘版安装配置
新一代MES软件十大核心要素(下)
中商惠⺠交易中台架构演进:对 Apache ShardingSphere 的应⽤
[ES6] simplified writing method of object method, arrow function, parameter default value and rest parameter
DP optimization
一文读懂MES系统生产调度管理功能
24张图攻克border-image
面试题8——捕获的雨水
gorm 操作mysql