Sharedpreferences are generally used to store user names, mobile phone IMEI codes, etc.
In
Write preference: the key is the keyword set by the user, the value is the value, and the context is the context.
Sharedpreferences. Editor editor =
Sometimes you need to run the activity in the background. The specific implementation method is as follows:
In androidmanifest. XML, add:
Android: theme = "@ style/backgroundonly"Android: configchanges = "orientation | keyboardhidden"
As shown
Android applicationsProgramIt is developed in Java, but the packaging format is APK rather than jar. So how to decompile the APK file?
1. Use dex2jar to convert the APK file to a jar file.
1. From
Services between two processes need to communicate, and objects must be serialized and sent to each other.Android provides an aidl(Android Interface Definition Language) tool to process serialization and communication. In this case, the Service must
Today, I have a little time to look at the makefile of Android and finally understand how the android compilation system uses environment variables.Target_product decides to compile custom product.
First, compile the android code normally using:
#
Add "Android: Resource // your app package name" + the ID name of the video file in the r file when setting the URI in videoview.For example:
Videoview = (videoview)This. Findviewbyid (R. Id. videoview01 );
Mediacontroller controller =
Problems and objectivesSometimes you want to use the root permission in a Java application, such as modifying the/system permission or the question.Ideas and principlesHere we will introduce two methods that I have implemented, but we recommend that
First of all, I declare that this article is for your reference only and does not guarantee that all texts are properly described. You are welcome to point out the shortcomings and errors. Thank you for your attention and reading. If you need code,
Porting android to the tq2440 Development Board
I. Current Progress1. Android can run on the tq2440 Development Board through NFS
2010.03.12 update: Recently, I compiled the android file system and run it on TQ. It has more bin programs than pandatv.
Asynchronous operations in Android are suitable for Data Interaction Between Android clients and servers based on the network and user experience.
1. Compile an asynchronous operation class to inherit asynctask and implement the corresponding method;
In the initial activity, XML only contains one viewpager. In this activity, you only need to add a list to the subpage so that the subpage can be parsed and displayed based on the content in the list.
The following XML file:
When writing the menu bar at the bottom of Android, it is especially difficult to adjust the menu bar with a button, so I think using a gridview will make the interface easier to adjust and encapsulate.
I. basic layout settings:
Set the
1. Use any XML Resource
The XML file to be read is stored in the/RES/XML subdirectory.
For example:/RES/XML/test. xml
Hello World
Read XML files:
Resources res = activity.getResources();XmlResourceParser xpp = res.getXml(R.xml.test);
Use
Use of Android dialogfragment
The minimum API limit for Android systems is 11.
1. New Class inherited from dialogfragment
Click a button in the class to close the dialog box.
There is only one button in layout, and the code will not be pasted here.
When you do something about the map, an error is reported when you find the activity that opened the map and is automatically transferred to the previous activity.
My solution is to add permissions.
The following are all the permissions I have
1. Map only displays the grid, not the content
When the map has the permission to open the network and has the permission to access the network, the map still only displays the grid, not the map.
I didn't add the following permissions when I
This article from http://blog.csdn.net/hellogv/, reference must indicate the source!
Android can use mediarecorder and audiorecord to implement recording. mediarecorder directly stores the microphone data to a file and can directly encode the data
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