1. Determine whether the network connection is available
Public static Boolean isnetworkavailable (context) {connectivitymanager CM = (connectivitymanager) context. getsystemservice (context. connectivity_service); If (Cm = NULL) {} else {//
When an application is no longer used, you usually need to disable the application. You can use the following method to disable the Android Application:
Method 1: first obtain the ID of the current process and then kill the process.Android. OS.
Recently, I encountered an application that sets dialog to transparent. I did not find many ways to achieve this on the Internet. Finally, I thought about it. I only set the dialog to transparent, the view on dialog is not set to transparent, so the
Application global variables in Android
In Android programming, the term "application" seems to be so uncommon, but more familiar to everyone is activity, intent, provider, broadcast, and service. But in fact, the application in Android
Alertdialog dialog = builder. settitle ("message List "). setview (layout ). create (); dialog. show (); // set the size of the window. getwindow (). setlayout (300,200 );
Dialog. getwindow (). Show (); must be placed before dialog. getwindow ().
To enable boot in the Android system, it takes only a few steps.
1. Define Broadcasting
2. register the broadcast class in manifest. xml
3. Add Permissions
The following is the specific operation.
First, let's define the
The system menu has three events:
Click other menu items to exit
Click Back to exit
Click menu to exit
The source code of the custom menu that imitates ucweb is available on the Internet. Below are three classicArticle:
Closed and open? Steve Jobs's verbal war on Android
Article/author of rush to digitalization
Being closed and open is a hot issue in the 3G era. It also seems unclear, at least not clear.
The long-standing debate on close and open is a question of
Android Dev Guide Series 16: user notification (3) create a status barNotification
Lazy bones (http://blog.csdn.com/iamlazybone)
A Status Bar notification adds an icon in the status bar of the system, and adds a message in the status window. When a
Android Dev guide series 13: handling UI events on the user interface
Lazy bones (http://blog.csdn.com/iamlazybone)
Processing of UI events
In user interaction, there are more than one method to intercept events. The View class provides some special
Android Dev Guide Series 17: creating custom components
Lazy bones (http://blog.csdn.com/iamlazybone)
Android provides a mature and powerful component model to build your own UI, all of which are based on the view and viewgroup classes. First, the
Recently, the project needs to monitor the insertion and removal of the SD card. Many things are not mentioned when searching for broadcasts on the Internet. I will record these items for future use.
1. If a single activity listens for broadcast,
The idea of the custom dialog box is to compile the layout file XML of the dialog box and display different controls in the dialog box. The following uses the display text control as an example (imageview can be displayed ).
1. layout file
The Android 2.2 SDK provides a device management and operation API called devicepolicymanager. You can use this API to take over the app permissions of your mobile phone and perform many bold operations on your mobile phone, for example, lock screen,
We have an article about how to enable auto-start for Android, But I have written about how to start the activity. This article will introduce how to start the service.
First, attach the link of the previous article for reference: [Android] boot
The onkeydown (INT keycode, keyevent event) method is used to receive key events in the activity, and the onkeyup method is used to release the key.
@ Override Public Boolean onkeydown (INT keycode, keyevent event ){ Switch (keycode ){
During this period of time, we were engaged in basic Android development. Now we need to start the system and follow some blog posts on the Internet to find that it has never been successful, when the server is started, it always prompts that the
Creating a library for multiple projects to share code and resources is a very common requirement. There is very little such information on the Internet, basically it is about creating a Java project and then export. This method has many
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