正文
manifest.json 解析--手机web app开发笔记(三-2)
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
四、SDK配置和模块权限配置
SDK 就是 Software Development Kit 的缩写,中文意思就是“软件开发工具包”,也就是辅助开发某一类软件的相关文档、范例和工具的集合都可以叫做“SDK”。HbuilderX的SDK配置可视化界面中SDK有地图、登录鉴权、支付、推送、分享、语音识别、统计7种,如图3-9所示,我们这里不对该页面进行任何设置,如果在后面的开发中有需要,我们随时可以进行设置。
图3-9 SDK设置可视化界面
模块权限配置指的是我们开发的APP访问手机系统各种原生能力的权限进行设置。包括访问网络,调用录音、调用摄像、联系人、短信等等系统中的功能,我详细整理一个权限设置目录表格。我们需要什么权限在模块权限配置可视化界面中可以进行勾选或者在代码试图界面中进行填写,可视化界面如图3-10所示。
3-10 模块权限配置界面
序号 | 权限 | 说明 | |
1 | <uses-feature android:name=\"android.hardware.camera\"/> | 允许程序访问照相设备 | |
2 | <uses-feature android:name=\"android.hardware.camera.autofocus\"/> | 允许使用摄像头自动对焦 | |
3 | <uses-permission android:name=\"android.permission.ACCESS_CHECKIN_PROPERTIES\"/> | 访问登记属性,读取或写入登记check-in数据库属性表的权限 | |
4 | <uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/> | 获取错略位置 ,通过WiFi或移动基站的方式获取用户错略的经纬度信息,定位精度大概误差在30~1500米 | |
5 | <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>" | 获取精确位置 ,通过GPS芯片接收卫星的定位信息,定位精度达10米以内 | |
6 | <uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/> | 访问定位额外命令 ,允许程序访问额外的定位提供者指令 | |
7 | <uses-permission android:name=\"android.permission.ACCESS_MOCK_LOCATION\"/> | 获取模拟定位信息,获取模拟定位信息,一般用于帮助开发者调试应用 | |
8 | <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/> | 获取网络状态,获取网络信息状态,如当前的网络连接是否有效 | |
9 | <uses-permission android:name=\"android.permission.ACCESS_SURFACE_FLINGER\"/> | Android平台上底层的图形显示支持,一般用于游戏或照相机预览界面和底层模式的屏幕截图 | |
10 | <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/> | 获取当前WiFi接入的状态以及WLAN热点的信息 | |
11 | <uses-permission android:name=\"android.permission.ACCOUNT_MANAGER\"/> | 获取账户验证信息,主要为GMail账户信息,只有系统级进程才能访问的权限 | |
12 | <uses-permission android:name=\"android.permission.ADD_VOICEMAIL\"/> | 允许一个应用程序添加语音邮件系统 | |
13 | <uses-permission android:name=\"android.permission.AUTHENTICATE_ACCOUNTS\"/> | 验证账户 ,允许一个程序通过账户验证方式访问账户管理ACCOUNT_MANAGER相关信息 | |
14 | <uses-permission android:name=\"android.permission.BATTERY_STATS\"/> | 电量统计,获取电池电量统计信息 | |
15 | <uses-permission android:name=\"android.permission.BIND_ACCESSIBILITY_SERVICE\"/> | 允许使用AccessbilityService服务,该服务可以监听我们手机的焦点,窗口变化,按钮 | |
16 | <uses-permission android:name=\"android.permission.BIND_APPWIDGET\"/> | 绑定小插件,允许一个程序告诉appWidget服务需要访问小插件的数据库,只有非常少的应用才用到此权限 | |
17 | <uses-permission android:name=\"android.permission.BIND_CARRIER_MESSAGING_SERVICE\"/> | 这个常量是在API层面弃用23. BIND_CARRIER_SERVICES代替,BIND_CARRIER_SERVICES:允许绑定到运营商应用程序中的服务的系统进程将具有此权限。 | |
18 | <uses-permission android:name=\"android.permission.BIND_DEVICE_ADMIN\"/> | 绑定设备管理,请求系统管理员接收者receiver,只有系统才能使用 | |
19 | <uses-permission android:name=\"android.permission.BIND_DREAM_SERVICE\"/> | 必须由一个DreamService要求,确保只有系统可以绑定到它 | |
20 | <uses-permission android:name=\"android.permission.BIND_INPUT_METHOD\"/> | 绑定输入法 ,请求InputMethodService服务,只有系统才能使用 | |
21 | <uses-permission android:name=\"android.permission.BIND_NFC_SERVICE\"/> | 由HostApduService或OffHostApduService必须确保只有系统可以绑定到它 | |
22 | <uses-permission android:name=\"android.permission.BIND_NOTIFICATION_LISTENER_SERVICE\"/> | 必须要求由notificationlistenerservice,以确保只有系统可以绑定到它 | |
23 | <uses-permission android:name=\"android.permission.BIND_PRINT_SERVICE\"/> | 必须要求由printservice,以确保只有系统可以绑定到它 | |
24 | <uses-permission android:name=\"android.permission.BIND_REMOTEVIEWS\"/> | 绑定,必须通过RemoteViewsService服务来请求,只有系统才能用 | |
25 | <uses-permission android:name=\"android.permission.BIND_TEXT_SERVICE\"/> | 必须要求textservice(例如spellcheckerservice),以确保只有系统可以绑定到它 | |
26 | <uses-permission android:name=\"android.permission.BIND_TV_INPUT\"/> | 必须由TvInputService需要确保只有系统可以绑定到它 | |
27 | <uses-permission android:name=\"android.permission.BIND_VOICE_INTERACTION\"/> | 必须由VoiceInteractionService要求,确保只有系统可以绑定到它 | |
28 | <uses-permission android:name=\"android.permission.BIND_VPN_SERVICE\"/> | 绑定VPN服务必须通过VpnService服务来请求,只有系统才能用 | |
29 | <uses-permission android:name=\"android.permission.BIND_WALLPAPER\"/> | 绑定壁纸 ,必须通过WallpaperService服务来请求,只有系统才能用 | |
30 | <uses-permission android:name=\"android.permission.BLUETOOTH\"/> | 使用蓝牙,允许程序连接配对过的蓝牙设备 | |
31 | <uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/> | 蓝牙管理 ,允许程序进行发现和配对新的蓝牙设备 | |
32 | <uses-permission android:name=\"android.permission.BLUETOOTH_PRIVILEGED\"/>" | 允许应用程序配对蓝牙设备,而无需用户交互。这不是第三方应用程序可用 | |
33 | <uses-permission android:name=\"android.permission.BODY_SENSORS\"/> | 允许应用程序访问用户使用的传感器来测量他/她的身体内发生了什么,如心率仪 | |
34 | <uses-permission android:name=\"android.permission.BRICK\"/> | 变成砖头,能够禁用手机,非常危险,顾名思义就是让手机变成砖头 | |
35 | <uses-permission android:name=\"android.permission.BROADCAST_PACKAGE_REMOVED\"/> | 应用删除时广播,当一个应用在删除时触发一个广播 | |
36 | <uses-permission android:name=\"android.permission.BROADCAST_SMS\"/> | 收到短信时广播,当收到短信时触发一个广播 | |
37 | <uses-permission android:name=\"android.permission.BROADCAST_STICKY\"/> | 连续广播,允许一个程序收到广播后快速收到下一个广播 | |
38 | <uses-permission android:name=\"android.permission.BROADCAST_WAP_PUSH\"/> | WAP PUSH服务收到后触发一个广播 | |
39 | <uses-permission android:name=\"android.permission.CALL_PHONE\"/> | 拨打电话 ,允许程序从非系统拨号器里输入电话号码 | |
40 | <uses-permission android:name=\"android.permission.CALL_PRIVILEGED\"/> | 通话权限 ,允许程序拨打电话,替换系统的拨号器界面 | |
41 | <uses-permission android:name=\"android.permission.CAMERA\"/> | 拍照权限 ,允许访问摄像头进行拍照 | |
42 | <uses-permission android:name=\"android.permission.CAPTURE_AUDIO_OUTPUT\"/> | 允许一个应用程序捕获音频输出。不被第三方应用使用 | |
43 | <uses-permission android:name=\"android.permission.CAPTURE_SECURE_VIDEO_OUTPUT\"/> | 允许一个应用程序捕获视频输出。不被第三方应用使用 | |
44 | <uses-permission android:name=\"android.permission.CAPTURE_VIDEO_OUTPUT\"/> | 允许一个应用程序捕获视频输出。不被第三方应用使用 | |
45 | <uses-permission android:name=\"android.permission.CHANGE_COMPONENT_ENABLED_STATE\"/> | 改变组件状态 ,改变组件是否启用状态 | |
46 | <uses-permission android:name=\"android.permission.CHANGE_CONFIGURATION\"/> | 改变配置 ,允许当前应用改变配置,如定位 | |
47 | <uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/> | 改变网络状态如是否能联网 | |
48 | <uses-permission android:name=\"android.permission.CHANGE_WIFI_MULTICAST_STATE\"/> | 改变WiFi多播状态 | |
49 | <uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/> | 改变WiFi状态 | |
50 | <uses-permission android:name=\"android.permission.CLEAR_APP_CACHE\"/> | 清除应用缓存 | |
51 | <uses-permission android:name=\"android.permission.CLEAR_APP_USER_DATA\"/>" | 清除应用的用户数据 | |
52 | <uses-permission android:name=\"android.permission.CONTROL_LOCATION_UPDATES\"/> | 控制定位更新,允许获得移动网络定位信息改变 | |
53 | <uses-permission android:name=\"android.permission.DELETE_CACHE_FILES\"/> | 删除缓存文件,允许应用删除缓存文件 | |
54 | <uses-permission android:name=\"android.permission.DELETE_PACKAGES\"/> | 删除应用,允许程序删除应用 | |
55 | <uses-permission android:name=\"android.permission.DEVICE_POWER\"/> | 允许访问底层电源管理 | |
56 | <uses-permission android:name=\"android.permission.DIAGNOSTIC\"/> | 应用诊断,允许程序到RW到诊断资源 | |
57 | <uses-permission android:name=\"android.permission.DISABLE_KEYGUARD\"/> | 禁用键盘锁 ,允许程序禁用键盘锁 | |
58 | <uses-permission android:name=\"android.permission.DUMP\"/> | 转存系统信息 ,允许程序获取系统dump信息从系统服务 | |
59 | <uses-permission android:name=\"android.permission.EXPAND_STATUS_BAR\"/> | 状态栏控制,允许程序扩展或收缩状态栏 | |
60 | <uses-permission android:name=\"android.permission.FACTORY_TEST\"/> | 工厂测试模式,允许程序运行工厂测试模式 | |
61 | <uses-permission android:name=\"android.permission.FLASHLIGHT\"/> | 使用闪光灯,允许访问闪光灯 | |
62 | <uses-permission android:name=\"android.permission.FORCE_BACK\"/> | 强制后退,允许程序强制使用back后退按键,无论Activity是否在顶层 | |
63 | <uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/> | 访问账户Gmail列表 ,访问GMail账户列表 | |
64 | <uses-permission android:name=\"android.permission.GET_PACKAGE_SIZE\"/> | 获取应用大小 ,获取应用的文件大小 | |
65 | <uses-permission android:name=\"android.permission.GET_TASKS\"/> | 获取任务信息 android.permission.GET_TASKS,允许程序获取当前或最近运行的应用 | |
66 | <uses-permission android:name=\"android.permission.GET_TOP_ACTIVITY_INFO\"/> | 允许顶部获取窗体信息 | |
67 | <uses-permission android:name=\"android.permission.GLOBAL_SEARCH\"/> | 允许全局搜索 ,允许程序使用全局搜索功能 | |
68 | <uses-permission android:name=\"android.permission.HARDWARE_TEST\"/> | 硬件测试,访问硬件辅助设备,用于硬件测试 | |
69 | <uses-permission android:name=\"android.permission.INJECT_EVENTS\"/> | 注射事件 ,允许访问本程序的底层事件,获取按键、轨迹球的事件流 | |
70 | <uses-permission android:name=\"android.permission.INSTALL_LOCATION_PROVIDER\"/> | 安装定位提供,安装定位提供 | |
71 | <uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/> | 安装应用程序,允许程序安装应用 | |
72 | <uses-permission android:name=\"android.permission.INSTALL_SHORTCUT\"/> |
| |
73 | <uses-permission android:name=\"android.permission.INTERNAL_SYSTEM_WINDOW\"/> | 内部系统窗口 ,允许程序打开内部窗口,不对第三方应用程序开放此权限 | |
74 | <uses-permission android:name=\"android.permission.INTERNET\"/> | 访问网络,访问网络连接,可能产生GPRS流量 | |
75 | <uses-permission android:name=\"android.permission.KILL_BACKGROUND_PROCESSES\"/> | 结束后台进程,允许程序调用killBackgroundProcesses(String).方法结束后台进程 | |
76 | <uses-permission android:name=\"android.permission.LOCATION_HARDWARE\"/> | 允许一个应用程序捕获视频输出。不被第三方应用使用 | |
77 | <uses-permission android:name=\"android.permission.MANAGE_ACCOUNTS\"/> | 管理账户,允许程序管理AccountManager中的账户列表 | |
78 | <uses-permission android:name=\"android.permission.MANAGE_APP_TOKENS\"/> | 管理程序引用,管理创建、摧毁、Z轴顺序,仅用于系统 | |
79 | <uses-permission android:name=\"android.permission.MANAGE_DOCUMENTS\"/> | 允许一个应用程序来管理文档的访问,通常是一个文档选择器部分 | |
80 | <uses-permission android:name=\"android.permission.MASTER_CLEAR\"/> | 软格式化,允许程序执行软格式化,删除系统配置信息 | |
81 | <uses-permission android:name=\"android.permission.MEDIA_CONTENT_CONTROL\"/> | 允许一个应用程序知道什么是播放和控制其内容。不被第三方应用使用 | |
82 | <uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/> | 修改声音设置,修改声音设置信息 | |
83 | <uses-permission android:name=\"android.permission.MODIFY_PHONE_STATE\"/> | 修改电话状态,修改电话状态,如飞行模式,但不包含替换系统拨号器界面 | |
84 | <uses-permission android:name=\"android.permission.MOUNT_FORMAT_FILESYSTEMS\"/> | 格式化文件系统,格式化可移动文件系统,比如格式化清空SD卡 | |
85 | <uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/> | 挂载文件系统,挂载、反挂载外部文件系统 | |
86 | <uses-permission android:name=\"android.permission.NFC\"/> | 允许NFC通讯,允许程序执行NFC近距离通讯操作,用于移动支持 | |
87 | <uses-permission android:name=\"android.permission.PERSISTENT_ACTIVITY\"/> | 永久,创建一个永久的Activity,该功能标记为将来将被移除 | |
88 | <uses-permission android:name=\"android.permission.PROCESS_OUTGOING_CALLS\"/> | 处理拨出电话 ,允许程序监视,修改或放弃播出电话 | |
89 | <uses-permission android:name=\"android.permission.READ_CALENDAR\"/> | 读取日程提醒 ,允许程序读取用户的日程信息 | |
90 | <uses-permission android:name=\"android.permission.READ_CALL_LOG\"/> | 读取通话记录 | |
91 | <uses-permission android:name=\"android.permission.READ_CONTACTS\"/> | 读取联系人,允许应用访问联系人通讯录信息 | |
92 | <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/> | 程序可以读取设备外部存储空间(内置SDcard和外置SDCard)的文件,如果您的App已经添加了”WRITE_EXTERNAL_STORAGE”权限,则就没必要添加读的权限了,写权限已经包含了读权限了 | |
93 | <uses-permission android:name=\"android.permission.READ_FRAME_BUFFER\"/> | 屏幕截图 ,读取帧缓存用于屏幕截图 | |
94 | <uses-permission android:name=\"android.permission.READ_HISTORY_BOOKMARKS\"/> | 读取收藏夹和历史记录 ,读取浏览器收藏夹和历史记录 | |
95 | <uses-permission android:name=\"android.permission.READ_INPUT_STATE\"/> | 读取输入状态,读取当前键的输入状态,仅用于系统 | |
96 | <uses-permission android:name=\"android.permission.READ_LOGS\"/> | 读取系统日志 ,读取系统底层日志 | |
97 | <uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/> | 读取电话状态 ,访问电话状态 | |
98 | <uses-permission android:name=\"android.permission.READ_PROFILE\"/> | 访问用户个人资料 | |
99 | <uses-permission android:name=\"android.permission.READ_SMS\"/> | 读取短信内容 | |
100 | <uses-permission android:name=\"android.permission.READ_SOCIAL_STREAM\"/> | 读取用户的社交信息流 | |
101 | <uses-permission android:name=\"android.permission.READ_SYNC_SETTINGS\"/> | 读取同步设置,读取Google在线同步设置 | |
102 | <uses-permission android:name=\"android.permission.READ_SYNC_STATS\"/> | 读取同步状态,获得Google在线同步状态 | |
103 | <uses-permission android:name=\"android.permission.READ_USER_DICTIONARY\"/> | 从一个提供器中获取数据,针对对应的提供器,应用程序需要“读访问权限” | |
104 | <uses-permission android:name=\"android.permission.READ_VOICEMAIL\"/> | 允许应用程序在系统读取语音邮件 | |
105 | <uses-permission android:name=\"android.permission.REBOOT\"/> | 重启设备 ,允许程序重新启动设备 | |
106 | <uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/> | 允许程序开机自动运行 | |
107 | <uses-permission android:name=\"android.permission.RECEIVE_MMS\"/> | 接收彩信 | |
108 | <uses-permission android:name=\"android.permission.RECEIVE_SMS\"/> | 接收短信 | |
109 | <uses-permission android:name=\"android.permission.RECEIVE_WAP_PUSH\"/> | 接收WAP PUSH信息 | |
110 | <uses-permission android:name=\"android.permission.RECORD_AUDIO\"/> | 录制声音通过手机或耳机的麦克 | |
111 | <uses-permission android:name=\"android.permission.REORDER_TASKS\"/> | 排序系统任务,重新排序系统Z轴运行中的任务 | |
112 | <uses-permission android:name=\"android.permission.RESTART_PACKAGES\"/> | 结束系统任务,结束任务通过restartPackage(String)方法,该方式将在外来放弃 | |
113 | <uses-permission android:name=\"android.permission.SEND_RESPOND_VIA_MESSAGE\"/> | 允许用户在来电的时候用你的应用进行即时的短信息回复 | |
114 | <uses-permission android:name=\"android.permission.SEND_SMS\"/> | 发送短信 | |
115 | <uses-permission android:name=\"android.permission.SET_ACTIVITY_WATCHER\"/> | 设置Activity观察其 ,设置Activity观察器一般用于monkey测试 | |
116 | <uses-permission android:name=\"android.permission.SET_ALARM\"/> | 设置闹铃提醒 | |
117 | <uses-permission android:name=\"android.permission.SET_ALWAYS_FINISH\"/>" | 设置程序在后台是否总是退出 | |
118 | <uses-permission android:name=\"android.permission.SET_ANIMATION_SCALE\"/> | 设置全局动画缩放 | |
119 | <uses-permission android:name=\"android.permission.SET_DEBUG_APP\"/> | 设置调试程序,一般用于开发 | |
120 | <uses-permission android:name=\"android.permission.SET_ORIENTATION\"/> | 设置屏幕方向为横屏或标准方式显示,不用于普通应用 | |
121 | <uses-permission android:name=\"android.permission.SET_POINTER_SPEED\"/> | 无法被第三方应用获得,系统权限 | |
122 | <uses-permission android:name=\"android.permission.SET_PREFERRED_APPLICATIONS\"/> | 设置应用的参数,已不再工作具体查看addPackageToPreferred(String) 介绍 | |
123 | <uses-permission android:name=\"android.permission.SET_PROCESS_LIMIT\"/> | 允许程序设置最大的进程数量的限制 | |
124 | <uses-permission android:name=\"android.permission.SET_TIME\"/> | 设置系统时间 | |
125 | <uses-permission android:name=\"android.permission.SET_TIME_ZONE\"/> | 设置系统时区 | |
126 | <uses-permission android:name=\"android.permission.SET_WALLPAPER\"/> | 设置桌面壁纸 | |
127 | <uses-permission android:name=\"android.permission.SET_WALLPAPER_HINTS\"/> | 设置壁纸建议 | |
128 | <uses-permission android:name=\"android.permission.SIGNAL_PERSISTENT_PROCESSES\"/> | 发送一个永久的进程信号 | |
129 | <uses-permission android:name=\"android.permission.STATUS_BAR\"/> | 状态栏控制,允许程序打开、关闭、禁用状态栏 | |
130 | <uses-permission android:name=\"android.permission.SUBSCRIBED_FEEDS_READ\"/> | 访问订阅内容,访问订阅信息的数据库 | |
131 | <uses-permission android:name=\"android.permission.SUBSCRIBED_FEEDS_WRITE\"/> | 写入订阅内容 ,写入或修改订阅内容的数据库 | |
132 | <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/> | 显示系统窗口 | |
133 | <uses-permission android:name=\"android.permission.TRANSMIT_IR\"/> | 允许使用设备的红外发射器,如果可用 | |
134 | <uses-permission android:name=\"android.permission.UNINSTALL_SHORTCUT\"/> | 删除快捷方式 | |
135 | <uses-permission android:name=\"android.permission.UPDATE_DEVICE_STATS\"/> | 更新设备状态 | |
136 | <uses-permission android:name=\"android.permission.USE_CREDENTIALS\"/> | 使用证书 ,允许程序请求验证从AccountManager | |
137 | <uses-permission android:name=\"android.permission.USE_FINGERPRINT\"/> | 允许应用程序使用指纹硬件 | |
138 | <uses-permission android:name=\"android.permission.USE_SIP\"/> | 允许程序使用SIP视频服务 | |
139 | <uses-permission android:name=\"android.permission.VIBRATE\"/> | 允许振动 | |
140 | <uses-permission android:name=\"android.permission.WAKE_LOCK\"/> | 唤醒锁定,允许程序在手机屏幕关闭后后台进程仍然运行 | |
141 | <uses-permission android:name=\"android.permission.WRITE_APN_SETTINGS\"/> | 写入GPRS接入点设置 ,写入网络GPRS接入点设置 | |
142 | <uses-permission android:name=\"android.permission.WRITE_CALENDAR\"/> | 写入日程提醒,写入日程,但不可读取 | |
143 | <uses-permission android:name=\"android.permission.WRITE_CALL_LOG\"/> | 允许程序写入(但是不能读)用户的联系人数据 | |
144 | <uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/> | 写入联系人,写入联系人,但不可读取 | |
145 | <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/> | 允许程序写入外部存储,如SD卡上写文件 | |
146 | <uses-permission android:name=\"android.permission.WRITE_GSERVICES\"/> | 允许程序写入Google Map服务数据 | |
147 | <uses-permission android:name=\"android.permission.WRITE_HISTORY_BOOKMARKS\"/> | 写入浏览器历史记录或收藏夹,但不可读取 | |
148 | <uses-permission android:name=\"android.permission.WRITE_PROFILE\"/> | 允许程序写入个人资料数据 | |
149 | <uses-permission android:name=\"android.permission.WRITE_SECURE_SETTINGS\"/> | 允许程序读写系统安全敏感的设置 | |
150 | <uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/> | 允许读写系统设置 | |
151 | <uses-permission android:name=\"android.permission.WRITE_SMS\"/> | 允许编写短信 | |
152 | <uses-permission android:name=\"android.permission.WRITE_SOCIAL_STREAM\"/> | 读取用户的社交信息流 | |
153 | <uses-permission android:name=\"android.permission.WRITE_SYNC_SETTINGS\"/> | 写入Google在线同步设置 | |
154 | <uses-permission android:name=\"android.permission.WRITE_USER_DICTIONARY\"/> | 允许应用程序向用户词典中写入新词 | |
155 | <uses-permission android:name=\"android.permission.WRITE_VOICEMAIL\"/> | 允许应用程序修改和删除系统中的现有的语音邮件,只有系统才能使用 | |
156 | <uses-permission android:name=\"android.permission.RECEIVE_USER_PRESENT\"/> | 用户唤醒机器的权限! | |
157 | <uses-permission android:name=\"android.permission.BLUETOOTH\"/> | 允许程序连接配对过的蓝牙设备 | |
158 | <uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/> | 允许程序进行发现和配对新的蓝牙设备 |
五、App常用其它设置
App常用其它设置可视化界面中,有几个参数详细介绍一下:
1.自定义Webview的404等错误页面,表示Webview窗口加载页面错误时显示的页面。我们现在不进行任何设置,当我们后面开发的时候需要我们在进行设置即可。
对应的代码:
"plus": { "error": {
"url": "error.html"
}
2.Android设置中,有个UrlSchemes,表示实现被第三方应用调用,如果你的App想要在手机系统中注册一个scheme协议,方便其他App调用你的App,就可以详细设置此参数。对应的代码:
"plus": {
"distribute": {
"google": {
"schemes": [
"test"
],
//...
},
//...
},
//...
},
//...
schemes参数说明:为字符串数组,每个字符串为一个urlscheme,使用小写字母(不要使用特殊字符、中文),可设置多个。比如设置为test,那么其他App呼起你的app的scheme协议就是test://。
安装程序后,浏览器中,我们可以在html页面中,通过href直接调用应用:<a href="test://abc">test:<a>
在其它应用中通过href调用Url Scheme传递过来的值,可以通过plus.runtime.arguments获取
其值为完整的urlscheme字符串,如上面href的值启动应用后获取的plus.runtime.arguments值为“test://abc”
代码示例如下:
document.addEventListener('plusready',function(){
checkArguments();
},false);
// 判断启动方式
function checkArguments(){
console.log("plus.runtime.launcher: "+plus.runtime.launcher);
var args= plus.runtime.arguments;
if(args){
// 处理args参数,如直达到某新页面等
}
}
// 处理从后台恢复 document.addEventListener('newintent',function(){
console.log("addEventListener: newintent");
checkArguments();
},false);
3.minSdkVersion设置:minSdkVersion用于指定应用兼容的最低Android版本(API等级)。对应代码:
"plus": {
"distribute": {
"google":{
"minSdkVersion": 22
}
}
}
4.targetSdkVersion设置:用于指定应用适配的Android版本(API等级)。在Android系统中设置低版本的targetSdkVersion会使APP兼容模式运行,也就可能无法用到新系统的特性,甚至在兼容模式下运行可能存在安全漏洞等问题。随着Android系统的升级,一些应用市场会要求设置较高的targetSdkVersion才可以提交。我们把参数设置为26,因为华为应用市场要求的最低版本就是26。对应代码:
"plus": {
"distribute": {
"google":{
"targetSdkVersion": 26
}
}
}
六、源码试图
我们的基本参数在可视化界面进行了设置,最终的代码呈现就是在源码试图,其实质是一个JSON数据呈现,我们配置的最终代码如下:
{
"@platforms" : [ "android", "iPhone", "iPad" ],
"id" : "H5AF8C520",
/*应用的标识*/
"name" : "编程之路",
/*应用名称,程序桌面图标名称*/
"version" : {
"name" : "1.0.0",
/*应用版本名称*/
"code" : ""
},
"description" : "",
/*应用描述信息*/
"icons" : {
"72" : "icon.png"
},
"launch_path" : "index.html",
/*应用的入口页面,默认为根目录下的index.html;支持网络地址,必须以http://或https://开头*/
"developer" : {
"name" : "",
/*开发者名称*/
"email" : "",
/*开发者邮箱地址*/
"url" : "" /*开发者个人主页地址*/
},
"permissions" : {
"Share" : {
"description" : "分享"
},
"Accelerometer" : {
"description" : "访问加速度感应器"
},
"Audio" : {
"description" : "访问麦克风"
},
"Messaging" : {
"description" : "短彩邮件插件"
},
"Cache" : {
"description" : "管理应用缓存"
},
"Camera" : {
"description" : "访问摄像头"
},
"Console" : {
"description" : "跟踪调试输出日志"
},
"Contacts" : {
"description" : "访问系统联系人信息"
},
"Device" : {
"description" : "访问设备信息"
},
"Downloader" : {
"description" : "文件下载管理"
},
"Events" : {
"description" : "应用扩展事件"
},
"File" : {
"description" : "访问本地文件系统"
},
"Gallery" : {
"description" : "访问系统相册"
},
"Geolocation" : {
"description" : "访问位置信息"
},
"Invocation" : {
"description" : "使用Native.js能力"
},
"Orientation" : {
"description" : "访问方向感应器"
},
"Proximity" : {
"description" : "访问距离感应器"
},
"Storage" : {
"description" : "管理应用本地数据"
},
"Uploader" : {
"description" : "管理文件上传任务"
},
"Runtime" : {
"description" : "访问运行期环境" },
"XMLHttpRequest" : {
"description" : "跨域网络访问"
},
"Zip" : {
"description" : "文件压缩与解压缩"
},
"Barcode" : {
"description" : "管理二维码扫描插件"
},
"Maps" : {
"description" : "管理地图插件"
},
"Speech" : {
"description" : "管理语音识别插件"
},
"Webview" : {
"description" : "窗口管理"
},
"NativeUI" : {
"description" : "原生UI控件"
},
"Navigator" : {
"description" : "浏览器信息"
},
"NativeObj" : {
"description" : "原生对象"
}
},
"plus" : {
"splashscreen" : {
"autoclose" : false,
/*是否自动关闭程序启动界面,true表示应用加载应用入口页面后自动关闭;false则需调plus.navigator.closeSplashscreen()关闭*/
"waiting" : true /*是否在程序启动界面显示等待雪花,true表示显示,false表示不显示。*/
},
"statusbar" : {
"immersed" : true
},
"popGesture" : "close",
/*设置应用默认侧滑返回关闭Webview窗口,"none"为无侧滑返回功能,"hide"为侧滑隐藏Webview窗口。参考http://ask.dcloud.net.cn/article/102*/
"runmode" : "normal",
/*应用的首次启动运行模式,可取liberate或normal,liberate模式在第一次启动时将解压应用资源(Android平台File API才可正常访问_www目录)*/
"signature" : "Sk9JTiBVUyBtYWlsdG86aHIyMDEzQGRjbG91ZC5pbw==",
/*可选,保留给应用签名,暂不使用*/
"distribute" : {
"apple" : {
"appid" : "",
/*iOS应用标识,苹果开发网站申请的appid,如io.dcloud.HelloH5*/
"mobileprovision" : "",
/*iOS应用打包配置文件*/
"password" : "",
/*iOS应用打包个人证书导入密码*/
"p12" : "",
/*iOS应用打包个人证书,打包配置文件关联的个人证书*/
"devices" : "universal",
/*iOS应用支持的设备类型,可取值iphone/ipad/universal*/
"frameworks" : [] /*调用Native.js调用原生Objective-c API需要引用的FrameWork,如需调用GameCenter,则添加"GameKit.framework"*/
}, "google" : {
"packagename" : "",
/*Android应用包名,如io.dcloud.HelloH5*/
"keystore" : "",
/*Android应用打包使用的密钥库文件*/
"password" : "",
/*Android应用打包使用密钥库中证书的密码*/
"aliasname" : "",
/*Android应用打包使用密钥库中证书的别名*/
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"targetSdkVersion" : 26
},
/*使用Native.js调用原生安卓API需要使用到的系统权限*/
"orientation" : [ "portrait-primary" ],
/*应用支持的方向,portrait-primary:竖屏正方向;portrait-secondary:竖屏反方向;landscape-primary:横屏正方向;landscape-secondary:横屏反方向*/
"icons" : {
"ios" : {
"prerendered" : true,
/*应用图标是否已经高亮处理,在iOS6及以下设备上有效*/
"auto" : "",
/*应用图标,分辨率:512x512,用于自动生成各种尺寸程序图标*/
"iphone" : {
"normal" : "",
/*iPhone3/3GS程序图标,分辨率:57x57*/
"retina" : "",
/*iPhone4程序图标,分辨率:114x114*/
"retina7" : "",
/*iPhone4S/5/6程序图标,分辨率:120x120*/
"retina8" : "",
/*iPhone6 Plus程序图标,分辨率:180x180*/
"spotlight-normal" : "",
/*iPhone3/3GS Spotlight搜索程序图标,分辨率:29x29*/
"spotlight-retina" : "",
/*iPhone4 Spotlight搜索程序图标,分辨率:58x58*/
"spotlight-retina7" : "",
/*iPhone4S/5/6 Spotlight搜索程序图标,分辨率:80x80*/
"settings-normal" : "",
/*iPhone4设置页面程序图标,分辨率:29x29*/
"settings-retina" : "",
/*iPhone4S/5/6设置页面程序图标,分辨率:58x58*/
"settings-retina8" : "", /*iPhone6Plus设置页面程序图标,分辨率:87x87*/
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
},
"ipad" : {
"normal" : "",
/*iPad普通屏幕程序图标,分辨率:72x72*/
"retina" : "",
/*iPad高分屏程序图标,分辨率:144x144*/
"normal7" : "",
/*iPad iOS7程序图标,分辨率:76x76*/
"retina7" : "",
/*iPad iOS7高分屏程序图标,分辨率:152x152*/
"spotlight-normal" : "",
/*iPad Spotlight搜索程序图标,分辨率:50x50*/
"spotlight-retina" : "",
/*iPad高分屏Spotlight搜索程序图标,分辨率:100x100*/
"spotlight-normal7" : "",
/*iPad iOS7 Spotlight搜索程序图标,分辨率:40x40*/
"spotlight-retina7" : "",
/*iPad iOS7高分屏Spotlight搜索程序图标,分辨率:80x80*/
"settings-normal" : "",
/*iPad设置页面程序图标,分辨率:29x29*/
"settings-retina" : "", /*iPad高分屏设置页面程序图标,分辨率:58x58*/
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"appstore" : "k:/程序开发/我的生活/开发素材/logo.png"
},
"android" : {
"mdpi" : "unpackage/res/icons/48x48.png",
/*普通屏程序图标,分辨率:48x48*/
"ldpi" : "unpackage/res/icons/48x48.png",
/*大屏程序图标,分辨率:48x48*/
"hdpi" : "unpackage/res/icons/72x72.png",
/*高分屏程序图标,分辨率:72x72*/
"xhdpi" : "unpackage/res/icons/96x96.png",
/*720P高分屏程序图标,分辨率:96x96*/
"xxhdpi" : "unpackage/res/icons/144x144.png", /*1080P 高分屏程序图标,分辨率:144x144*/
"xxxhdpi" : "unpackage/res/icons/192x192.png"
}
},
"splashscreen" : {
"ios" : {
"iphone" : {
"default" : "",
/*iPhone3启动图片选,分辨率:320x480*/
"retina35" : "",
/*3.5英寸设备(iPhone4)启动图片,分辨率:640x960*/
"retina40" : "",
/*4.0 英寸设备(iPhone5/iPhone5s)启动图片,分辨率:640x1136*/
"retina47" : "",
/*4.7 英寸设备(iPhone6)启动图片,分辨率:750x1334*/
"retina55" : "",
/*5.5 英寸设备(iPhone6 Plus)启动图片,分辨率:1242x2208*/
"retina55l" : "" /*5.5 英寸设备(iPhone6 Plus)横屏启动图片,分辨率:2208x1242*/
},
"ipad" : {
"portrait" : "",
/*iPad竖屏启动图片,分辨率:768x1004*/
"portrait-retina" : "",
/*iPad高分屏竖屏图片,分辨率:1536x2008*/
"landscape" : "",
/*iPad横屏启动图片,分辨率:1024x748*/
"landscape-retina" : "",
/*iPad高分屏横屏启动图片,分辨率:2048x1496*/
"portrait7" : "",
/*iPad iOS7竖屏启动图片,分辨率:768x1024*/
"portrait-retina7" : "",
/*iPad iOS7高分屏竖屏图片,分辨率:1536x2048*/
"landscape7" : "",
/*iPad iOS7横屏启动图片,分辨率:1024x768*/
"landscape-retina7" : "" /*iPad iOS7高分屏横屏启动图片,分辨率:2048x1536*/
}
},
"android" : {
"mdpi" : "",
/*普通屏启动图片,分辨率:240x282*/
"ldpi" : "",
/*大屏启动图片,分辨率:320x442*/
"hdpi" : "k:/程序开发/我的生活/开发素材/480-762.png",
/*高分屏启动图片,分辨率:480x762*/
"xhdpi" : "k:/程序开发/我的生活/开发素材/720_1242.png",
/*720P高分屏启动图片,分辨率:720x1242*/
"xxhdpi" : "k:/程序开发/我的生活/开发素材/1080_1882.png" /*1080P高分屏启动图片,分辨率:1080x1882*/
}
},
"plugins" : {
"speech" : {
"ifly" : {}
},
"oauth" : {},
"push" : {}
}
}
},
"fullscreen" : false
}