Quote from Easyandroid Forum, original: http://www.easyandroid.com/bbs/viewthread.php?tid=33
1. The message mechanism to utilize the communication between Android threads
1.1.Message
The code is in the
Tween animation is a transition process that shows rotation, gradients, moves, and scaling, that is, tweened animation. There are two ways to define Tween animations: XML form, encoding form.
XML definition Animation , complete XML according to
An example of the following button label:
In this connection to the label , set the background style, borders, gradients, rounded corners, and so on, the use of various effects see the following code
The Drawable folder creates a new nimei.xml that
1. In Android, the content in TextView often causes us to be unable to browse, so we can add scrollbars for TextView to navigate through the entire contents of TextView through the scroll bar.
2. Add a vertical scroll bar to the TextView layout
Exception 1,
Android.database.cursorindexoutofboundsexception:index-1 requested, with a size of 1 Workaround 1: This exception is the call to Db.que Ry method returns the cursor subscript is-1, in order to obtain the value must be moved down one
Surface&canvas
Canvas for the meaning of the canvas. Most of the graphics on the Android top are done by canvas instances, but canvas is more of an interface wrapper. Drawpaints, Drawpoints,drawrect,drawbitmap ...
1 The essential relationship
One, PreferencesPreferences is a lightweight method of storing data, using the following methods:Save values in a:Sharedpreferences.editor sharedata = getsharedpreferences ("Data", 0). Edit ();Sharedata.putstring ("name",
In the development of Android applications, sometimes to save the user's information, in the entire application can be accessed, of course, with the Android-supported SQLite database is OK, but if only to store some of the comparative advice or a
1.Java FoundationMany friends began to learn Android when they started, and seemed too worried. Android application development is based on the Java language, so there is no solid Java basics, but the mechanical copying of other people's Code, it
To manage fragment, you need to use Fragmentmanager, and to get it, you call Method Getfragmentmanager () in the activity.
You can use Fragmentmanager to do these things:
1 Use the method Findfragmentbyid () or Findfragmentbytag () to obtain the
In the development of Android applications, transaction processing is very important when using a database. first Android database operations (especially write operations) are very slow, and packing all operations into one transaction can
Under the Android platform, when multithreaded programming, it is often necessary to do some processing in a separate thread outside the main threads, and then update the user interface display. However, the problem with directly updating the page
Volley overview of the overall framework
Queue Dispatcher executes process Cachedispatcher process
The cache distributor, when Requestqueue.start (), starts thread in the app specifically for processing cache read operations. The key
Java has a very useful tool class, you can less than a lot of if else to judge, but not many people use, published this article is intended to let many people use this tool class, improve code quality and force lattice
Math.PI returns the
In design mode, the simplest is the single case mode. Let's take a look at the single case mode
Original: http://www.iteye.com/topic/575052
The singleton pattern can be simple, and all it takes is one class to complete (see this chapter's poor UML
The Java Native Interface (JNI) standard is part of the Java platform that allows Java code to interact with code written in other languages. JNI is a local programming interface that enables Java code that runs inside a Java Virtual machine (VM) to
Date curdate = new Date ();
String datestr = new SimpleDateFormat ("Yyyy-mm-dd HH:mm:ss SSS", Locale.china). Format (curdate);
Various dates in Java represent the following letters:
An alphabetic date or time element represents an example
String str = "Hello";
Canvas.drawtext (str, x, y, paint);
1. Rough calculation of text width
log.d (TAG, "measuretext=" + paint.measuretext (str));
2. To compute the rectangle in which the text is located, you can get a width-high
Rect Rect = new
Settag ()/gettag ()
Settag (Onbect) In view adds an extra set of data to the view, which can be taken out later with Gettag ().
You can use multiple button to add a listener, each button setting a different Settag. The listener is gettag to tell
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