简体   繁体   English

Windows Phone 8.1中后台代理和跨应用访问的限制

[英]Limitations of Background agents and cross-app access in Windows Phone 8.1

Basically I'm working on a project where I need to: 基本上,我在一个项目中需要:

  1. Have a background service that can receive small packets of data from a paired bluetooth (BLE to be precise) device. 拥有可以从配对的蓝牙(准确地说是BLE)设备接收少量数据包的后台服务。
  2. Based on the received data, perform various functions on built-in Windows apps (media player, camera, phone dialler etc.) like switch to the next/previous track, alter volume level, take a picture, call a number etc (basically control built-in apps). 根据接收到的数据,在内置Windows应用程序上执行各种功能(媒体播放器,摄像头,电话拨号器等),例如切换到下一首/上一首曲目,更改音量,拍照,拨打电话等(基本控制)内置应用)。

Now there was an extensive hardware part to this project which I began working on assuming that Windows Phone would offer the same level of flexibility as Android and that the aforementioned tasks could be easily performed, but now that I searched around a bit and saw the constraints for Background Agents I was dumbfounded to say the least, and by the looks of it the kind of functionality I'm looking for is completely unavailable in WP APIs. 现在,该项目有一个广泛的硬件部分,我开始进行工作,假设Windows Phone将提供与Android相同的灵活性,并且上述任务可以轻松执行,但是现在我进行了一些搜索并看到了限制对于后台代理,我至少是傻眼了,从外观上看,我所寻找的功能在WP API中是完全不可用的。 And while I couldn't find a definitive answer regarding the second task I wish to perform, I'm assuming the sandbox-style environment which WP apps run in will prevent that from happening as well. 虽然我找不到我想要执行的第二项任务的确切答案,但我假设WP应用程序运行在沙盒式环境中也将阻止这种情况的发生。

Is there ANY way the above mentioned tasks can be performed with a Windows Phone 8.1 app or even something close? 是否可以通过Windows Phone 8.1应用程序或什至是接近的方式执行上述任务?

Short answer: no. 简短的回答:不。

Long answer: for various reasons Windows Phone is designed to provide ultimate control of system functions to the user. 长答案:出于各种原因,Windows Phone旨在向用户提供对系统功能的最终控制。 In general, all actions have to be user-initiated; 通常,所有动作都必须由用户启动; even the background tasks have to be ok'd at some point. 甚至在某些时候都必须执行后台任务。 Reasons include battery life, stability, predictability. 原因包括电池寿命,稳定性,可预测性。

A related policy is that no app may interfere with the operation of another. 相关政策是,任何应用都不得干扰其他应用的运行。 The only way apps can communicate is via launcher tasks or sharing protocols. 应用程序只能通过启动器任务或共享协议进行通信。 Using these you can do things like prompt the user to dial a number . 使用这些功能,您可以执行类似提示用户拨打号码的操作

Out of the tasks you list, the only one I can see being a feasible project is if you write your own camera app or music app that integrates with your Bluetooth device. 在列出的任务中,我看到的唯一可行的项目是编写与蓝牙设备集成的相机应用程序或音乐应用程序。 It's either/or though, you won't be able to make a one-stop app. 是/否,但是您将无法制作一站式应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM