First, write in the OnCreate of application:
Generalappliction.java public
static Iwxapi SApi;
@Override public
void OnCreate () {
super.oncreate ();
SApi = Wxentryactivity.initweixin (this, appconst.weixin_app_id);
}
Add in places
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
1. First add a textchangedlistener to the user2. And then write a change in the text of the monitor
Copy Code code as follows:
Mobile_et.addtextchangedlistener (Textwatcher);
/**
* Real-time monitoring of user input cell phone
, Android implements the default Progress prompt dialog box, ProgressDialog, which can be used with instantiation and some simple settings.
Copy Code code as follows:
Private class Downloaddbtask extends Asynctask {
Variable-length
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,
Images in GIF format are not supported on Android, but because I want to be loaded in my program just when a villain is running indicates that it is loading. And this villain runs is a GIF picture. That is, you want the program to load a GIF image
First, the use of distance sensors to monitor the handset near the ear incidentThe exact distance sensor does not listen to whether you put your phone close to your ear, maybe you're using your hand in front of the proximity sensor, but that's not
Sometimes we use the circular avatar in the application, the following is the use of circleimageview to achieve the circular head of the demo, the following effect and code, the effect is as shown
The implementation is also relatively simple,
The status of the base is similar to the charging state, and many bases provide charging function (seat charge).The base state also uses sticky intent broadcasts. You can query whether the device is plugged into the cradle or the base.
Determine
This section shows how to perform tasks online Cheng Chili. The process is to add a task to the thread pool's work queue, and when the thread is available (perform other tasks, idle, or not yet perform the task), Threadpoolexecutor will take the
ListView control is quite complex, but also in the project should be regarded as more commonly used, so wrote a small demo to say, mainly the use of custom adapter, added a lot of judgment and so on ... let's look at the effect of the implementation!
Objective
Before we begin, we hope you can best meet the following conditions:
1, have a compiled Android source code (hands-on practice will have a more in-depth understanding)
2, a certain understanding of the binder mechanism
This article
The example in this article describes how Android simply implements the tab menu at the bottom of the screen. Share to everyone for your reference, specific as follows:
See a lot of popular Android programs (such as: Sina Weibo, Tencent Weibo,
In this paper, we describe the method of segmentation and assembly of the Android file by example, which is mainly for the segmentation and assembly of UDP packets. Share for everyone to use for reference. The specific methods are as follows:
In
This example describes the page switching test for Android programming. Share to everyone for your reference. The specific analysis is as follows:
First, software platform:
Win7 + eclipse + SDK
Second, design ideas:
Two pages: Mian and OK, there
This article describes the XML file read and write methods of Android programming. Share to everyone for your reference. The specific analysis is as follows:
First, the environment:
Host: WIN8Development environment: Eclipse
Second, note:
1.
This article describes the Android method based on the TextView attribute android:ellipsize to achieve the effect of the marquee. Share to everyone for your reference, specific as follows:
In the Android system, the TextView realizes the effect of
Viewpager This small demo is to be able to scroll around the picture, the following with index, slide to the last page in the right slide to the first page, the first page to the left slide to the last page, the first effect of the picture, with
We all know that Android Studio is great, and the layout previews are great. When we tune the UI, we basically need a live preview to see the effect, we'll just have to switch to design in the Android studio, and we need to populate the layout with
The example of this article introduced the Android custom view properties of the method for your reference, the specific contents are as follows
1. Customize one's own view class to inherit from view
public class MyView extends View
{public
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