By default, adb logcat can only display the debugging information of the application. I modified logcat. cpp so that it can print the kernel debugging information at the same time:
Modified file: system/core/logcat. cpp
1. First add the header file#
4.3 struct binder_transaction_data: send and receive data packet structure
This structure is the standard format for Binder to receive/send data packets. Each member is defined as follows:
Table 5 structure of Binder send and receive data packets:
Restart LoaderWhen you use initLoader (), if the loader with the specified ID already exists, it uses this loader. if it does not exist, it will create a new one. but sometimes you want to discard the old data and start new data.To discard old data,
It is not difficult to upload FTP files (including images) on the android client. Write it down to record it. Hope it will help new users.
Need to use commons-net-3.0.1.jar, followed by a jar package.
Directly run the Code:
[Java]/***
If you use the same layout multiple times in the program, you can first define the layout as a separate XML, and then introduce it as needed through , as shown below:
Main. xml
1: 2: 3: android: layout_width = "wrap_content"4: android: layout_height
Error: request_suspend_state: wakeup init: untracked pid 123 exited
Cause: (1) check that this is because the init. rc will re-mount the root file system as read-only, so that init. rc cannot create sub-directories.
(2) If an error such as init:
1. Set the backgroundA. Create an anim folder in res and create the animation_list.xml file in this folder.[Html]Android: oneshot = "true"> Android: drawable = "@ drawable/c1"Android: duration = "200"/>Android: drawable = "@ drawable/c2"Android:
The Android compiling environment is complex, and unlike the normal compiling environment: Only Makefile files are available in the top-level directory, while each other component uses the unified standard Android. mk. android. the mk file itself is
In the Android system, if you need to use a database, we generally use the SQLLite database and store the database in the res \ raw directory. This facilitates the release of the database together when the system is released.
When accessing the
This is mainly implemented here. The second-level association between provinces and cities. Select a province. Level 2 corresponds to all cities in the province
See the code below;1. activity@ OverrideProtected void onCreate (Bundle
To perform a media scan in the project, you need to detect the sd plugging event. I wrote a demo analysis.
[Java]MReceiver = new BroadcastReceiver (){@ OverridePublic void onReceive (Context context, Intent intent ){OnReceiveMediaBroadcast (intent );
/*** This method is used to convert between hexadecimal, binary, hexadecimal, and decimal.* @ Param args*/// The following is a binary conversion hexadecimal table.// 0001 1 1000 8 1111 F// 0010 2 1001 9// 0011 1010// 0100 4 1011 B// 0101 1100 C// 01
In addition to the ability to return data results from an Activity, it is also very common to transmit data to an Activity.
1. Create a project named PassData.
2. Code in main. xml.
[Java] Android: layout_width = "fill_parent"Android: layout_height =
How to Create a SubMenu:
Call the addSubMenu () method of Menu to add a sub-Menu.
Call the add () method of SubMenu,
Override the onContextItemSelected () method to respond to the Click Event of the sub-menu,
[Java] public class TestActivity extends
In the process of initializing Data Optimization on the browser client, because SharedPreferences is used to save data for multiple times. So I checked the source code of the client's SharedPreferencesManager and found that the code format for data
When dealing with some complex interfaces, you often need to use view and SurfaceView to process the drawing by yourself. For example, you can use SurfaceView to paste two images and control their left and right translation. The basic code is as
Use resources to provide the best device compatibility
To allow applications to support multiple device configurations, it is essential to always provide default resources for each type of resource used by the application.
For example, if an
Early in the morning, I wrote an android software package for Silent Installation, which has been put in the workspace for a long time. Today I found it when I sorted out the project and took it out for the sun! Features implemented by the software:
The Android virtual machine is a register-based Dalvik, and its maximum heap size is generally 16 Mb. However, Android uses the Java language, so to a large extent, the memory mechanism of Android is equivalent to the memory mechanism of Java. At
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