Call/system/bin/AM.
Usage:
Usage: am [subcommand] [Options]
Start an activity: am start [-D] [-W] -D: Enable debugging-W: Wait for launch to complete
Start a service: am startservice
Send a broadcast intent: AM broadcast
Start an
Search for a specified file:
Public String searchfile (string filename) {string res = ""; file [] files = new file ("/sdcard "). listfiles (); For (file F: Files) {If (F. isdirectory () searchfile (F. getname (); elseif (F. getname (). indexof
Sometimes you need to set the view, especially the height of the "dynamic" Custom view.
For example, in XML, we cannot determine the height of the view, which is related to the actual situation of the mobile phone.
Then we mustCode.
The
I recently studied several startup modes of activity, which are summarized as follows:
The four startup modes are as follows:
"Standard" (default)
"Singletop"
"Singletask"
"Singleinstance"
Standard is created every time, and each
Sometimes we may need to combine the two images to make them a synthetic image. below is my documents for future review.
Public bitmap diejia (Bitmap B ){ If (! B. ismutable ()){ // Set the image to transparent as the background B = B. Copy
The project will be used. I have investigated this knowledge in the past two days. There is not much time. I would like to give you a brief summary to help unfamiliar friends get started quickly and shorten the process of searching for treasures in
Android mediaplayer common methodsMethod: Create (context, Uri URI)Explanation: The static method creates a multimedia player through Uri.Method: Create (context, int resid)Explanation: The static method creates a multimedia player using the
Android: drawselectid Top = "true" click a record. The color is displayed on the top of the record, and the text on the record is hidden. Therefore, you cannot see the text when you click it.
Android: drawselectid Top = "false" click a record, and
In Android, listview is most frequently used, but errors occur at the same time. The following is a summary of the problems I encountered during development,
Problem 1: When a button is added to a custom adapter or a checkbox is added, the system
In Android, speech reading is relatively simple. The following is a small example;
Package COM. recorder. audio; import Java. util. locale; import android. app. activity; import android. OS. bundle; import android. speech. TTS. texttospeech; import
1. Set the form transparency.
Windowmanager. layoutparams Lp = getwindow (). getattributes ();LP. Alpha = 0.5f;Getwindow (). setattributes (LP );Alpha is between 0.0f and 1.0f.
2. Set the darkness.
Windowmanager. layoutparams Lp = getwindow ().
In Android, images in GIF format cannot be directly loaded, but can only be implemented through the auxiliary class movie. The specific method is as follows;
public class DrawMusicNote extends View {private Movie mMovie;private long
Service is the most similar component to activity among the four Android components. It can represent executable programs.
The difference between service and activity is:(1) The Service has been running in the background and there is no user
In Android, there are four file reading methods based on different file locations;
// Method: Obtain the file from the raw folder in the resource and read the data. Note: Only data can be read but cannot be written.
Public String getfromraw (INT
The screenshot function is used in recent projects. After searching for information, it is summarized as follows:
Method 1:
/*** Simple screenshot method ** @ Param v view * @ Param filepath save path */private void getscreenhot (view V, string
Principle: Get the content of the incoming call message and call the system's speech reading function.
:
The Code is as follows:
1. Get short messages:
Package COM. internal. message; import android. content. broadcastreceiver; import android.
The principle is that contentprovider obtains the field information in the system SMS database to obtain the content.
As follows:
The Code is as follows:
Package COM. internal. message; import Java. text. simpledateformat; import Java. util.
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