Screen Size1. Different layout
The screen sizes of Android mobile phones vary by 480x320,640x360,800 x. How can an App automatically adapt to different screens? In fact, it is very simple, just need to create different layout folder under the res
Effect
When you click the Home key, it will pop up to select one of the two luncher items ~ LuncherTest is our custom
It is okay to add three lines of code in the center of the started activity. You can set the specific content of LuncherTest
Although the previous View is used for plotting, the View plotting mechanism has two defects:
1. Lack of Dual-BUFFER MECHANISM
2. When updating an image, you must update the entire image on the View, which is inefficient.
Therefore, SurfaceView is
Public class CircleView extends View { Private int maxProgress = 100;Private int progress = 30;Private int progressStrokeWidth = 4;// The area of the circular areaRectF oval;Paint paint; Public CircleView (Context context, AttributeSet attrs ){Super
Activities provides a convenient Dialog box mechanism for management, such as onCreateDialog (int), onPrepareDialog (int, Dialog), showDialog (int), and dismissDialog (int) if you use these methods, the Activity returns the dialog box managed by the
SharedPreferences is a lightweight storage class on the Android platform. It mainly stores some common configurations, such as window status. Generally, reload the window status onSaveInstanceState in the Activity and save it using SharedPreferences,
What is "number matching"? In my personal understanding, I will judge whether the two groups of numbers belong to the same number. In actual use, the contact number involves the area code, country code, and IP number. At this time, the number match
1. requestFocus () obtains the focus mode.
2. Set the animation for PopuWidow.
Write the xml fill animation and write it in the style xml file.
open an animation
disable animation
SetAnimationStyle (R. style. animation name );
Cause: the POS machine sends data through the serial port, and the card information data size is 205 bytes. However, messages are sent in segments of 100 + 105 + 50 + 100.
Solution: Wait 0.5 seconds for the first copy of the data, and all the
Progress bar is a commonly used component. It is easy to use. You only need to display the progress bar on the front end, start a thread in the background, and modify the progress bar status as needed. Let's look at an example. The program running
The SlideMenu project depends on the ActionBarSherlock open-source project, so you need to download two open-source projects to study it.
Use Git:
SlideMenu: https://github.com/jfeinstein10/SlidingMenu.git
ActionBarSherlock:
This article describes how to change the background when a Button is pressed or not pressed without using java code.
First, prepare two images: button-pressed and button-not-pressed.
Create a button_selector.xml file in the res/drawable
The usage of progress bars and tabs in android briefly introduces the use of progress bars, but this article only introduces the use of general progress bars (including the title bar progress bars and horizontal progress bars, in this article, we
1. Create an xml file at drawable/xxx. xml. Remember to put the relevant images in the same directory.
[Html] Android: state_selected is selectedAndroid: state_focused is the focal pointAndroid: state_pressed: ClickAndroid: state_enabled is used to
The following describes how to implement button pressing and releasing, and how to switch between the button background image. One is implemented in the code, and the other is implemented in the xml file.
1. In an xml file
First, the following
The Android SDK provides three types of animations: Compensation animation, frame-by-frame animation, and interpolation attribute animation. Next we will first introduce the first animation effect-the animation of the population.
The compensation
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