My android interview path (3: various statuses), the path to android

Source: Internet
Author: User
Tags dell battery

My android interview path (3: various statuses), the path to android
Every day, there are various statuses

Wow, hahahahahaha I wrote a notebook just last night and sent it out in just one minute after it got lost. Wow, the following is yesterday --

I suddenly missed the written test of a startup company-(some of my colleagues went to the site to issue an offer official job in Beijing for 3000 a month. Haha, I don't want to talk about it. I feel like this is an unfriendly life)

Some people in the comments say that I'm not talking about it and it's not good. Okay, I have to continue.

Some people say that I am a programmer. I don't know how to feel this.-(forgive me for being low)

Some people say that I am writing a journal account... Okay.

Speaking of various statuses, this status is really uncomfortable recently. This afternoon, I also received a phone interview and only asked a few simple android questions (it is indeed very basic) then I asked if I could continue to come to Beijing for an interview (too many school recruits can't do it). Why is there a lot of opportunities in Beijing?

When it comes to status, I think of the activity lifecycle. This is also the most frequently asked question. The interviewer will be very happy to ask you.

For example, if you open an activity and a call is made, what lifecycle has this activity experienced? Or when you press the back key? Or press the Home Key?

Confident ~

"First, there are several lifecycles for this activity"

"OnCreate () onStart () onResume () onPause () onRestart () onStop () onDestroy ()"

    

Is a picture given by google (images are directly plagiarized from others' blogs)

"First, let's talk about the lifecycle of a normal activity from opening to pressing the return key to exit"

"OnCreate () ---> onStart () ---> onResume () ---> onPause () ---> onStop () ---> onDestroy ()"

"OnCreate () (once) ---> onStart () will be called back when activity is created (invisible) ---> onResume () will be called back when activity is restored () (It will be called back after onStart () ---> onPause () When paused ---> onStop () When stopped ---> onDestroy () when destroyed () (back key or insufficient system resources kill low-priority activities )"

"Then let's talk about the lifecycle of the activity from opening to pressing the Home Key and then switching back"

"OnCreate () ---> onStart () ---> onResume () ---> onPause () ---> onStop () ---> onRestart () ---> onStart () ---> onResume ()"

"Lifecycle of incoming calls"

"OnCreate () ---> onStart () ---> onResume () ---> onPause () ---> onStop ()"

After answering these questions, I will explain how I normally use the activity lifecycle.

I load resources in onCreate (), such as listView = (ListView) findViewById (R. id. listview); (do not perform time-consuming tasks)

The onResume () and onPause () Methods perform symmetric operations.

For example, when paused, some user data is saved and read when recovered. When recovered, some resources are released when the created resource is paused.

There is also onStart (), which is especially important because it is visible that the longer the interaction is, the worse the experience.

When the activity is not destroyed and restarted, onRestart () is called back ()

In other cases, for example, when a user's activity is invisible, he or she experiences onPause () ---> onStop () calls (a new activity is activated) to block the current activity.

AlertDialog this should be particularly noted that this does not affect the lifecycle of the activity.

There are also some computers with power (the dell battery crashed several years ago and turned off the lights at. It took about 20 minutes to get power and three minutes to complete)

I wrote it here yesterday-various computer statuses

There are two other blogs that describe activity lifecycles in detail and recommend them to you.

Http://www.cnblogs.com/zyw-205520/p/3313268.html

Http://www.cnblogs.com/mengdd/archive/2012/12/01/2797784.html

Get up in the morning

    

    

    

    


Android interview questions

1. Preface
In June 26, Google Android released NDK, which aroused the interest of many developers. NDK full
It is called Native Development Kit. Is:
.Android.com /....
2. misunderstanding
In addition to surprises, new things will also bring us some confusion and misunderstanding.
2.1 misunderstanding 1: Android does not support C development before NDK is released
Search for "NDK" in Google, and many "Android can finally be developed using C ++" and so on.
This is a misunderstanding of the Android platform programming method. In fact, since its birth, the Android platform has
Supports C and C ++ development. As we all know, Android sdks are implemented based on Java, which means
Third-party applications developed by the SDK must use the Java language. However, this is not equivalent to "third-party applications can only
Use Java ". At the first release of the Android SDK, Google claimed that its virtual machine Dalvik supported JNI programming.
Method, that is, third-party applications can call their own C dynamic library through JNI, that is, on the Android platform,
The "Java + C" programming method can always be implemented.
Of course, the root cause of this misunderstanding is that no JNI can be found in the Android SDK documentation.
Help. Even if third-party application developers use JNI to complete their own C dynamic link library (so) development
How to package and release the SDK together with the application? There are also technical barriers. I used to spend a lot of time,
Install the cross-compiler to create the so and use the asset (Resource) method to bind the so release. But this method only
It can be a clever way, not an official... the rest of the full text>

Android interview considerations?

1. The foundation lies in the Activity lifecycle. You must be familiar with onResume onNewIntent onDestroy onFinish.
2. The control won't be too mentally retarded.
3. the WebService and HttpRequest methods for network interaction may be difficult to connect to a Socket.
4. framework level, understanding of the overall framework of Android design, mainly 2 points, 1: centralized management of navigation 2: centralized management of all interfaces
The latter can inherit a baseview and record all Opened Views in the baseview as a set for management.
The former sends all jump requests to tasks in asynchronous mode and queues them in the background. After the solution is completed, the page is refreshed through messages and Handle.
5. after more than half a year of experience, I started to study this kind of knowledge. For example, I am currently studying PN push. This real-time push is very useful, for example, real-time chat, real-time message broadcast, or advertisement push, this indicates that your level is high, and you need to pay for it.

Note that you must have a good understanding of the overall framework. It is very important to design a reasonable framework to implement functions.
If you tell others that you know the background, you can do or coordinate the background server to complete the function.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.