Android Part Knowledge Summary

Source: Internet
Author: User

1, for Android Adoption Interface List collection can be timely response after the event changes

2, Android application layer is not recommended to often use a singleton mode, otherwise it will lead to the application and more non-controllable. Even if the activity destroys data, it is not emptied unless rigorous data initialization is used.

3. Custom Controls

4, for the thread is can interrupt operation

Handler.removecallbacks (runnable);

Task.cancel (TRUE);

5, for high-definition picture loading. Unable to load the original image directly using Image.setbitmap () will cause memory overflow oom, the principle is an Android application memory usage limit around 60M. Of course, you can also use more memory, but even so, the picture will load slowly. The size of the picture loaded into memory is related to the picture codec and resolution, and for Bitmap.Config.RGB_565 encoded as bitmap the picture is a resolution that occupies 2 B bytes. such as: (Bitmap.getbytecount () can get the memory size occupied by the picture)

1920*1080*2 = 4147200 = 3 m memory

2160*4096*2 = 16777216=16m Memory

6, argb_8888, Alpha_8, argb_4444, rgb_565 the difference

A: Transparency R: Red G: Green B: Blue

Bitmap.config argb_4444: Four bits per pixel, which is a=4,r=4,g=4,b=4, then one pixel takes up 4+4+4+4=16 bit.

Bitmap.config argb_8888: Four bits per pixel, which is a=8,r=8,g=8,b=8, then one pixel takes up 8+8+8+8=32 bit.

Bitmap.config rgb_565: Four bits per pixel, i.e. r=5,g=6,b=5, no transparency, then one pixel occupies 5+6+5=16 bit

Bitmap.config Alpha_8: Four bits per pixel, only transparency, no color.

In general, we are using the argb_8888, so that it is the most memory, because one pixel accounted for 32 bits, 8 bits = 1 bytes, so a pixel accounted for 4 bytes of memory. Suppose there is a picture of 480x800, and if the format is argb_8888, it will consume 1500KB of memory.

7. Resolution

1 k = 1920*1080

2 k = 1152*2048

4K = 2160*4096

720p= 720*1280

DV = 480*720

8, load large map can be used Bitmapregiondecoder class (reference http://www.mobile-open.com/2015/86228.html)

9. Server Setup

apache-tomcat-6.0.45 download zip file to use after decompression.

After configuring the JDK and environment variables including the Apache environment variable, start and shut down the server with the Startup/shutdown of the bin directory

Open path Conf/server.ini configuration file, modify connector port= "8080" protocol= "http/1.1" Port number

Host tag add access path <context path= "/server" docbase= "/server/web-inf/" debug= "0" reloadable= "true"/>

such as: https://localhost:8080/server/index.html

9. Android diff pack update apk--->http://blog.csdn.net/lan410812571/article/details/12840263

Android Part Knowledge Summary

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.