Android代码-传感器-测试手机支持那几种传感

Android代码----传感器-----测试手机支持那几种传感一个小小Demo检测手机支持那几种传感:具体代码如下:[Ja

Android代码----传感器-----测试手机支持那几种传感

一个小小Demo检测手机支持那几种传感:

具体代码如下:

Android代码-传感器-测试手机支持那几种传感

[Java代码]DemoSensorActivity.java

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:orientation="vertical" >    <Button        android:id="@+id/button"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:text="获取传感器" />    <ScrollView        xmlns:android="http://schemas.android.com/apk/res/android"        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:orientation="vertical" >        <TextView            android:id="@+id/show"            android:layout_width="fill_parent"            android:layout_height="wrap_content" />    </ScrollView></LinearLayout>