I have studied android callback today. The following is a very easy example. The function of this example is to call back every five seconds. Each time a string is output, the code is very simple, I believe everyone can understand it. I feel that
1. Set the software sourceApt-get install cannot be used (apt-get: Package has no installation candidate problem occurs in Ubuntu)# Apt-get update# Apt-get upgrade# Apt-get install Add a third-party address:Sudo add-apt-repository "deb www.2cto.com/
In AndroidManifest. xml, we set the version number of the program, for example, android: versionName = "1.0.0 ". If you want to get the version number in the code, you can use the following method (you only need to modify the settings in
The App-> Activity-> Animation example is used to demonstrate the dynamic effect of different Activity switches. In this example, two animation effects are defined: gradient Fade In, and the new Activity is gradually displayed from simple to deep.
The App-> Activity-> Custom Dialog example uses Activity to implement a Custom Dialog box. CustomDialogActivity has no special characteristics. The key point is its definition in AndroidManifest. xml:
Android: label = "@
Wallpaper describes how to use a Style to set the system Wallpaper as the background of the current Activity.
This is the definition of WallpaperActivity in AndroidManifest. xml:
Android: label = "@ string/activity_wallpaper"Android: theme = "@
This is generally because the JDK version in the configuration file is incorrect. The configuration file is the org. eclipse. jdt. core. prefs file in the. settings folder in the project directory.If we use UEdit or notepad to open it, we can see
Call WindowManager and set the relevant properties of WindowManager. LayoutParams. Create a View using the addView method of WindowManager. In this way, the generated View will have different effects depending on the properties of WindowManager.
Five and nine1. Do not copy the uidesign on other platforms. It should make users feel like they are using a real Android software, balancing your brand display and overall platform view.
2. Do not over-use the modal progress bar and confirmation
You can query the geographical longitude and latitude coordinates of an IP address based on the IP address. For example, in the following example, the IP address 58.192.32.1 is located at 118.777802 and 32.061699, which is the location of Nanjing
1. Communicate with the server
Similar to communication between browsers and servers, Android applications can also communicate with Web servers. For example, Android applications can access Servlet, JSP, and images;By specifying Content-Type, the
The BitmapDecode example mainly describes the Android platform's image decoding function. The Android platform supports PNG and JPEG image formats and GIF animation.
The Android API mainly uses BitmapFactory (PNG or JPEG static image) and Movie (GIF
1. The files are stored in the bucket of the mobile phone record.Private Context context; Public FileService (Context context ){This. context = context;}/*** Save the content. Note: allow other applications to read and write the file.* @ Param
Android movies can be dragged to any positionThe code for the Activity is as follows:
01Public class DraftTest extends Activity {02/** Called when the activity is first created .*/03@ Override04Public void onCreate (Bundle savedInstanceState
Important attribute values: StatusBarView mStatusBarView; this is the View of the StatusBar we see.
NotificationCallbacks mNotificationCallbacks; used for icationmanagmanagerservice callback function. NotificationManagerService
HashMap mIconMap =
CornerPathEffect modifies the display mode of the connection of the online segment of the path (from the tip to the rounded corner of the arc radius ).DashPathEffect dotted line display effect, use an array to specify the length of the Line and
Patterns indicates that a graph can be filled with bitmap (material. In this example, two bitmaps are used to fill the screen:
First, the red rectangle in the outer blue
[Java]Private static Bitmap makeBitmap1 (){Bitmap bm = Bitmap. createBitmap (40,
Handler Content summary:
/**
* Handler can distribute the Message object and Runnable object to the main thread. Each Handler instance is bound to the thread that creates the handler (generally located in the main thread). It has two functions: (1):
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