Android provides several common methods to push and receive messages:
1. Round Robin: ApplicationProgramYou should establish connections with the server in stages and check whether new messages arrive. You must implement communication with the
After more than N errors, we finally compiled libffmpeg. So. Whether this version can be used remains to be verified.
Development Environment build reference this article: http://hi.baidu.com/lizhengjun2010/blog/item/08b7fb1b79dc9befe1fe0b09.html
In Android, the selected items in the gallery are displayed in the center by default. Sometimes a large piece of space is displayed on the left, which is not beautiful. Many people have solved this problem on the Internet, such as the solution
SP: It is generally used to set the font size. The most important feature is that it has nothing to do with screen density and scale.Dip: equivalent to DP, usually used to set the length and width of the control. The most important feature is not
From: http://www.52solution.com/article/articleinfo/id/80009971/page/1
Central topics:* Development of Bluetooth on Android1. Overview
Bluetooth is a standard feature of almost every mobile phone. It is mostly used for connection between devices
Threads enabled in Android do not actually close when thread. Stop () is used. When we start the thread again, an exception occurs: thread is already started.
To solve this problem, you can add a judgment mark in the run method of the thread. For
I recently studied the waterfall stream code and learned the source code of ListView by the way. Record it here.
The ListView source code has greatly optimized the performance of the ListView. Here we mainly use the RecycleBin.
RecycleBin promotes
Get started
1. Download the source code.
2. Start the terminal and enter the android working directory.
3. Compile the mobile phone, make-jN compile, N stands for numbers, my cpu is i5, and I use make-j4. There are many errors during this period,
DatePicker and TimePicker controls
Use DatePicker and TimePicker. The XML Code is as follows:
DatepickerAndroid: layout_width = "wrap_content"Android: layout_height = "wrap_content"Android: id = "@ + id/ui_datepick"/>
TimepickerAndroid: layout_width
Textview
TextView has been used many times before and is displayed directly, which is relatively simple. However, we can use the "autoLink" attribute so that you can click a network connection, phone number, email address, or map address to open
UI development
First, clarify some UI concepts:View, widget, control: There is no difference between these three terms. They are all a UI element, such as a button.Container): Contains other views. For example, grid can be considered as a container.
A small example bookprovider was provided before. Let's look back at how to read data through the content provider.
(1) Increase
Private void addbook (string name, string ISBN, string author ){/* You can see from the parameters of the
Learn two display items: ProgressBar is used for output and SeekBar is used for Input.
ProgressBar
1) Android XML file
......ProgressBarAndroid: id = "@ + id/c81_firstBar"Style="? Android: attr/progressBarStyleHorizontal"Android: layout_width = "
I want to change the Eclipse font to a larger one. The 22-inch display is shown below:
Window-> Preferences-> General-> Apprearance-> Colors and Fonts-> Java Editor Text Font (...)-> Edit
At this time, we will first create a Hello, Android
In mobile phone screens, tabs are also commonly used. They are usually combined with lists, for example, the mailing records of our mobile phones. The structure of the Tag is shown below.
TabHost is the container of the entire Tab, which consists of
You can use the inheritance class of IntentService to implement a command-triggered Service, or directly use the inheritance class of Service. In the IntentService example, we added the StopService () method for testing. In practical applications,
Prepared by: Xu jianxiang (netpirate@gmail.com)Date: 2010/12/06Web: http://www.anymobile.org
To transfer a file or set an avatar, we usually check the size of the original image for scaling.
Common Java version scaling Image Code:
Public
Optimization of Android memory management policies
I. Android Memory Management Policy
1. Backing swap)2. compcache (compression cache, CPU performance consumption, and power consumption)3. Swap (traditional Linux swap accelerates the loss of the
Register the onTouchListener () of ListView ()
The Code is as follows:
Listview. setOnTouchListener (new OnTouchListener (){Float x, y, ux, uy;@ OverridePublic boolean onTouch (View v, MotionEvent event ){// TODO Auto-generated method stubIf (event.
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