first, the encryption algorithm in AndroidThe previous article has introduced the Android System lock screen cipher algorithm principle, here to summarize said:The first type: input cipher algorithmEnter the plaintext password + The salt value of the device, then manipulate MD5 and SHA1 after the conversion to hex value for stitching, the final encryption information is saved to the local directory:/data/sy
1. Basic ConceptsScreen Size – The actual size of the screen, measured by the diagonal length of the screen (e.g. 3.4-inch, 3.8-inch). Android divides the screen into the following 4 types: Small,normal,large,extra large. How to judge?Screen Density -How many pixels are in a
The example of this article summarizes the Android implementation of screen rotation method. Share to everyone for your reference. Specifically as follows:
Before introducing, we need to understand the mechanism by default for Android screen rotation:
By default, when the user's cell phone's gravity sensor is turned
, float pxValue ){
Final float scale = context. getResource (). getDisplayMetrics (). density;
Return (int) (pxValue/scale + 0.5f );
}
The following describes how to obtain the Resolution:
Write the following code in the onCreate method of an Activity:
Copy codeThe Code is as follows:
DisplayMetrics metric = new DisplayMetrics ();
GetWindowManager (). getDefaultDisplay (). getMetrics (metric );
Int width = metric. widthPixels; // screen width (pixels)
(). getdisplaymetrics (). density;Return (INT) (pxvalue/scale + 0.5f );}
The following describes how to obtain the Resolution:
Write the following code in the oncreate method of an activity:Displaymetrics metric = new displaymetrics ();Getwindowmanager (). getdefaultdisplay (). getmetrics (metric );Int width = metric. widthpixels; // screen width (pixels)Int Height = metric. heightpixels; // screen height
Android revolving screen's behind-the-scenes internationalization language failure solution, android InternationalizationThis article has been synchronized to my blog: liyuyu.cn
I recently used international languages (English + Chinese) in the project, but I found a problem during use. When the screen is rotated, the APP language (Chinese) automatically converte
The screen sizes of Android devices are various, but they can be divided into two major parts during design: versions earlier than 3.0 and Versions later than 3.0. What problems will this cause? Let's use three assumptions to explain.1. Assume that you have two 4 inch devices on your hand. The resolution of device A is 800 × 480, and that of Device B is 1600 × 960. You have designed A 64*64 pixel icon on de
I read a book today and saw this effect. I used the ontouchevent (motionevent event) method before, but I didn't think it was so helpful. So I wrote it myself and it felt good, if the game is used in the future, click the screen to slide on the screen, and the picture will slide! Good results! Haha, I 'd like to share with you some inspiration. If you have any questions, please leave a message for source co
Everybody help!Bloggers participate in 2014 blog star activities, we help vote! Punch here!It is a very interesting thing to know the hardware through the program. I studied the physical size of the screen on WM6.5, but it has not been successful. Later, I wanted to make a breakthrough on Android, but I didn't get the exact size before today. Although many people think that there is no need to be so serious
Recently, Android Camera-related programs have been developed to maximize screen rotation. On the one hand, we must consider the layout changes after screen rotation, on the other hand, we need to figure out the relationship between the orientation and angle of the screen and the Preview angle of Camera. Originally, th
Android-screen rotation Summary
Before introduction, we need to first understand the android screen rotation mechanism by default:
By default, when the gravity Sensor of your mobile phone is turned on, rotating the screen will lead to onDestroy-> onCreate in the current acti
Three ways for Android to keep the screen always bright: android always bright
I haven't written a Blog for a long time, and I have to implement similar functions recently. It's not very convenient to find a blog every time. I 'd like to record it on my Blog!
There are three methods:
1. Apply for screen lock
Pm = (
What is a full screen conceptMany people may confuse a full screen with a curved screen, which is actually two different concepts.The average mobile phone screen aspect ratio is 16:9, such as 1080x1920, 1440x2560, etc., the ratio of 1.777777 ..., before the full screen phone
Android custom controls Series 8: onMeasure () (2) -- use onMeasure measurement to achieve image stretching without deformation and solve the screen adaptation problem,
The previous article details the principles and functions of the onMeasure/measure method in Android custom controls. For more information, see blog: Android
In fact, I think the main or developers for the application of the optimization is not enough, too many overdraw and layout aspects of the problem, the Android developers themselves in order to fit the screen resolution and solve some other compatibility problems has been a lot of effort, Few developers spend a lot of time doing detailed performance optimizations, and some don't even know the direction of o
Hello everyone, what I want to talk about today isAndroidHow can a mobile phone dynamically move the screen direction of the mobile phone? Maybe the mobile phone also has this function. When the direction of the mobile phone changes, the screen also changes.AndroidIt is easy to implement in this section.DemoThere is a button on the interface. When a button is clicked, if the
Android uses a touch to dynamically draw a rectangle and an android rectangle on the screen.Requirement Overview:
Draw an area with your finger on the screen and return the coordinates of the area in the circle.Technical implementation:
Customize the View, set the paint brush and corresponding parameters, and judge the touch event in the onTouchEvent () callback
0. Foreword
Android's screen fit, even if an element has the same display effect on Android's different sizes and resolution phones, has been a problem that we Android developers have to face. This article refers to a lot of previous blogs, and to make a summary of this issue, and strive to streamline and understand.
Reprint please indicate the source: http://blog.csdn.net/seu_calvin/article/details/52690
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.