How to make drawable revolve around the center.
Animation a = new Rotateanimation (0.0f, 360.0f,
animation.relative_to_self, 0.5f, animation.relative_to_self,0.5f );
A.setrepeatcount ( -1);
A.setduration (1000);
How to control the color of
A sample code for Bluetooth chat is given in androidsdk sample, and this article is only slightly modified into a simple server and client-mode application to accommodate one-to-one data transfer in game development.
Because the Bluetooth settings
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
because I saw an ORM framework using Greendao in open source projects. Today I finally figured out how to automatically generate Java files such as Entity,dao. preparation: Need to download jar package at Greendao website, address: http ://greendao-
The use of Greendao has been a long time, unknowingly has been updated to the 3.x version.
Note The basic methods used:
1. First in the app directory under the main folder under the new Java-gen directory:
Note: A Java file will be specified in
first, what is Rxjava
1.1 Introduction
A library that uses observable sequences on a Java JVM to compose asynchronous, event-based programs.The concept is very complex, not so-called. Let's learn to use it first.
Rxjava GitHub
In the Android development process, file uploads are very common. But the file's breakpoint continues to be rare. Because Android is requesting the server through the HTTP protocol, HTTP itself does not support file breakpoint uploads. However, the
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
Normally, this error occurs when Chinese appears in the Java Project code
or compile through, but when the run of Chinese garbled.
This time only need to add the following sentence in the Build.gradle can be solved
Tasks.withtype (javacompile) {
Screen System dropdown status bar
@Override
protected void onCreate (Bundle savedinstancestate) {
super.oncreate (savedinstancestate);
Setcontentview (r.layout.activity_main);
Screen system Drop-down status bar
This article introduces the use of HTTP GET and Post methods for network communication, which describes using httpclient httpget and network communication.First, make sure that the current project already contains Apache support librariesDownload
There's a lot of interprocess communication in our Android development, and Android offers a solution that's aidl, so let me explain how to implement Aidl in Android Studio.
1. Create a project in Android studio
2, create two module such as mine:
To do a sliding on the right side similar to the Address book,
Look at the interface.
Here's a look at the implementation code:
Friend.xml
Friend_header.xml
;/framelayout>
Here the main components are built, sliding function has
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
As mentioned earlier, the Android system continues the single-threaded design model of Java, so it often opens up new threads to handle tasks unrelated to UI operations during the development process. The thread is the smallest unit of the operating
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
How to get a control of the long and high, I believe many friends first saw this problem will feel very simple, directly inside the OnCreate call getwidth, getmeasuredwidth can not be obtained, but, in fact, there is no simple, not letter, You can
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