Easy Tutorial
❮ Sql Join The Different Of On And Where Android Tutorial Layoutinflater ❯

10.12 Sensor Special Topic (4) —— Understanding Other Sensors

Classification Android Basic Beginner Tutorial

Introduction:

At the end of the previous section, it was mentioned that the sensor part is not something the author has extensively experimented with. This section will briefly introduce the remaining commonly used sensors as a form of popular science. Detailed research can be conducted when needed in the future.

1. Magnetic Field Sensor (Magnetic field sensor)

Function: This sensor is mainly used to read changes in the magnetic field near the phone.

Values Collected: There are three values, namely: magnetic field values along the X, Y, and Z axes.

Unit of Measurement: µT, microtesla

Sensor Retrieval: Sensor.TYPEMAGNETICFIELD


2. Proximity Sensor (Proximity sensor)

Function: Used to sense the distance between the phone and the human body. The most common use is during phone calls, where the screen dims when the face is close to the screen, and lights up again when the face is a certain distance away. This prevents accidental presses of the hang-up button during calls. This sensor can be used to create interactive apps.

Values Collected: One value, the distance between the object and the device.

Unit of Measurement: cm, centimeter

Sensor Retrieval: Sensor.TYPE_PROXIMITY

Additional Notes:


3. Light Sensor (Light sensor)

Function: Used to read the illuminance value, i.e., the intensity of light.

Values Collected: One value, the brightness value.

Unit of Measurement: lux, 1 lumen per square meter, which is 1 lux, with a maximum value of 120,000.0f. Android categorizes light intensity into different levels, which can be checked in the SensorManager class.

Sensor Retrieval: Sensor.TYPE_LIGHT


4. Pressure Sensor (Pressure sensor)

Function: Used to measure atmospheric pressure, commonly used to measure altitude.

Values Collected: One value, the atmospheric pressure value.

Unit of Measurement: hPa, hectopascal

Sensor Retrieval: Sensor.TYPE_PRESSURE


5. Temperature Sensor (Temperature sensor)

Function: Measures the temperature inside the phone or the external environment.

Values Collected: One value, the temperature value.

Unit of Measurement: °C, Celsius

Sensor Retrieval: Sensor.TYPETEMPERATURE (internal)/TYPEAMBIENT_TEMPERATURE (external)


6. Sensor Simulation Tool —— SensorSimulator

As the title suggests, when our real device lacks a certain sensor but we need to develop for it, we can use this tool. For specific usage, see the following article: Sensor Simulation Tool on Android Devices: SensorSimulator


Summary:

>

This section should probably be the most redundant one in the basic beginner series. Originally, it was not intended to be written, but it's here anyway. Just be aware of the above information. As always, detailed research can be conducted when needed in the future. Thank you.

-1.0 Android Basic Beginner Tutorial

-1.0.1 2015 Latest Android Basic Beginner Tutorial Table of Contents

-1.1 Background and System Architecture Analysis

-1.2 Development Environment Setup

-1.2.1 Developing Android Apps with Eclipse + ADT + SDK

-1.2.2 Developing Android Apps with Android Studio

-1.3 Solving SDK Update Issues

-1.4 Genymotion Emulator Installation

-1.5.1 Git Tutorial: Basic Operations on Local Repository

-1.5.2 Git: Setting Up a Remote Repository on GitHub

-1.6 How to Use the 9-Patch Image

-1.7 Interface Prototype Design

-1.8 Project Source Analysis (Various Files, Resource Access)

-1.9 Signing and Packaging Android Applications

-1.11 Decompiling APK to Retrieve Code & Resources

-2.1 Concepts of View and ViewGroup

-2.2.1 LinearLayout (Linear Layout)

-2.2.2 RelativeLayout (Relative Layout)

-2.2.3 TableLayout (Table Layout)

-2.2.4 FrameLayout (Frame Layout)

-2.2.5 GridLayout (Grid Layout)

-2.2.6 AbsoluteLayout (Absolute Layout)

-2.3.1 Detailed Explanation of TextView (Text Box)

-2.3.2 Detailed Explanation of EditText (Input Box)

-2.3.3 Button and ImageButton

-2.3.4 ImageView (Image View)

-2.3.5.RadioButton (Radio Button) & Checkbox (Check Box)

-2.3.6 ToggleButton and Switch

-2.3.7 ProgressBar (Progress Bar)

-2.3.8 SeekBar (Drag Bar)

-2.3.9 RatingBar (Star Rating Bar)

-2.4.1 ScrollView (Scroll Bar)

-2.4.2 Date & Time Components (Part 1)

-2.4.3 Date & Time Components (Part 2)

-2.4.4 Adapter Basics

-2.4.5 Simple Usage of ListView

-2.4.6 Optimization of BaseAdapter

-2.4.7 Focus Issues with ListView

-2.4.8 Solving Checkbox Misalignment in ListView

-2.4.9 Data Update Issues in ListView

-2.5.0 Building a Reusable Custom BaseAdapter

-2.5.1 Implementing Multiple Item Layouts in ListView

-2.5.2 Basic Usage of GridView (Grid View)

-2.5.3 Basic Usage of Spinner (List Option Box)

-2.5.4 Basic Usage of AutoCompleteTextView (Auto-Complete Text Box)

-2.5.5 Basic Usage of ExpandableListView (Collapsible List)

-2.5.6 Basic Usage of ViewFlipper (Flip View)

-2.5.7 Basic Usage of Toast

-2.5.8 Detailed Explanation of Notification (Status Bar Notification)

-2.5.9 Detailed Explanation of AlertDialog (Dialog Box)

-2.6.0 Basic Usage of Other Common Dialogs

-2.6.1 Basic Usage of PopupWindow (Floating Box)

-2.6.2 Menu (Menu)

-2.6.3 Simple Usage of ViewPager

-2.6.4 Simple Usage of DrawerLayout (Official Side Menu)

Follow on WeChat

❮ Sql Join The Different Of On And Where Android Tutorial Layoutinflater ❯