Several function interfaces ignored in Android APIs

Source: Internet
Author: User

1. MotionEvent Functions

The following methods support multi-touch, that is, you can call the following methods for a single touch point.

1.1 getPressure ()

This api can be used to obtain the pressure when you touch the screen with your fingers, but hardware and driver support is required...

It helps us to make more materialized designs, such:

1. hand-drawn. You can better simulate the interest and color of the paint brush Based on the finger pressure to make people feel more real.

2. Click the control. You can set the pressed Effect of controls (such as buttons) based on the finger pressure, such as the concave amplitude.

3. New operation method. And the fingers do not leave the screen, by adjusting the finger pressure to achieve the operation purpose, such as simulating a car refueling door

1.2 getSize ()

Obtain the contact area between the finger and the screen when you touch the screen.

This can be used to identify fattouch events, that is, a large area of touch events, which may be due to user misoperations.

1.3 getToolType ()

Gets the type of the object that triggers the current event: Finger, touch pen, or mouse (touch Version)

I didn't expect any use of this...

 

2. ClipData

ClipData. addItem (ClipData. Item item)

This api can put the text, resource address, and Intent in a ClipData object and save it in the system clipboard. The system clipboard can transmit data across applications, therefore, the following functions are supported:

1. copy and paste various files (images and videos) across applications, similar to windows clipboard.

2. Because the resource address can be local or from the network, you can also copy resources on the network side directly, similar to youdao cloud note on the PC side, directly copy the content of the webpage to the local. ClipData itself supports formatting text with HTML tags ..

3. directly copy the shortcut of the application. Intent is equivalent to starting a shortcut of the interface. In theory, you can copy the shortcut that jumps to any interface of the application, such as calling someone, initiate a video chat with someone.

 

1.3 Vibrator

Vibrator. vibrate (long [] pattern, intrepeat)

This api can control the rhythm of the vibration motor and support the following functions:

1. Let the user customize the vibration rhythm, ios already has this function.

2. There are several built-in vibration rhythms, which work well with the bell sound to increase interest.


 

Related Article

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.