网站名字备案流程,珠海城乡建设厅网站,广州网站制作服务,建设银网站前言#xff1a;搞懂 Android 系统和汽车到底有什么关系。 文章目录 一、基本概念1、Android Auto1#xff09;是什么2#xff09;功能 2、Google Assistant3、Android Automotive1、Android Auto 和 Android Automotive 的区别 4、App1#xff09;App 的开发2#xff09;… 前言搞懂 Android 系统和汽车到底有什么关系。 文章目录 一、基本概念1、Android Auto1是什么2功能 2、Google Assistant3、Android Automotive1、Android Auto 和 Android Automotive 的区别 4、App1App 的开发2App 的设计 二、源码和架构1、Android Automative的整体架构1Car App2Car API3Car Service4Car Toola、VMS 一、基本概念
1、Android Auto
1是什么
Android Atuo 是一个 Android 端的 app专门为驾驶环境设计的运行环境需要在 Android 5.0 或者更高版本的系统并且需要 Google 地图和 Google Play 音乐应用
2功能
Android Atuo 可以用来将 Android 设备上的部分功能映射到汽车屏幕上满足了很多人在开车时会使用手机的需求
2、Google Assistant
Google 将 GoofleAssistant 集成到 AndroidAuto 中交互方式有键盘、触摸、语音等对于汽车来说语音无疑是比触摸更好的交互方式在驾驶环境中语音交换存在的优势 用户不改变自身的物理姿势这种交互方式不影响驾驶员对驾驶的操作有需要多次触摸的交互时可能只需要一条语音就可以完成语音交互不存在入口的层次嵌套数据更加扁平优秀的语音系统可以利用对话的上下文完成任务避免用户重复输入
3、Android Automotive
1、Android Auto 和 Android Automotive 的区别
Android Auto 是以手机为中心的 好处数据和应用始终是一致的不存在需要数据同步的问题手机上装的软件和已有数据接到汽车上就直接有了坏处每次都需要拿出手机汽车只是作为手机的一个外设这种模式不便于对于汽车本身的控制和相关数据的获取 Android Automotive 如果将系统直接内置于汽车中会大大提升用户体验Android Automotive 就是面向这个方向进行设计的一旦将系统内置于汽车可以完成的功能就会大大增加例如直接在中控触摸屏上调整座椅和空调同时系统也能获取更多关于汽车的信息例如油耗水平、刹车使用等
加两张中控和仪表的图片
4、App
1App 的开发
Android Auto 目前仅支持两类第三方应用 音频应用允许用户浏览和播放汽车中的音乐和语音内容消息应用通过 text-to-speech 朗读消息并通过语音输入回复消息
2App 的设计
Google 专门为 Android Auto 上的 UI 设计做了一个指导网站Auto UI guidelines基本指导原则车机交互系统的借鉴 Android Auto 上的互动步调必须由驾驶员控制汽车界面上的触摸目标必须足够大以便可以轻松地浏览和点击适当的私彩对比可以帮助驾驶员快速解读信息并做出决定应用必须支持夜间模式因为过高的强度可能会干扰注意力Roboto 字体在整个系统中用于保持一致性并帮助提高可读性通过触摸来进行分页应用用来作为滑动翻页的补充有节制地使用动画来描述两个状态间的变化 二、源码和架构
1、Android Automative的整体架构 Android Automative 的源码包含在 AOSP 中Android Automative 是在原先 Android的 系统架构上增加了一些与车相关的图中虚线框中绿色背景的模块 Car App包括 OEM 和第三方开发的 App OEM就是汽车厂商利用自身掌握的核心技术负责设计和开发新产品而具体的生产制造任务则通过合同订购的方式委托给同类产品的其他厂家进行最终产品会贴上汽车厂商自己的品牌商标。这种生产方式被称为定牌生产合作俗称“贴牌”。承接这种加工任务的制造商就被称为OEM厂商其生产的产品就是OEM产品 Car API提供给汽车 App 特有的接口Car Service系统中与车相关的服务Vehicle Network Service汽车的网络服务Vehicle HAL汽车的硬件抽象层描述
1Car App /car_product/build/car.mk 这个文件中列出了汽车系统中专有的模块 列表中首字母大写的模块基本上都是汽车系统中专有的 App App的源码都位于 /platform/packages/services/Car/ 目录下 # Automotive specific packages
PRODUCT_PACKAGES \vehicle_monitor_service \CarService \CarTrustAgentService \CarDialerApp \CarRadioApp \OverviewApp \CarLensPickerApp \LocalMediaPlayer \CarMediaApp \CarMessengerApp \CarHvacApp \CarMapsPlaceholder \CarLatinIME \CarUsbHandler \android.car \libvehiclemonitor-native \2Car API
开发汽车专有的App自然需要专有的API这些API对于其他平台例如手机和平板通常是没有意义的所以这些API没有包含在Android Framework SDK中下图列出了所有的 Car API android.car包含了与车相关的基本API。例如车辆后视镜门座位窗口等。 cabin座舱相关API。hvac通风空调相关API。hvac是Heating, ventilation and air conditioning的缩写property属性相关API。radio收音机相关API。pm应用包相关API。render渲染相关API。menu车辆应用菜单相关API。annotation包含了两个注解。appcluster仪表盘相关API。contentdiagnostic包含与汽车诊断相关的API。hardware车辆硬件相关API。input输入相关API。media多媒体相关API。navigation导航相关API。settings设置相关API。vms汽车监测相关API。
3Car Service
Car Service并非一个服务而是一系列的服务。这些服务都在ICarImpl.java构造函数中列了出来
public ICarImpl(Context serviceContext, IVehicle vehicle, SystemInterface systemInterface,CanBusErrorNotifier errorNotifier) {mContext serviceContext;mHal new VehicleHal(vehicle);mSystemActivityMonitoringService new SystemActivityMonitoringService(serviceContext);mCarPowerManagementService new CarPowerManagementService(mHal.getPowerHal(), systemInterface);mCarSensorService new CarSensorService(serviceContext, mHal.getSensorHal());mCarPackageManagerService new CarPackageManagerService(serviceContext, mCarSensorService,mSystemActivityMonitoringService);mCarInputService new CarInputService(serviceContext, mHal.getInputHal());mCarProjectionService new CarProjectionService(serviceContext, mCarInputService);mGarageModeService new GarageModeService(mContext, mCarPowerManagementService);mCarInfoService new CarInfoService(serviceContext, mHal.getInfoHal());mAppFocusService new AppFocusService(serviceContext, mSystemActivityMonitoringService);mCarAudioService new CarAudioService(serviceContext, mHal.getAudioHal(),mCarInputService, errorNotifier);mCarCabinService new CarCabinService(serviceContext, mHal.getCabinHal());mCarHvacService new CarHvacService(serviceContext, mHal.getHvacHal());mCarRadioService new CarRadioService(serviceContext, mHal.getRadioHal());mCarNightService new CarNightService(serviceContext, mCarSensorService);mInstrumentClusterService new InstrumentClusterService(serviceContext,mAppFocusService, mCarInputService);mSystemStateControllerService new SystemStateControllerService(serviceContext,mCarPowerManagementService, mCarAudioService, this);mCarVendorExtensionService new CarVendorExtensionService(serviceContext,mHal.getVendorExtensionHal());mPerUserCarServiceHelper new PerUserCarServiceHelper(serviceContext);mCarBluetoothService new CarBluetoothService(serviceContext, mCarCabinService,mCarSensorService, mPerUserCarServiceHelper);if (FeatureConfiguration.ENABLE_VEHICLE_MAP_SERVICE) {mVmsSubscriberService new VmsSubscriberService(serviceContext, mHal.getVmsHal());mVmsPublisherService new VmsPublisherService(serviceContext, mHal.getVmsHal());}mCarDiagnosticService new CarDiagnosticService(serviceContext, mHal.getDiagnosticHal());4Car Tool
a、VMS
VMS全称是Vehicle Monitor Service。正如其名称所示这个服务用来监测其他进程在运行时这个服务是一个独立的进程在init.car.rc中有关于它的配置
service vms /system/bin/vehicle_monitor_serviceclass coreuser rootgroup rootcriticalon bootstart vms这是一个Binder服务并提供了C和Java的Binder接口用来供其他模块使用