Speaking of Android adaptation, it will surely cause a lot of headaches. I will share my experience on Android adaptation here.
In our project, we generally create an android project with only one layout file. In fact, this layout file has many
Android is very often used to obtain the screen size. For example, if you want to write a program and make a program with strong versatility, the screen is very applicable. Generally, the layout is defined based on the screen length and width, so I
I have seen the layout of each item of listview dynamically on the internet this week. I wrote one by myself today to facilitate future use. This effect is still very good, the notifydatasetchanged () method of the adapter is used. When each item is
Recently, I used the items of listview to solve some problems. Now I will take the time to summarize them:
Reprinted to indicate the source:Http://blog.csdn.net/wdaming1986/article/details/6788751
1. If there is a button in the listview item and the
The camera software comes with the Android system. His photo view is a galery first. After you click it to view it, it is similar to this effect. The experience is quite good. I made a demo Based on the effect.
First, check the effect:
Then
Since I learned Android, I felt that controls could not overlap. For example, I could not put another textview in an edittext. I felt that the controls had a location and could not overlap. However, when I read the android text message source code
========================================================== ========================================================== ====1. Write a broadcast classBroadcast by using the listener of the button, and add the intent object to the onclick In the
In the previous example, I made a simple calculator, and now I have made some time to make a complicated one. The procedure is as follows:
First look at the effect: Click 96*96 = 9216. I will not go through any other operations here!
96*96 =
I. Today I have summarized the following commonly used controls: gridview, gallery, and listview. I hope to help you. The example program is basically changed. Let's take a look at it first:
Homepage effect: Click the interface that appears after
Recently, an android music bug occurred. When playing music, click the previous one to play the current song and play it from the beginning. Google originally designed the idea to follow the previous CD idea, click back to the start point of the
Look at the effect first
After debugging it myself, I finally got it done in the afternoon. Here, let's sort it out. Just go to the code.
Paint paint = new paint (); point myscreencoords = new point (); // converts the current map
I. As we all know, hanlder is a bridge between threads and activities. We will use threads in many applications. Some users may improperly process the threads. When the program ends, the threads will not be destroyed, it is always running in the
In the Android system, it is very convenient to send a status bar notification. Next, let's take a look at how to send status bar notifications. What parameters can be set for status bar notifications?
First, you must use icationicationmanager and
The radiobutton of Android looks really ugly.
When we use it, we need to define it according to the overall interface style. It's just easy to see. Sina Weibo has such a custom style, so I learned it.
See the results:
A little pleasing
1. animation implementation
Define Res/anim/loading. XML as follows:
2. Use custom colors
Define Res/drawable/progress_small.xml as follows:
3. Use an image for customizationDefine Res/drawable/progress_small.xml as
Upload file. I changed it to a program that can read all the TXT files in the mobile phone sdcard. no matter whether the TXT files are placed in the root directory or under the subdirectory, they can be read and put into the listview to display the
The constructor of simpleadapter is as follows:
Simpleadapter (context, list Data, int resource, string [] From, int [])
A simlpleadapter works. Assume that simpleadapter is used for listview. Each list item in listview is the layout specified by
On the Android platform, If You Want To implement automated testing, there are several methods, such as using the instrumentation-based class library and its testing class, or using monkeyrunner. the test case runs on the PC, use USB or WiFi to send
In the Android system, some friends may need this function.When you press a button in the activity, the response is like pressing the Home Key of the hardware. Such a function can be implemented. Why?Based on the hardware, the driver will generate
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