Android device options

Source: Internet
Author: User

Now that you have learned about the sensor subsystem, the following section will review a sample code for recording audio on Android phones. This sample runs on Android devices, the onAccuracyChanged method does not perform any operations. It only adds one log entry for each call.

Android is a rich platform for application development. It has many attractive user interface elements and data management functions. Android also provides a rich set of Interface Options. This article describes how to monitor your environment with various Android sensor options.

Want to build your own baby monitor? Do you want to use your voice to answer the call or open the door? Learn how to use the hardware functions of devices equipped with Android. For Java developers, the Android platform is an ideal platform for creating innovative applications by using hardware sensors.

We will learn some interface connection options available for Android apps, including using sensor subsystems and recording audio clips. What applications can be built using the hardware functions of Android devices? Any application that requires electronic monitoring and listening can be built. Baby monitors, security systems, and even seismic instruments.

Theoretically, you cannot appear in two places at the same time, but Android can use some feasible methods to achieve this. At the beginning and end of this article, you must remember. The Android devices used are not only limited to mobile phones, but also devices deployed in fixed locations with wireless network connections, such as EDGE or WiFi. Download the source files in this example.

There is a novelty in using the Android platform, that is, you can access some "good tools" inside the device ". In the past, the ability to access the underlying hardware of the device once made mobile developers very difficult. Although the role of the Android Java environment is still a bridge between you and the device, the Android development team has brought many hardware features to the fore. This platform is an open-source platform, so you can freely write code to implement your tasks.

If you have not installed Android, you can download the Android SDK. You can also browse the content of the android. hardware package and refer to the example in this article. The android. media package contains classes that provide useful and novel functions. Some hardware-oriented functions in the Android SDK are described as follows. The SensorListener interface is the center of the sensor application. It includes two required methods:

The onSensorChanged (int sensor, float values []) method is called when the sensor value is changed. This method only calls sensors monitored by this application. For more information, see the following ). Parameters of this method include: an integer indicating the changed sensor; an array of floating-point values indicating the sensor data itself. Some sensors only provide one data value, while others provide three floating point values.

The direction sensor and the acceleration table sensor both provide three data values. When the sensor's accuracy changes, the onAccuracyChanged (int sensor, int accuracy) method is called. Parameters include two integers: one representing the sensor and the other representing the new accurate value of the sensor.

Applications created using Android devices and Android Developer Tools plug-ins. For more information about how to use Eclipse to develop Android applications, see references .) Listing 1 shows the code of the application.

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.