Android Interview--2015-4-29--roll leather network technology priority Company

Source: Internet
Author: User

Today's interview to Shenzhen Roll Skin Network Technology Co., Ltd. to interview, the interviewer is a woman, but also a beautiful woman, well, after the interview, I feel that in addition to the above should be female wit + female man complex.

Below is a record of interview-related issues, and where you might need to improve in the future:

First of all, a long time without an interview, it is possible to expose some during the interview process.

Second, there are technical aspects of the technology is not as good as people's place, this in the future work as soon as possible to make up.

Third, may later except in the work found insufficient, should cut off time to go out under the interview, even if not the interview to a good company, by the great God/Aunt abuse A is also very good, anyway know oneself insufficient, will go to make up, also will carry on the technical upgrade and development direction of determination.

The above is the sentiment, a bit is the technical point of relevance:

1,listview optimization related?

(1), first through the viewholder to achieve the Convertview cache.

(2), a variety of types of processing: Heavy Getitemtype () and Getviewtypecount (), in the GetView switch switching between different layouts, switching different holder, The content displayed on the UI is set according to different item.type.

(3), load time, do not open threads every time, try to use the thread pool instead of opening each thread.

(4), ListView scrolling Stop loading Picture:

If you use Umloader:

Using the Imageloader Pauseonscrolllistener method can be set to the ListView slide stop after loading the picture, this is a good way to solve the lag

Private void  ///Pauseonsceoll and pauseonfling are set to true to indicate that the slide is stopped before the picture is loaded Listview.setonscrolllistener ( New Pauseonscrolllistener (Imageloader, Pauseonscroll, pauseonfling));}

2. When configuring Imageloader, do not use the. MemoryCache (New Lrumemorycache (2 * 1024 * 1024)) or. MemoryCache (new Weakmemorycache ()) Can make the ListView slide back when the picture is displayed correctly, do not need to reload, I think it should be the cache life cycle is longer, all pictures directly from memory read, fast.

New Imageloaderconfiguration.builder (Getapplicationcontext ()). ThreadPoolSize (3-1). Denycacheimagemultiplesizesinmemory (). Disccachefilenamegenerator(new  md5filenamegenerator ()). Tasksprocessingorder (Queueprocessingtype.lifo) disccacheextraoptions (compressformat.png , Null). Memorycacheextraoptions (disccachefilecount).writedebuglogs (). Defaultdisplayimageoptions (Dogetoptions ()). build (); Imageloader.getinstance (). init (config);

(5). The XML configuration of the ListView is set to Match_parent without Wrap_content, which also affects the smoothness of the ListView

Android:layout_width= "Match_parent" android:layout_height= "Match_parent"

(6), in adapter GetView () want to set the default picture of each item to use. Setimageresource () instead of. Setbackgroundresource ()

(7), ListView Picture Confusion Problem because of the convertview reuse mechanism caused by the workaround: Set tag as Picture URL

2, inter-process communication in addition to AIDL, there are those ways to implement?

In addition to AIDL, there are radio and ContentProvider, the following two did not answer, the main may be not so deep.

3,activity four types of start-up modes, in addition to the theory, the actual work of the use?

Standard: Default mode, can not write configuration. In this mode, a new instance will be created by default. Therefore, in this mode, you can have multiple identical instances, and also allow multiple identical activity overlays.

Singletop: There can be multiple instances, but multiple identical activity overlays are not allowed. That is, if the activity is at the top of the stack, the same activity is started, the new instance is not created, and its Onnewintent method is called.

Singletask: There is only one instance. When you launch him in the same application, if the activity does not exist, a new instance is created in the current task and, if present, the other activity on top of the task is destory off and the Onnewintent method is called.
If you start it in another application, a new task is created and started in that task Activity,singletask allows other activity to be stored in a task, that is, If I open a new activity in this Singletask instance, the new activity will still be in the task of the Singletask instance.

SingleInstance: There is only one instance, and this instance runs independently in a task, and this task is the only instance that does not allow any other activity to exist.

4,viewpager+fragement first load, not load for the second time?

5,listview pull-down refresh, how does the pull-up load be implemented, from the code point of view?

6,umloader the bottom of the design to those algorithms, say the specific few?

This I said the LRU algorithm, but did not speak carefully;

Linkedhashmap first-out linked list structure, can remember the order of storage, when stored will determine whether the cache is outside the construction method passed in the cache size, if exceeded, will delete the oldest inserted content

Memory caching technology provides quick access to images that consume valuable memory from applications. The most core of these classes is LRUCache (this class is provided in the ANDROID-SUPPORT-V4 package). This class is ideal for caching images, and its primary algorithm is to store recently used objects in linkedhashmap with strong references, and to remove the least recently used objects from memory before the cache value reaches a predetermined value.

In the past, we often used an implementation of a very popular memory caching technique, either soft or weak (SoftReference or weakreference). However, this is no longer recommended because, starting with Android 2.3 (API Level 9), the garbage collector is more inclined to reclaim objects holding soft or weak references, which makes soft and weak references less reliable. In addition, in Android 3.0 (API level 11), image data is stored in local memory, so it cannot be released in a predictable way, which poses a potential risk of memory overflow and crash of the application .

7, what kinds of design patterns to use, say specifically used?

This was only a single case, I was talking about the database operation class is set as a singleton, do not have to go to new objects every time, but asked what the singleton model embodies what thought, I was blindfolded.

I hope the great God can be in the comments in the following points, or the relevant knowledge point connection to a, I am good to learn, greatly appreciated

Android Interview--2015-4-29--roll leather network technology priority Company

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.