You can set full screen in Android:
Method 1CodeSet
In the activity oncreate () method
// Hide battery and other icons and all modifiers (status bar) This. getwindow (). setflags (windowmanager. layoutparams. flag_fullscreen, windowmanager.
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
In actual development, screen orientation may be determined to prevent layout from being affected.
InCodeSet in
// Force the screen to be landscapeSetrequestedorientation (activityinfo. screen_orientation_landscape );
// Force the screen to be
I. There are three types of File Reading locations in Android:
First: read data from asset:
// Method: get the file from asset and read the data Public String getfromasset (string filename) {string result = ""; try {inputstream in =
If the program wants to tell the Android system which intent can respond to and process, the intentfilter object needs to be used. The intentfilter object filters out intent requests that can be processed by the component, and the implicit intent
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, menus can be divided into options menu (generated by the menu key) and context menu (generated by pressing the screen for a long time)
The following is an example;
1, Options menu (generated by the menu key ),
@Overridepublic boolean
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.
Recently, I read the example programs in the API and started them on a regular basis. I 've sorted them out and shared them with you;
First, create the autoustartactivity class
Package COM. start. APP; import android. app. activity; import android.
I have always used the program package name and Icon recently. The following is a summary:
Packageinfo Info; try {info = This. getpackagemanager (). getpackageinfo (this. getpackagename (), 0); // name of the current application version string
1. Call the system music player
private void playAudio(String audioPath){Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse(audioPath), "audio/mp3");
It is easy to use in recent projects. The following is a summary:
There are two ways to set the branch standby mode for Android
The first is simply implemented by setting the windowmanager attribute:
Set in activity oncreat () method
Getwindow ().
Android introduces Android. OS. Debug to track and Debug programs.
The details are as follows:
Add Debug. startmethodtracing ("/sdcard/debug") Where tracing needs to be started ");Add Debug. stopmethodtracing () to the end where debugging is
Recently, I made a program to implement the features of a shake mobile phone.
Think of this function may be widely used, such as shaking mobile phones for pictures, shuffling, and ending the current program, so I found some information and made
Summary of the android ndk Development Process
1. Download The ndk Development Kit and decompress the configuration environment variable, which is similar to the SDK Configuration
: Http://developer.android.com/tools/sdk/ndk/index.html
2. Download
Set the texview vertical scroll bar
android:focusable="true"android:focusableInTouchMode="true"android:ellipsize="marquee"android:marqueeRepeatLimit="marquee_forever"android:scrollbars="vertical" android:singleLine="false"
Set
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