1. Set the color of the control in code:
Copy Code code as follows:
int b = getresources (). GetColor (R.drawable.blue);//Get the color in the configuration file
Mbutton.settextcolor (b);
2. Set the font of space:
Mode one:
Copy Code code as follows:
public class Httputil {
public static string Senddatabyhttpclientget (string path,string name,string pass) {
String result = "";
1. Get to a browser
HttpClient client = new Defaulthttpclient ();
2. Prepare the
Android Everyone has a lot of users need to upload the avatar needs, some of the choice of square, some rounded rectangle, some round.First we have to do a custom control of the image processing, the incoming picture, through the user selection area,
The ability to implement updates to download progress
1. Interactive via broadcast
The server side will present the download progress, broadcast the way out, the client side registers this broadcast listener, when obtains this broadcast, the
The application of the combination mode in Android is a flood of porridge, everywhere, and that is the use of view and ViewGroup classes. In the Android UI design, almost all of the widget and layout classes depend on these two classes.
Combination
You can customize themes and styles in Android. style, which means style, we can take some unified attributes, such as long, wide, font size, font color, and so on. You can create a new Styles.xml file in the Res/values directory, in which there are
The following code is the state of listening to the phone, the code simply do not introduce direct look at the code:
Copy Code code as follows:
Private Boolean mresumeaftercall = false;
Private Phonestatelistener Mphonestatelistener =
What is an immersion status bar?
Immersion status bar meaning that the color of the status bar changes with the color of the software, so that the status bar and the software color consistent, immersed in it! When we open an application, it's not
Slidingdrawer effect must have been seen, it is the 1.5 simulator to enter the application list effect. Here's a screenshot.
First, IntroductionSlidingdrawer hides the content outside the screen and allows the user to handle to display hidden
Querying data can be time-consuming, so we want to put the query data in an asynchronous task, query results get Cursor, and then set adapter in the OnPostExecute (Cursor result) method, We may think of using the managedquery of activity to generate
Look at the effect chart first.
In fact, to achieve this effect is very simple, as long as drawable drawablev21 two folders is good.
Selector in ordinary circumstances:
The selector in V21:
-->
Here
Getting Android's root privileges is simple, as long as you execute the command "SU" under Runtime.
Copy Code code as follows:
Get root Permissions
public void Get_root () {
if (Is_root ()) {
Toast.maketext (Mctx, "already has root
First look at the effect chart:
Open Source Item Address: Https://github.com/chrisbanes/Android-PullToRefresh
Drop-down Refresh This feature we are more common, today is the introduction of this feature implementation. I will follow the example
First look at the effect:
The picture splits many, clicks the exchange to spell into a complete; such checkpoints are also easy to design, 3 3;4 4;5 5;6 6; Keep going.
Added a toggle animation, the effect is good, in fact, the game is a custom
1. Call Dialing Program
To mobile service 10086 call
uri uri = uri.parse ("tel:10086");
Intent Intent = new Intent (intent.action_dial, URI);
StartActivity (Intent);
2. Send SMS or MMS
Send 10086 sms
uri uri = uri.parse ("smsto:
Service as the four components worthy of our more attention
In Android, the activity is primarily responsible for the presentation of the front page, and the service is primarily responsible for tasks that require long-term operation. For example,
At the 2015 IO Conference, Google brought us a more detailed design specification for material, and also brought us a brand new Android Support Library, in this Support Google provides us with a more standardized MD design-style control. Most
Sometimes, when we write our own application, we need to implement the specified APK by code, install the specified topic, or install a new apk. You can do this in the following ways:
Copy Code code as follows:
private void installapk
Activities provides an easy to manage dialog box mechanism for creating, saving, and replying, such as Oncreatedialog (int), onpreparedialog (int, Dialog), ShowDialog (int), Methods such as DismissDialog (int), which, if used, will return the
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