有趣有内涵的文章第一时间送达!

喝酒I创作I分享

生活中总有些东西值得分享

@醉翁猫咪 

1. 充分利用智能手机的GPS定位信息,创造了O2O的商业模式,打通了线上与线下的信息流和商流,极大地推动了移动互联网的迅猛发展,下面关于GPS技术描述错误的是() 


您的回答为:GPS需要地面基站进行辅助矫正定位信息,否则无法准确定位。   

()GPS需要地面基站进行辅助矫正定位信息,否则无法准确定位。

()24颗GPS卫星在离地面22000KM的高空上,以12小时为周期环绕地球运行,使得在任意时刻,地面的任意一点都可同时观测到4颗以上的卫星,在任何天气情况下随时获取可靠的位置信息。

()GPS综合定位的话,精度可达厘米级和毫米级。但民用领域开发的精度约为10米。

()GPS定位易受周围环境的影响,并非一下就能定位成功,因此需要在程序代码中做好各种防范措施。建议在室外空旷的地方测试GPS是否定位成功,避免在有遮挡的地方测试,在室内很有可能无法成功定位。

()GPS(Global Position Syste),即全球定位系统,是20世纪70年代由美国陆海空三军联合研制的新一代控件卫星导航定位系统。

2. Android系统提供了位置服务的API,以下对Android定位使用叙述错误的是()  


您的回答为:在获取到LocationManager对象后,不需要指定LocationManager的定位方法,就可以通过调用LocationManager.getLastKnowLocation()方法获取当前位置 

()LocationManager可以用来获取当前的位置,追踪设备的移动路线,或设定敏感区域,在进入或离开敏感区域时设备会发出特定警报。

()在获取到LocationManger对象后,不需要指定LocationManager的定位方法,就可以通过调用LocationManager.getLastKnowLocation()方法获取当前位置。

()Location是一个代表位置信息的抽象类,用它可以获取所有的位置数据,GPS定位返回的位置数据中可以获取到当前的:高度,方向,经度和速度信息。

()在定位时,需要实现一个LocationListener位置监听接口,共有四个方法:void onLocationChanged(Location location):位置改变回调方法;void onStatusChanged(String provider,int status,Bundle extras):状态改变回调方法;void onProviderEnabled(String provider):定位提供者启用回调方法;void onProviderDisabled(String provider):定位提供者停用回调方法。

()LocationProviders则是提供定位功能的组件集合,集合中的每种组件以不同的技术提供设备的当前位置,区别在于定位的精度,速度和成本等方面。LocationProvider分两种: LocationManager.GPS_PROVIDER:通过GPS定位,较为精确,但比较耗电;LccationManager.NETORK_PROVIDER):通过网络定位,对定位精度不高或省电情况可考虑使用。

3. Android平台支持的传感器类型有哪些?

您的回答为:

TYPE_ACCELEROMETER:硬件,以m/s2[Math Processing Error]为单位测量三个轴向的(x,y,和z)加速度,包括重力。用于运动检测(震动,倾角等)。┋

TYPE_AMBIENT_TEMPERATURE:硬件,以摄氏度为单位测量周围空间的温度,用于检测空气温度。┋

TYPE_GRAVITY:软件/硬件,以m/s2为单位测量三个轴向的(x,y,和z)的重力。用于运动检测(震动,倾角等)。┋

TYPE_GYROSCOPE:硬件,以rad/s为单位测量设备三个物理轴线方向(x,y,和z)的旋转速度。用于检测旋转(旋转,翻转等等)。┋

TYPE_LIGHT:硬件以lx为单位测量周围的光线级别(光照度)。 用于控制屏幕亮度。┋

TYPE_LINEAR_ACCELERATION:软件或硬件,以m/s2为单位测量三个轴向的(x,y,和z)的加速度,不包括重力。用于检测单个轴线的加速度。┋

TYPE_MAGNETIC_FIELD:硬件 以,μT为单位测量周围三个物理轴向(x, y, z)的磁场。 用于创建一个罗盘。┋

TYPE_ORIENTATION:软件,测量设备所有三个物理轴向(x,y和x)的旋转角度。当使用Level 3的API的时候,你能通过使用重力传感器和磁场传感器,结合getRotatinMatrix()方法,获取设备的倾斜矩阵和旋转矩阵。用于检测设备的位置。┋

TYPE_PRESSURE:硬件,以hPa或mbar为单位测量周围的气压。 用于检测气压的变化。┋

TYPE_PROXIMITY:硬件,以cm为单位测量一个物体相对于设备屏幕的临近程度,这种传感器的典型用例是检测是否手机被放到人的耳旁。用于检测通话过程中手机的位置。┋

TYPE_RELATIVE_HUMIDITY:硬件,以百分比(%)为单位测量周围的相对湿度。用于检测结露点,绝对和相对湿度。┋

TYPE_ROTATION_VECTOR:软件或硬件,通过提供设备的三个旋转矢量测量设备方向。 用于运动检测和旋转检测 

全选


4. Android使用传感器的必要操作有哪些?  

您的回答为:

//获取传感器管理对象

SensorManager mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE);

获取传感器管理器┋

//获取传感器的类型(TYPE_ACCELEROMETER:加速度传感器)

Sensor mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEOMETER);

获取传感器类型┋

//创建传感器监听器

SensorEventListener msensorEventListener = new SensorEventListener(){

//当传感器的值改变的时候回调方法

@Override

public void onSensorChanged(SensorEvent event){

}

//当传感器精度发生改变时回调该方法

@Override

public void onAccuracyChanged(Sensor sensor, int accuracy){

}

};

创建传感器监听┋

//为传感器注册监听器

mSensorManager.registerListener(msensorEventListener, mSensor, SensorManager.SENSOR_DELAY_GAME);

注册传感器监听┋

//取消监听

mSensorManager.unregisterListener(msensorEventListener);

取消传感器监听 

全选

5. Android的网络访问方法主要有两种:一种是基于Socket的网络连接;另一种是基于HTTP协议的网络连接,下面关于Android网络通讯开发叙述错误的是()  

您的回答为:

HttpURLConnection是基于HTTP协议的,其底层通过Socket实现通信。HttpURLConnection设计的非常灵活,不会因为网络超时的问题而导致程序僵死。   

()HttpURLConnection是基于HTTP协议的,其底层通过Socket实现通信。HttpURLConnection设计的非常灵活,不会因为网络超时的问题而导致程序僵死。

()HTTP(超文本传输协议)是一个基于请求响应模式的,无状态的,应用层的协议。客户端向服务器发送HTTP请求包括:请求方法,请求头和正文。

()Socket由IP地址和端口号两部分组成。IP地址用来定位设备,端口号用来定位应用程序或者进程。Socket的交互通过字节流来完成。

()Socket通信方式连接一般适用于实时要求比较高的应用,例如:聊天,即时战斗的网游等。HTTP通信方式较为普遍,服务器有较多现成的应用可以使用的应用,开发起来速度较快

()Android应用不管使用哪种方式访问网络,都需要在清单文件中添加网络访问权限,否则程序会报错,android.permission.INTERNET

6. 以下关于HttpURLConnection类重要方法描述错误的是()

http://android.xsoftlab.net/reference/java/net/HttpURLConnection.html  


您的回答为:InputStream getOutputStream():获取输出流   

()String getResponseMessage():获得HTTP服务器响应的消息,返回值类型为字符串

()InputStream getOutputStream():获取输出流

()int getResponseCode():或者HTTP服务器响应的代码,放回值类型为整形,如果没有响应码,则返回-1

()InputStream getErrorStream():当出现请求的文件在远程服务器不存在等错误时,对从服务器返回的错误信息输入流进行分析,以便找出出错的原因

()void setRequestMethod(String Methond):设置传送给远程HTTP服务器的请求命令。参数method的取值可以为GET,POST,HEAD,PUT,DELETE,TRACE或OPTIONS

7. JSON是一种非常流行的轻量级的数据交换方式,RESTful服务几乎都在使用JSON格式进行数据传输,以下关于JSON格式叙述错误的是()

https://baike.baidu.com/item/JSON/2462549?fr=aladdin

您的回答为:JSON是一个键值对的集合,其中“键/值”在集合中是有严格顺序要求的   

()每个“键”后跟一个冒号“:”与值隔开,每组“键/值”对之间使用逗号“,”隔开

()“键”是关键字,用字符串表示,“值”是双引号括起来的字符串,数值,true,fase,nulll,JSON对象或者数组

()数组以左中括号“【”开始,右中括号“】”结束

()JSON是一个键值对的集合,其中“键/值”在集合中是有严格顺序要求的

()一个JSON对象是以左括号“{”开始,右括号“}”结束


8. You can access sensors available on the device and acquire raw sensor data by using the Android
sensor framework. The sensor framework provides several classes and interfaces that help you perform a wide variety of sensor-related tasks. Which job that you can use the sensor framework to do. 



http://android.xsoftlab.net/guide/topics/sensors/sensors_overview.html  

您的回答为:

Determine which sensors are available on a device.┋

Determine an individual sensor's capabilities, such as its maximum range, manufacturer, power requirements, and resolution.┋

Acquire raw sensor data and define the minimum rate at which you acquire sensor data.┋

Register and unregister sensor event listeners that monitor sensor changes. 

全选


9. You can access these sensors and acquire raw sensor data by using the Android sensor framework.
The sensor framework is part of the android.hardware package and includes the following classes and interfaces. 

http://android.xsoftlab.net/guide/topics/sensors/sensors_overview.html

您的回答为:

SensorManager:You can use this class to create an instance of the sensor service. This class provides various methods for accessing and listing sensors, registering and unregistering sensor event listeners, and acquiring orientation information. This class
also provides several sensor constants that are used to report sensor accuracy, set data acquisition rates, and calibrate sensors.┋

Sensor:You can use this class to create an instance of a specific sensor. This class provides various methods that let you determine a sensor's capabilities.┋

SensorEvent:The system uses this class to create a sensor event object, which provides information about a sensor event. A sensor event object includes the following information: the raw sensor data, the type of sensor that generated the event, the accuracy
of the data, and the timestamp for the event.┋

SensorEventListener:You can use this interface to create two callback methods that receive notifications (sensor events) when sensor values change or when sensor accuracy changes. 

全选

10. Android platform support which type of sensors?



http://android.xsoftlab.net/guide/topics/sensors/sensors_overview.html

您的回答为:

TYPE_ACCELEROMETER: Hardware, Measures the acceleration force in m/s2 that is applied to a device on all three physical axes (x, y, and z), including the force of gravity. Motion detection (shake, tilt, etc.).┋

TYPE_AMBIENT_TEMPERATURE: Hardware, Measures the ambient room temperature in degrees Celsius (°C). See note below. Monitoring air temperatures.┋

TYPE_GRAVITY: Software or Hardware, Measures the force of gravity in m/s2 that is applied to a device on all three physical axes (x, y, z). Motion detection (shake, tilt, etc.).┋

TYPE_GYROSCOPE: Hardware, Measures a device's rate of rotation in rad/s around each of the three physical axes (x, y, and z). Rotation detection (spin, turn, etc.).┋

TYPE_LIGHT: Hardware, Measures the ambient light level (illumination) in lx. Controlling screen brightness.┋

TYPE_LINEAR_ACCELERATION: Software or Hardware, Measures the acceleration force in m/s2 that is applied to a device on all three physical axes (x, y, and z), excluding the force of gravity. Monitoring acceleration along a single axis.┋

TYPE_MAGNETIC_FIELD: Hardware, Measures the ambient geomagnetic field for all three physical axes (x, y, z) in μT. Creating a compass.┋

TYPE_ORIENTATION: Software, Measures degrees of rotation that a device makes around all three physical axes (x, y, z). As of API level 3 you can obtain the inclination matrix and rotation matrix for a device by using the gravity sensor and the geomagnetic field
sensor in conjunction with the getRotationMatrix() method. Determining device position.┋

TYPE_PRESSURE: Hardware, Measures the ambient air pressure in hPa or mbar. Monitoring air pressure changes.┋

TYPE_PROXIMITY: Hardware, Measures the proximity of an object in cm relative to the view screen of a device. This sensor is typically used to determine whether a handset is being held up to a person's ear. Phone position during a call.┋

TYPE_RELATIVE_HUMIDITY:Hardware, Measures the relative ambient humidity in percent (%). Monitoring dewpoint, absolute, and relative humidity.┋

TYPE_ROTATION_VECTOR:Software or Hardware, Measures the orientation of a device by providing the three elements of the device's rotation vector. Motion detection and rotation detection.

全选

后续

关注我,每天都有优质技术文章推送。工作,学习累了的时候放松一下自己。

本篇文章同步微信公众号

欢迎大家关注我的微信公众号:「醉翁猫咪」

2016级移动应用开发在线测试13-Location、Sensor & Network的更多相关文章

  1. 2016级移动应用开发在线测试12-service

    有趣有内涵的文章第一时间送达! 喝酒I创作I分享 生活中总有些东西值得分享 @醉翁猫咪  1. Service是Android系统中的四大组件之一(Acitivty.Service.ContentPr ...

  2. 2016级移动应用开发在线测试14-MediaPlayer

    有趣有内涵的文章第一时间送达! 喝酒I创作I分享 生活中总有些东西值得分享 @醉翁猫咪 1. MediaStore类是android系统提供的一个多媒体数据库,android中多媒体信息都可以从这里提 ...

  3. 闽江学院软件学院2016级JAVA构建之法-学生自学兴趣小组招募通知

    为提升我2016级学生提升JAVA软件开发学习氛围,鼓励更多同学通过自学.团队学习.在线(社区)学习等方式学习并掌握JAVA课程,尤其是鼓励同学们通过微软中国邹欣老师所倡导的"构建之法&qu ...

  4. Java-Runoob-高级教程-实例-方法:13. Java 实例 – for 和 foreach循环使用

    ylbtech-Java-Runoob-高级教程-实例-方法:13. Java 实例 – for 和 foreach循环使用 1.返回顶部 1. Java 实例 - for 和 foreach循环使用 ...

  5. 【转载】在 2016 年做 PHP 开发是一种什么样的体验?(一)

    转自:https://www.v2ex.com/t/312651 在 2016 年做 PHP 开发是一种什么样的体验?(一) 嘿,我最近接到一个网站开发的项目,不过老实说,我这两年没怎么接触编程,听说 ...

  6. Windows Phone 8初学者开发—第13部分:设置LongListSelector中磁贴的样式

    原文 Windows Phone 8初学者开发—第13部分:设置LongListSelector中磁贴的样式 第13部分:设置LongListSelector中磁贴的样式 原文地址: http://c ...

  7. Windows Phone开发(13):如何规范用户的输入行为

    原文:Windows Phone开发(13):如何规范用户的输入行为 很多时候,我们对用户的操作或输入做一定程度的限制,以避免发生不必要的异常或错误,因此,对一些特殊的类型,进行输入限制是很有必要的. ...

  8. 【转】在 2016 年做 PHP 开发是一种什么样的体验?(一)

    原文: https://www.v2ex.com/t/312651 在 2016 年做 PHP 开发是一种什么样的体验?(一) 嘿,我最近接到一个网站开发的项目,不过老实说,我这两年没怎么接触编程,听 ...

  9. Java-Runoob-高级教程-实例-数组:13. Java 实例 – 数组交集

    ylbtech-Java-Runoob-高级教程-实例-数组:13. Java 实例 – 数组交集 1.返回顶部 1. Java 实例 - 数组交集  Java 实例 以下实例演示了如何使用 reta ...

随机推荐

  1. C# 对象集合初始化

    一.自动实现的属性 public class Person { // C# 3之前我们定义属性时,一般会像下面这样去定义 // 首先会先定义私有字段,再定义属性来对字段进行访问 //private s ...

  2. Win10家庭版升级到企业版的方法

    一.家庭版升级企业版 1.右键单击[此电脑]——>属性 2.点击更改产品密钥 3.输入密钥:NPPR9-FWDCX-D2C8J-H872K-2YT43 4.点击下一步,验证结束后点击开始升级,然 ...

  3. Ole操作帮助类

    /// <summary> /// Ole操作类 /// </summary> public class OleDataBaseHandle { private static ...

  4. JS中的if语句内如何加or使多个条件通过

    if(a==1&&b==2){ //do something }//条件是a等于1  并且  b等于2时才能成立,两个条件必须同时满足 if(a==1||b==2){ //do som ...

  5. pandas-11 TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely错误解决方法

    pandas-11 TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be sa ...

  6. Python学习日记(二十七) 反射和几个内置函数

    isinstance() 判断isinstance(obj,cls)中obj是否是cls类的对象 class Person: def __init__(self,name): self.name = ...

  7. Flask入门很轻松(三)—— 模板

    Jinja2模板引擎 转载请在文章开头附上原文链接地址:https://www.cnblogs.com/Sunzz/p/10959471.html Flask内置的模板语言,它的设计思想来源于 Dja ...

  8. Android打包遇到的问题

    问题一 运行环境 引擎:Unity 4.3.4f1 安卓:Android 6 打包机的环境 出错堆栈 Unity version : 4.3.4f1 Caused by: java.lang.Unsa ...

  9. Kotlin函数与Lambda表达式深入

    Kotlin函数: 关于Kotlin函数在之前也一直在用,用fun来声明,回忆下: 下面再来整体对Kotlin的函数进行一个学习. 默认参数(default arguments): 先来定义一个函数: ...

  10. 微信小程序~设置tabBar后,wx.navigateTo不能跳转

    当wx.navigateTo跳转链接跟app.json中设置的tabbar中跳转链接一样时,wx.navigateTo就不能跳转可以改为wx.switchTab 1.当app.json中设置了tabb ...