1. Do not use static variables unless static constants (static final ).
Http://blog.csdn.net/zhangyue0503/article/details/7614944
2. Define a custom MyApplication that inherits android. app. Application and defines global variables.When the
Android provides the GestureDetector class to identify users' gesture operations. This class provides two listening interfaces: OnGestureListener (processing click messages) and OnDoubleTagListener (processing double-click messages ). The
Android does not actually have the concept of a dialog box, and some just use PopupWindow to implement the effect of a dialog box. The following is a complete example and usage.Create a PromptWindow class
Package com. friendlocation; import java.
First, we will introduce the function. I want to achieve the dynamic loading layout effect. Previously, we used the new component method, but the android memory is limited, so there will be more than 500 new objects, to reduce new objects, I decided
This small example contains knowledge points:
1. Use of Thread
2. Use Handle to send data
3. Obtain and display network images
Code first
package com.example.getwebimage;import java.io.IOException;import java.io.InputStream;import
I. Steps for using service components: (make a text message bug ,)
1. Customize a class: Inherit the android. app. Service class and override some methods:
Public class MyServiceextends Service {
@ Override
Public IBinder onBind (Intent arg0 ){
//
BroardcastReceiverIntroduction
Broadcast receiver (BroadcastReceiver) is one of the four major Android components used to receive broadcast Intent. The sending of broadcast Intent is achieved by calling Context. sendBroadcast () and Context.
If USB cable is not used, how does the pad receive files from the PC? I am using a wireless router at home, and I use WiFi for pad connection.
Start the service program getfile. py-mode server on Windows PC.
import sys, os, thread, timefrom socket
Activity declaration cycle
Exit the entire program from multiple activities, for example, from A-> B-> C-> D. In this case, I need to exit the program directly from D.
Online materials :{Both finish () and system (0) can exit a single activity. No
11:25:22
Reprinted from: http://www.open-open.com/lib/view/open1328836804515.html
Many times, the commonly used controls in android cannot meet our needs, so we need to customize a control. Today, I made an example of a custom control to share with
Software Card Emulation in NFC-enabled Mobile Phones:
GreatAdvantage or Security Nightmare?
Michael Roland
NFC Research Lab Hagenberg
University of Applied Sciences Upper Austria
Softwarepark 11,423 2 Hagenberg/Austria
A. In onCreate method of a, first call super. onCreate (),
public void onCreate(Bundle savedInstanceState) { … root = new LinearLayoutSoftKeyboardDetect(this, width, height); …}public void init() { CordovaWebView webView = new
17:57:17
1. Android provides two types of event processing: callback-based and listener-based event processing;1.1 For listener-based event processing, the main approach is to bind a specific event listener to the Android interface component;1.2
We have discussed how to use HierarchyViewer and Android lint to optimize our program. This article is summative and uses a small example to explain how to optimize the application layout. This example is provided on the android official website.
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.