1. Add the XML file rounded_editview.xml under drawable.
CopyCode The Code is as follows:
Android: Shape = "rectangle">
Android: Top = "10dp"
Android: Right = "10dp"
Android: Bottom = "10dp">
2. Reference this XML in the background
There is a need. We click to exit the application in the menu item, and the application exits without returning to MainActivity.
Design:
There are two application interfaces: MainActivity and BActivity, and the general class ExitUtil for the program.
JSON is a lightweight object with small data size, convenient transmission, and easy to parse!
Create a new tool class JsonUtil to obtain the data returned by the request.
Copy codeThe Code is as follows: public class JsonUtil {
Private static final
Previously, I have discussed how to create a menu item in an article. However, this method is inefficient and difficult to maintain. Now, another method is used to create a menu.
MenuInflater. With this class, you can easily create menu items as
AppWidgetProvider is used to display plug-ins on the HOME page.
Steps:1. Provide AppWidget with an meta-layout file appwideprovider_provider.xml to display the Widget interface.2. Create a class that inherits from AppWidgetProvider and overwrite the
AIDL: Android Interface Definition Language, which is a description Language of the android internal process communication Interface. Through this Language, we can define the communication interfaces between processes.
ICP: Interprocess
The program interface is as follows!
1. layout file:
Copy codeThe Code is as follows: Android: layout_width = "match_parent"
Android: layout_height = "match_parent"
Android: orientation = "vertical">
Android: id = "@ + id/editText"Android:
Our applications retrieve image data from the network more or less and then display it. The following example shows how to obtain images from the network!
First, let's take a look.
The interface has three controls, one EditText, one Button, and one
Tip:
Org. xmlpull. v1.XmlPullParserException: PI must not start with xml (position: unknown» timeout @ in java. io. InputStreamReader @ 47ec2770)
Org. xml. sax. SAXParseException: PI must not start with xml (position: unknown xm @ 3:5 in java. io.
First paste the source
Http://zrgiu.com/blog/2011/01/making-your-android-app-look-better/
Http://www.dibbus.com/2011/02/gradient-buttons-for-android/
Http://www.dibbus.com/2011/08/even-more-gradient-buttons-for-android/
Then let's take a look at the
1. Use LinearLayout and RelativeLayout whenever possible. Do not use absolute layout.
2. Try dip and sp instead of px.
3. provide different layout files and images for different resolutions.
For example:
4. Set multi-resolution support in
1. scale down an image
Copy codeThe Code is as follows: // zoom
Public static Bitmap zoomBitmap (Bitmap bitmap, int w, int h ){
Int width = bitmap. getWidth ();
Int height = bitmap. getHeight ();
Matrix matrix = new Matrix ();
Float scaleWidth = w/
To obtain the highest permission by using code, you must first get the root permission on your phone. If there is no root, please do not read it down.
First, write a static method.
Copy codeThe Code is as follows: public static boolean isRoot
1. Progress of the special effect button
Previous thought: css sets the div style, implements the div response to the event in js, and changes the div style to achieve the animation effect.
1: Animation
Copy codeThe Code is as follows: var bb =
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