Camera
A. call the system camera directly
Intent Intent = new Intent (); // call camera
Intent.setaction ("Android.media.action.STILL_IMAGE_CAMERA");
StartActivity (Intent);
You do not need to set permissions.
B. the camera you wrote yourself
1 Display the preview effect in the camera- -surfaceview
Camera ———— >surfaceholder ———— >surfaceview
Setpreviewdisplay (Holder) Getholder ()
Startpreview () and Stoppreview () to turn preview on and off .
2 turning on the camera:camera.open ()
* * This method, can not be placed casually, such as in the construction method or onCreate () method, will be photographed without preview effect .
Make a phone call
1 calling up the dial screen
Intent dial=new Intent ("Android.intent.action.CALL_BUTTON");
Intent dial=new Intent (Intent.action_call_button);
2 call directly
Call Permissions:
Android.permission.CALL_PHONE incoming phone number direct dialing
Android.permission.CALL_PRIVILEGED incoming phone number to dialer, requires user confirmation to dial
Intent Intent = new Intent (Intent.action_dial,uri.parse ("tel:13655345433"));
Intent.setflags (Intent.flag_activity_new_task);
Mobile Desktop
1 setting up the desktop
SetWallpaper (InputStream data)
As the desktop background map must be the same as the aspect ratio of the screen (resolution is not necessarily the same)
Because the mobile phone desktop is not sure to put on that phone, in the screen resolution is unknown, maintain the aspect ratio, do not deform.
2 Getting the phone desktop
Getwallpaper () When the phone does not have a desktop, return to the system default
Peekwallpaper () returns NULL when the phone does not have a desktop
3 Restoring the system default desktop
Clearwallpaper ()
For desktop operation, increase manifest permissions: Android.permission.SET_WALLPAPER
Android calls system features