Android gets the height of the status bar and title bar.

// Obtain the screen width displaymetrics = getresources (). getdisplaymetrics (); screenwidth = displaymetrics. widthpixels; // obtain the height rect = new rect (); window = getwindow (); mimageview of the title bar and status bar.

Two ways for Android to remove built-in animations

Method 1:Call after startactivity () or finish:(Activity) mcontext). overridependingtransition (0, 0 ); Method 2:In some special cases, method 1 cannot be implemented.For example, you have set properties for intent:Intent. addflags (intent.

Android merge audio files

/*** Requirement: merge two audio files in Amr format into one. * Note: the header file in Amr format is 6 bytes * @ Param partspaths path * @ Param unitedfilepath merged path */Public void uniteamrfile (string [] partspaths, string unitedfilepath) {

Android photos are cropped before the image is displayed.

MainActivity is as follows: Package cn. testcamera; import java. io. file; import java. text. simpleDateFormat; import java. util. date; import android. app. activity; import android. content. contentResolver; import android. content. contentUris;

Android image Merging

MainActivity is as follows: Package c. c; import android. app. activity; import android. content. intent; import android. graphics. bitmap; import android. graphics. bitmapFactory; import android. graphics. canvas; import android. graphics. paint;

Android video recording (5)

MainActivity is as follows: Package c. c; import android.net. uri; import android. OS. bundle; import android. provider. mediaStore; import android. view. view; import android. view. view. onClickListener; import android. widget. button; import

Android video recording (4)

MainActivity is as follows: Package C. c; import android. app. activity; import android. content. contentvalues; import android. content. intent; import android.net. uri; import android. OS. bundle; import android. provider. mediastore; import

Android graphics rendering BASICS (2)

MainActivity is as follows: package com.cn;import android.os.Bundle;import android.app.Activity;import android.view.Menu;public class MainActivity extends Activity { private SurfaceViewTest mSurfaceViewTest; @Override public void

Android graphics rendering BASICS (1)

MainActiviry is as follows: package com.cn;import android.app.Activity;import android.os.Bundle;public class MainActivity extends Activity { private DrawBitmapView mDrawBitmapView; @Override public void onCreate(Bundle savedInstanceState) {

Android simple boot Animation

Mainactivity is as follows: Package com.cn. testanimation; import android. OS. bundle; import android. app. activity; import android. view. menu; import android. view. animation. animation; import android. view. animation. animation.

Android uses logoff to change the UI (Deprecated) in the Child thread)

This blog is incorrect. See: Http://blog.csdn.net/lfdfhl/article/details/10350823   Mainactivity is as follows: Package cn. testlooper; import android. app. activity; import android. OS. bundle; import android. OS. logoff; import android. widget.

Android Drag Control to change its location

MainActivity is as follows: Package CN. dragtest; import android. app. activity; import android. graphics. rect; import android. OS. bundle; import android. util. displaymetrics; import android. view. motionevent; import android. view. view; import

Android video recording (3)

Mainactivity is as follows: Package c. c; import java. io. file; import java. io. IOException; import android. app. activity; import android. content. pm. activityInfo; import android. media. mediaRecorder; import android. OS. bundle; import android.

Android video recording (2)

MainActivit is as follows: Package c. c; import java. io. file; import java. io. IOException; import android. app. activity; import android. content. pm. activityInfo; import android. media. mediaRecorder; import android. media. mediaRecorder.

Android video recording (1)

MainActivity is as follows: Package c. c; import java. io. file; import java. io. IOException; import android. app. activity; import android. content. pm. activityInfo; import android. hardware. camera; import android. media. mediaRecorder; import

POST Request Code in Android

public static String getDataByPost(String APIUrl,Map paramsHashMap){String result=null;try {HttpPost httpPost = new HttpPost(APIUrl);DefaultHttpClient httpClient = getHttpClient();List postData = new ArrayList();for (Map.Entry entry :

Playing music on Android

MainActivity is as follows: Package cn.com; import android. media. mediaPlayer; import android. media. mediaPlayer. onCompletionListener; import android. media. mediaPlayer. onErrorListener; import android. OS. bundle; import android. view. view;

Common Bitmap operations in Android (1. theory)

// Use BitmapFactory to generate Bitmap// Note that this method only generates Bitmap, so the returned value is a Bitmap.// Operations on Bitmap objects are not involved, such as rotating and compressing Bitmap objects.// The following are four

Android uses broadcast listening devices to install and uninstall applications

MainActivity is as follows: Package CN. testappaddandremove; import android. OS. bundle; import android. app. activity; import android. content. intentfilter;/*** demo Description: * use a broadcast listening device to install and uninstall an

Android uses broadcast listening to press the HOME and RECENT_APPS keys

MainActivity is as follows: Package cn. testhomekey; import android. OS. bundle; import android. app. activity; import android. content. intent; import android. content. intentFilter;/*** Demo Description: * The HOME and RECENT_APPS keys of the

Total Pages: 2775 1 .... 470 471 472 473 474 .... 2775 Go to: GO

Alibaba Cloud 10 Year Anniversary

With You, We are Shaping a Digital World, 2009-2019

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

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.