I started to study Android development and encountered a problem when setting up the development environment ...... It is a tough task ~
JDK is installed, environment variables are configured, the full version of ADT is installed, and helloworld is
First, the first one is the production of jar files, which are directly stored in Java. package the class file. the jar file can be used, but the Dalvik VM of Android does not recognize the byte code of Java, so it cannot be packaged directly.
There are two sets of methods to update the view in Android: invalidate and postInvalidate. The former is used in the UI thread itself, the latter is used in non-UI threads.
Android provides the Invalidate method to refresh the interface, but
The screen length obtained in android is longer than the width. According to the code on the Internet, the result is inconsistent with the actual value. For example, if my mobile phone is i9000 and the screen size is 480 * 800px, the result is 320*53
I. Basic Introduction
The xmlpull method is strongly recommended for parsing xml in Android.
Xmlpull is also applicable to javase not only on Android, but in the javase environment, you need to obtain the class library, kxml2-2.3.0.jar, xmlpull_1_1_
I recently had a local area network socket connection problem. To share a socket connection between multiple activities, I searched the internet for information. I still feel that the application method is easy to use. I will post it and share it
When using TextView, The ellipsis is automatically displayed if the length is too long. native support is available in android, which is defined as follows:
Copy codeThe Code is as follows: Android: ellipsize = "end"
Android: singleLine = "true"/>
Objective:
1. Master how to create EditText in Android2. Master common attributes of EditText3. Master EditText focus events and button events (listener)
Introduction:
EditText is the most important control for receiving user input information.
When developing Android, you may encounter one of the following scenarios:
You want to download the application to the root directory of the current application, not the SD card.
Then, the file can be accessed by the application or other
Android's Touch event processing mechanism is complicated, especially after considering multi-point Touch and event interception.
Android Touch event processing has three layers: Activity layer, ViewGroup layer, and View layer.
First, let's talk
1. Set the font color directly in the configuration xml file under the layout file, and change the color by adding android: textcolor = "# FFFFFF"
However, this effect only allows the font to display one color.
2. in the activity, use TextView
The following describes the implementation code for reading the user number, mobile phone string number, and SIM card serial number from Android.
1. Use the core code provided by TelephonyManager:
Copy codeThe Code is as follows:
TelephonyManager
In android, to accept broadcast information, we have to implement this broadcast receiver. We can inherit BroadcastReceiver to have a broadcast receiver. There is not enough receiver. We have to rewrite the onReceiver method in BroadcastReceiver,
If the connection is not processed for download, an error will be reported. To solve this problem, you only need to encode your url and then encode it with spaces.
// Encode the path and replace all spaces in the path. After encoding, the space
To listen to the screen SCREEN_ON and SCREEN_OFF actions in a program, you can monitor the screen lock status to implement your own functions. The strange thing is that these two actions can only be listened to after they are registered in the form
In development, we sometimes need to execute a task at a fixed interval. For example, if the controls on the UI need to change over time, we can use the Timer tool class provided by Java, namely Timer and TimerTask.
Timer is a common class with
Android permission description
Various permissions are often designed when developing android programs. To read security-sensitive items during program execution, you must declare relevant permission requests in androidmanifest. xml. The permissions
1. The main UI thread cannot be updated in the Child thread. It must be updated using the Handler, AsyncTask, or View postDelay () method.
2. The Toast cannot be displayed in the Child thread. (This is similar to the first point)
3. If an activity
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