Reprint this article, I hope you have a good face questions sent to study ......
1, the process and the process of Android dvm Linux process, whether the application is the same concept
DVM refers dalivk virtual machine. Every Android application runs in its own process to run, have a separate instance of the Dalvik virtual machine. And every DVM is a process in Linux, so that the same can be considered a concept.
2, What is the role of EF
sim card filesim card file system has its own norms, mainly in order and mobile communications, sim itself can have its own operating system, EF is
stored and used for mobile communications
3, embedded operating system, which has several memory management, what the characteristics of each?
Page type, stage, section pages, use the technology
MMU, virtual space
4, what is the embedded real-time operating system, Android operating system is real-time operating system do?
The embedded real-time operating system means that when external events or data generated, can accept and be fast enough to handle, process and can result in a prescribed period of time to control the production process or the system to respond quickly to treatment, coordinated control of all real-time tasks and run embedded operating systems. Mainly used in industrial control, military equipment, aerospace and other fields on the response time of the system has stringent requirements, which requires the use of real-time systems. Soft real-time and can be divided into two kinds of hard real-time, while android is based on linux kernel, so are soft real-time.
5, a maximum number of short messages accounted byte?
Chinese 70 (including punctuation), English 160 bytes
6, android animation in which of these categories, their characteristics and what is the difference?
Two, one is Tween animation, there is a Frame animation. Tween animation, this implementation can view the components move, zoom and produce changes in transparency; another Frame animation, traditional animation methods, arranged by order of play to achieve a good image, like a movie.
7, the principle
handler mechanismHandler and Looper andriod provided to meet the communication between threads. Handler FIFO principle. Looper class is used to exchange management message (Message Exchange) between objects within a particular thread.
1) Looper: Looper thread can generate an object from it to manage this thread in the Message Queue (Message Queue).
2) Handler: You can construct Handler object to communicate with Looper, in order to push a new message to the Message Queue Lane; Looper remove or receive) messages are sent from the Message Queue.
3) Message Queue (Message Queue): used to store the thread into the news.
4) thread: UI thread is usually the main thread, while Android will start the program on its behalf to create a Message Queue.
8, talk about the principles mvc mode, it uses the android in
MVC (Model_view_contraller) "model _ view _ controller." MVC application always consists of three parts. Event (event) result in changes in Model or Controller View, change, or both simultaneously. Just Controller Models changed data or attributes, all dependent View will be automatically updated. Similarly, as long as the Controller to change the View, View will
Retrieve data from the underlying Model to refresh yourself.
View redraw and memory leak seems to frequently asked interview questions
1 View refresh:.
The need to refresh the place, using handle.sendmessage send information, and then perform invaliate or postinvaliate inside the handle of getmessage.
2. GC memory leak
Situation occurs:
1. Cursor database is not closed
2 When constructing adapter, do not use the cache contentview
Derivative listview optimization problem ----- reduce create view objects, make full use of contentview, you can use a static class to optimize the treatment process getview /
3.Bitmap object using recycle when not in use () to release memory
4.activity in the life cycle of an object is greater than the activity
Debugging method: DDMS ==> HEAPSZIE ==> dataobject ==> [Total Size]
There are other issues, we welcome suggestions for A, may be the overall architecture, as well as the Hal layer.
This article will involve the following elements
An Activity lifecycle
Two into a window to let Activity: Activity property
Three background Activity is
your systemRecycling how to do: onSaveInstanceState
Four calling and being called: Our communication messenger - Intent
An Activity lifecycle
And other applications, like mobile platforms, Android application lifecycle is a unified control, that we write applications fate in the hands of someone else (the system), we can not change it, only to learn and adapt to it.
Say briefly why this is so: We phones running
When an application, it is possible to send incoming calls coming in text messages, or no electricity, and this time the program will be interrupted priority to serve the basic functions of the phone, the other system will not allow you take up too many resources, at least to ensure that the phone function of it, so when the resource shortage will likely be killed. Closer to home, Activity of the basic life cycle shown in the following code:
Java code
public class MyActivity extends Activity
{
protected void onCreate (Bundle savedInstanceState);
protected void onStart ();
protected void onResume ();
protected void onPause ();
protected void onStop ();
protected void onDestroy ();
}
Write your own Activity will
necessaryRe-upload these methods, onCreate is inevitable in an Activity normal startup process, the order they are called is onCreate -> onStart -> onResume, when the Activity is to kill order is onPause -> onStop -> ; onDestroy, this is a complete life cycle, but someone asked
, Yet the program is running to the phone, this program supposed to? Suspended the chant, if aborted when an Activity is a new full-screen so: onPause-> onStop, recovery time onStart-> onResume, if interrupted
This app is a Theme for the Translucent or Dialog's Activity then just onPause, restore
When onResume.
Details about what these methods in the system is doing and what we should do:
onCreate:
Here creation interface, do some data initialization
onStart:
This step becomes the user to interact with non-visible
onResume:
Become and user interaction (the activity of these two systems management stack by stack top Activity of the way, pop the stack runs out, then return to the previous Activity)
onPause:
This step is to be seen but can not interact with the system will stop the animation and other things that consume CPU already know from the above description, it should save you some of the data here, because this time the priority of reducing your program, there may be system recovery. Here the saved data should be read in onResume came out, Note: This method was time to do something shorter, because the next activity will not be completed until this method before starting
onstop:
Becomes invisible, covered by the next activity
onDestroy: This is the last one before the activity is to get rid of the method is called, may be invoked finish outside class method or system to save space temporarily get rid of it, you can use isFinishing () to determine which, if you have a Progress Dialog rotation in the thread, please onDestroy where he cancel out, or so the end of the thread, call Dialog's cancel method throw exceptions.
onPause, onstop, onDestroy, three states are likely to be the system to get rid of activity in order to ensure the correctness of the program, you want to onPause () to write the code persistence layer operation, the user to edit the contents are saved to the storage medium (usually a database). Practical work because of changes in the life cycle brought a lot of problems, such as your application from a new thread in the running, this time interrupted, you have to maintain that thread is suspended or data back out or kill roll, is not it? Because Activity may be killed, so the variables used in the thread and some of the interface elements will be sure to pay attention to, and generally I have been using Android's message mechanism [Handler, Message] to deal with the problem of multi-threaded and interfacial interactions. I will talk about some of this back recently because these things have a big head, so I talk to sort out his thoughts to share.
Two into a window to let Activity: Activity property
Speak a relaxed bar, some people may want to do it in the application is a floating thing the main interface of the phone, then you only need to set a very simple theme about Activity can be defined elsewhere Activity in AndroidManifest.xml in one sentence:
Xml code
android
: Theme = "@ android: style / Theme.Dialog"
android: theme = "@ android: style / Theme.Dialog"
This allows your application to become a form of pop-up dialog box, or Xml code
android: theme = "@ android: style / Theme.Translucent"
android: theme = "@ android: style / Theme.Translucent"
It becomes translucent, [Tips -. -] Similar attributes such activity can be seen in AndroidManifestActivity method android.R.styleable class, introduced AndroidManifest.xml attributes of all the elements can refer to this Class android.R.styleable
It says the name of the property, specifically what the value is
in android.R.styleYou can see, for example, the "@ android: style / Theme.Dialog" would correspond to android.R.style.Theme_Dialog, ('_' switch <- note '.': This is the article content is not smiley) on can be used in the description file
In, and look for correspondence between the class definition and description of the file they all understand.
Three you backstage Activity recovered by the system how to do: onSaveInstanceState
When your program in one Activity A at runtime, the active or passive operation executed
another new Activity B this time A willJava code
public
void onSaveInstanceState (Bundle outState) {
super.onSaveInstanceState (outState);
outState.putLong ("id", 1234567890);
}
public void
onSaveInstanceState (Bundle outState) {
B will come after the completion of A, this time there are two cases, one is A is recovered, one is not being recycled, A must be received back to back calls onCreate () method, unlike the direct start Is this time onCreate () is put in the parameter savedInstanceState, it still has not been recovered onResume enough.
savedInstanceState a Bundle object, you can basically put him understood as a system to help you maintain a Map object. In onCreate () where you might use it, if it would not be a normal start onCreate, so use the time to determine whether empty.
Java code
if (savedInstanceState! = null) {
long id = savedInstanceState.getLong ("id");
}
if (savedInstanceState! = null) {
Like the official Notepad tutorial
In case you are editing a particular note, was suddenly interrupted, then put the id of this note to remember, then it's time to put that note can be taken out according to the id, the program will complete a number. It also depends on your application or need to save anything, like your interface is to read a list, it does not need anything special to remember, oh,
Chances are you need to remember the position of the scroll bar ...
Four calling and being called: Our communication messenger Intent
To say the Intent, Intent is this the intent of Intent to communicate between applications, call it, it will be sent to a phone Intent, part of this is the essence of Android loosely coupled architecture, which greatly improves the reusability of components , for example, you have to click on a button in your application, call someone, very simple ah, look code first:
Java code:
Intent intent = new Intent ();
intent.setAction (Intent.ACTION_CALL);
intent.setData (Uri.parse ("tel:" + number));
startActivity (intent); Copy the code
Throw such an intent, the system saw your intention to wake up on the phone dialer, playing out the phone. What to read contacts, send text messages, ah, ah-mail, all just need to throw intent is good, this part of the design to really good ah.
Intent to tell that by what the system needs who accepted him?
There are two methods commonly used Intent, the first of which is a direct description of a class needs to receive the code below:
Java code
Intent intent = new Intent (this, MyActivity.class);
. intent.getExtras () putString ("id", "1");
startActivity (intent);
Intent intent = new Intent (this, MyActivity.class); intent.getExtras () putString ("id", "1");. TartActivity (intent); Copy the code
The first way is obvious, directly specify the MyActivity as the recipient, and pass some data to MyActivity, in MyActivity could use getIntent () to come to this intent and data.
The second you need to take a look at the intentfilter AndroidMenifest configuration of
Xml code
This configuration is used inside the action, data, category these things, then you must think of clever intent will also have these things, then do not find a matching recipient of it?
In fact, the intent of the action is a string name.
On the face of this intent-filter configuration file illustrates this Activity can accept different Action, of course, not the same logic corresponding program slightly, mention that mimeType, he was
ContentProvider defined in, if you implement a ContentProvider yourself know, you must specify the mimeType to allow data to be used by others.
Principles say it did not know, a summary, is that you call the other interface is not new that interface directly, but by throwing an intent, so that the system can help you to call the interface, so how loose coupling ah, but in line with the is the principle of the system life cycle management.
Want to know what's category were, Android pre-customized for you all what's so good action, please visit the official link Intent
personallyps: Want to know how to call system applications students can take a closer look at your logcat, each time you run a program that is not there when some information such as:
Starting activity: Intent {action = android.intent.action.MAINcategories = {android.intent.category.LAUNCHER} flags = 0x10200000comp = {com.android.camera / com.android.camera.GalleryPicker}}
Then control what some of Intent set methods, you know how to call slightly, hope you enjoy :)
A, listview is how you optimize.
Two, view refresh, said before
Three, IPC and principle
Four, Android multithreaded
Five, Android Why should we design four major components, links between them, are not designed okay (mainly in order to achieve the MVC pattern, but java is also the hardest mode, there are few products can do well in this mode [Technicolor interviewer asked this])
Six, service period, activity cycle, the next you talk about internal applications on the Android understanding, for example, he made calls and contacts, etc. applications. There are a lot of things framework layer or multi-look familiar Android how to do, whatever you do application development or application development framework layer is very good.
Is your experience in project highlights you encounter any difficulties, then how to solve! Try to stand out each technical point, of course, sometimes in order to reflect the interviewer whether you really done, he will ask you to do that module in this application, with a number of issues like class.
Occasionally some interviewer will ask you, you used the built-in unit testing Android yet, how to use?
Of course, I interviewed a lot of units, some do flat, mobile phones, digital TV, some like to make an erp clients, etc., out of the front three, basically get rid of all of the Android, if true Android to do so, we still have much to learn.
In short, in a word, what the interviewer has, to the interview prepared to do everything, whether it is technology or had a solid foundation. A person's ability to converse is also very important, in short, not very standard Mandarin, at least you have to say let people understand, but have to put the interviewer speaks very thorough, so you get the opportunity to offer more, and talk about wages but also ~ ~ Of course, the advantages of a company interviewer once told me, technology is at the money, as long as you have the ability, how much money he requested.
1.View how to refresh?
2.DDMS with TraceView difference?
3.activity be recycled how to do?
4 In Java, how to introduce the C language?
Reference answer:
1.View can call invalidate () and postInvalidate () These two methods refresh
2.DDMS Viewer is a program execution, in which you can see, such as threads and stack information, TraceView procedural Performance Analyzer
3.activity recovered, it is only the other from the
4.java calling C language program, you can use the JNI interface to achieve
The above answer is for reference only, after all, my ability is limited Well, there will inevitably be wrong answer, huh .....
Answer:
1.View refreshed by the system (there are cycles within the system, monitor events, doing business processing, painted UI), you can use postInvalidate () to procure the system refresh.
2 (really do not know)
3 Please refer Activity lifecycle destroy the system if that is recovered, only the start of the new
4. Calls through JNI. Suggested Reading "The Java Native InterfaceProgrammer's Guide and Specification", in English, from the sun website it.<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Cattle ah. . Many do not know ~ ~ ~ ~ learn
Reply:
Reply:

Reply:
Reply:
Reply:
Reply:
Reply:
nice
Reply:
Reply:
To Collection ~ ~ ~ ~ ~ ~ ~ ~ ~
Reply:
Wow, so much information. Seems to take time to learn
Reply:
Reply:
Learn! ! !
Reply:
I see Kane
Reply:
Thanks for sharing.
Learn.
Reply:
If you learn
Reply:
Reply:

Reply:
Learn ..
Reply:
This temporarily only look at the way people say ah cattle
Reply:
Thank you, landlord. .
Reply:
Learning, a lot of knowledge ah ~
Reply:
Simple ah,
Reply:
Reply:
Learning, thank landlord! ! ! ! ! ! ! !
Reply:
Fairly extensive knowledge involved
Reply:
Can see, has not reached this level
Reply:
To Collection ~ ~ ~ ~ ~ ~ ~ ~ ~
Reply:
Good look at it
Reply:
Mark to find time to look at the
Reply:
Learning to learn
Reply:
Yes ah
Reply:
Thank you, landlord. .
Reply:
This is what is learning
Reply:
Reply:
Gray often to force
Reply:
Reply:
Learn, every day up
Reply:
Thank you for sharing, decisive collection
Reply:
Chinese word 2 bytes, generally a short message up to 70 characters, so it should be 140 bytes (byte) ah
Reply:
Android is not very good now is the fire you? ? ? ? ?
Reply:
Look, learn. . . .
Reply:
Well, very good, thank you
Reply:
Thanks so much, this share is very good!
Reply:
Landlord determine Baidu face questions? How I looked so familiar. . .
Reply:
Very bottom of things, learn!
Reply:
Powerful ah. . . . Ah good
Reply:
Reproduced feel good they brought to share. .
Reply:
Rub a collection of first
Reply:
Mark down
No comments:
Post a Comment