Windows Phone开发手记-WinRT下启动器替代方案
在WP7/8时代,Silverlight框架提供了很多启动器API,我们可以很方便的使用的,来完成一些系统级的操作。但是随着Win RT架构的WP8.1(SL 8.1除外)的到来,原有的SL下的启动器API均不再可用。所幸,Win RT框架下提供的一些基于Uri协议的方案弥补了部分原有的功能缺失。今天我给大家分享,一些Win RT下的一些启动协议。
1.调用系统内置app
使用方式:
await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-wifi:"));
| Uri 方案 | 说明 |
|---|---|
| ms-settings-airplanemode: | 启动“飞行模式”设置页面。 |
| ms-settings-bluetooth: | 启动“蓝牙”设置页面。 |
| ms-settings-camera: | 启动“照片 + 相机”设置页面。 |
| ms-settings-cellular: | 启动“手机 + SIM”设置页面。 |
| ms-settings-emailandaccounts: | 启动“电子邮件 + 帐户”设置页面。 |
| ms-settings-location: | 启动“位置”设置页面。 |
| ms-settings-lock: | 启动“锁屏”设置页面。 |
| ms-settings-notifications: | 启动“通知 + 操作”设置页面。 |
| ms-settings-power: | 启动“节电模式”设置页面。 |
| ms-settings-proximity: | 启动“NFC”设置页面。 |
| ms-settings-screenrotation: | 启动“屏幕旋转”设置页面。 |
| ms-settings-wifi: | 启动“Wi-Fi”设置页面。 |
| ms-settings-workplace: | 启动“工作区”设置页面。 |
2.其他系统保留Uri协议
Windows Phone 为内置应用保留以下 Uri 方案。
bing、callto、dtmf、http、https、mailto、maps、ms-excel、ms-powerpoint、ms-word、office、onenote、tel、wallet、xbls、zune
Windows Phone 为操作系统保留以下 Uri 方案。
Explorer.AssocActionId.BurnSelection、Explorer.AssocActionId.CloseSession、Explorer.AssocActionId.EraseDisc、Explorer.AssocActionId.ZipSelection、Explorer.AssocProtocol.search-ms、Explorer.BurnSelection、Explorer.CloseSession、Explorer.EraseDisc、Explorer.ZipSelection、File、Iehistory、Ierss、Javascript、Jscript、LDAP、Res、rlogin、StickyNotes、telnet、tn3270、Vbscript、windowsmediacenterapp、windowsmediacenterssl、windowsmediacenterweb、WMP11.AssocProtocol.MMS
根据协议名称均可明白起所启动app,使用方式同上:
await Windows.System.Launcher.LaunchUriAsync(new Uri("maps:"));
3.与应用商店相关Uri协议
应用商店跳转,评分等api对开发者来说是十分重要,不行的是Win RT下带来了很大的变化,如下:
//商店根据appid跳转
var uri = new Uri(string.Format(@”zune://navigate/?appid={0}”, appid));
//关键字搜索
var uri = new Uri(string.Format(@”zune://search/?keyword={0}”,keyword));
//商店根据appid跳转评论
var uri = new Uri(string.Format(@”zune://reviewapp/?appid={0}”, appid));
await Windows.System.Launcher.LaunchUriAsync(uri);
总结:
WP8.1还有很多较大的变化,但是其本质和SL相似,碰到这些变化,需要我们多留心下相关的API文档,希望这些对大家有用。
Windows Phone开发手记-WinRT下启动器替代方案的更多相关文章
- Windows Phone开发手记-WinRT下分组拼音的实现
Windows Phone版本号自升入8.1以来,开发者就多了一个选项,开发基于WinRT架构的WP或者Universal Windows App.然而开发框架转为WinRT后,很多原有的WP8基于S ...
- Windows Phone开发手记-WinRT下自定义圆形ItemsControl
这里的ItemsControl指的是Xaml里的集合控件,包括ListView,GridView等,此篇博客主要参考MSDN Blog的一篇文章,具体出处为:http://blogs.msdn.com ...
- Android开发手记(10) 下拉菜单Spinner
1.自定义Spinner 首先,定义Spinner要显示的项目列表/res/values/arrays.xml <?xml version="1.0" encoding=&q ...
- Windows Phone开发(23):启动器与选择器之CameraCaptureTask和PhotoChooserTask
原文:Windows Phone开发(23):启动器与选择器之CameraCaptureTask和PhotoChooserTask 这两个组件都属于选择器,而且它们也有很多相似的地方,最明显的上一点, ...
- Windows Phone开发(26):启动器与选择器之MediaPlayerLauncher和SearchTask
原文:Windows Phone开发(26):启动器与选择器之MediaPlayerLauncher和SearchTask 启动器与选择器简单的地方在于,它们的使用方法几乎一模一样,从前面几节中,我相 ...
- windows RT开发笔记:WinRT DLL及其调用研究
一. 几个概念: WinRT : Windows Runtime, windows运行时.创建Windows运行时(WinRT)是为了在Windows上给用户提供一种流畅且安全的应用体验.WinRT会 ...
- Kinect for Windows SDK开发入门(15):进阶指引 下
Kinect for Windows SDK开发入门(十五):进阶指引 下 上一篇文章介绍了Kinect for Windows SDK进阶开发需要了解的一些内容,包括影像处理Coding4Fun K ...
- Windows Phone开发(25):启动器与选择器之WebBrowserTask
原文:Windows Phone开发(25):启动器与选择器之WebBrowserTask 从名字上就看出来,这个家伙就是打开浏览并浏览到指定页面. 它有两个用途完全一样的属性:Uri属性是Syste ...
- Windows Phone开发(24):启动器与选择器之发送短信
原文:Windows Phone开发(24):启动器与选择器之发送短信 本节我们通过一个简单的发送短信示例来演示一下如果配合使用PhoneNumberChooserTask和SmsComposeTas ...
随机推荐
- JSON.parse和JSON.stringify的区别
JSON.stringify()的作用是将 JavaScript 值转换为 JSON 字符串, 而JSON.parse()可以将JSON字符串转为一个对象. 简单点说,它们的作用是相对的,我用JSON ...
- 证明 U and V={0}时 dim(U+V)=dim(U)+dim(V)
U And V={0} 证明 dim(U+V)=dim(U)+dim(V)设{u1,u2,...,uk} 是U的基,{v1,v2...,vr}是V的基,dim(U)=k ,dim(V)=r dim(U ...
- 百度api接口_知识积累
app_id, app_key, app_secret app_id 是用来标记你的开发者账号的, 是你的用户id, 这个id 在数据库添加检索, 方便快速查找 app_key 和 app_secre ...
- Vue.js 教程
http://www.runoob.com/vue2/vue-routing.html
- 关于SQL表字段值缺失的处理办法
在计算收益率时候, 收益率 = 收益 / 成本 一.如果成本为0,NULL,此时无法计算收益率: 方法: 1.将成本为0的数据 运算 (case when cost =0 or cost is n ...
- 第26章:MongoDB-索引
①索引 索引本质上是树,最小的值在最左边的叶子上,最大的值在最右边的叶子上,使用索引可以提高查询速度(而不用全表扫描),也可以预防脏数据的插入(如唯一索引). 索引通常能够极大的提高查询的效率,如果没 ...
- AIX 补丁升级
下载地址:http://www-933.ibm.com/support/fixcentral 1.root登陆系统: 2.对系统进行备份或者克隆(见上一篇抄袭IBM官方文档的文章): 3.官方建议为/ ...
- web百度地图跨域问题
//根据经纬度获取地理位置信息function latOrLng(sLat, sLng) { var resUrl = 'http://api.map.baidu.com/geocoder/v2/?a ...
- 解决UITableView上的cell的重用
1.通过为每个cell指定不同的重用标识符(reuseIdentifier)来解决 // static NSString *rankCellIndefier = @"rankC ...
- How to resolve "your security settings have blocked an untrusted application from running" in Mac
If you encounter the error "your security settings have blocked an untrusted application from r ...