In Silverlight there is the PhoneSubtleBrush which is the color used in the Mail app to display the message excerpt below the subject.
Is there something in the Windows Runtime API that has the same color as PhoneSubtleBrush?
Not sure if it's exactly the same but I've been using ListViewItemSubheaderTextBlockStyle so far.
Related
I am developing a Universal App that uses the HTML5 / JavaScript framework. In this app I have a page with an HTML audio tag (with the attribute msAudioCategory set to "BackgroundCapableMedia"), that is further wired up with Windows.Media.SystemMediaTransportControls.getForCurrentView() in order to get the audio playing in the background. I also have, on both the windows and phone projects, set the Declarations > Background Tasks > Audio, with the default.html page set as the entry page.
Deploying to Windows (either local machine or emulator) works as expected. All to the good. However deploying to either the phone emulator or a physical phone device throws this rather unhelpful error:
Unexpected Error: Package could not be registered. (Exception from HRESULT: 0x80073CF6)
Cant see any obvious reason for this. Searching the net suggests that this might be a bug, but I also suspect that playing background audio on the phone might require a different methodology.
Notably, starting a new blank universal app, adding the declaration as above (with no audio tag or supporting code), deploys on windows but fails with the same error on the phone. Any ideas?
Have discovered the issue that the rather uninformative error was trying to tell me: my entry point was invalid. As mentioned I had it set it to the default.html page, but for the windows phone at least it needs to be set to a valid background task file. In C# this is something that inherits from the Windows.ApplicationModel.Background.IBackgroundTask interface. In JavaScript, this is a JS file that looks a little like this:
(function () {
var backgroundTaskInstance = Windows.UI.WebUI.WebUIBackgroundTaskInstance.current;
function doWork() {
var settings = Windows.Storage.ApplicationData.current.localSettings;
var key = backgroundTaskInstance.task.taskId.toString();
settings.values[key] = "Succeeded";
close();
}
if (!canceled) {
doWork();
} else {
key = backgroundTaskInstance.task.taskId.toString();
settings.values[key] = "Canceled";
close();
}
})();
Taken from the sample here: http://msdn.microsoft.com/en-us/library/windows/apps/hh977045.aspx
Cheers :D
WindowsPhone 8.1 do not support background audio by JavaScript. You should use c# for this task. That is all.
"Important:
You can use JavaScript to write background audio applications. However, Windows Phone 8.1 does not allow JavaScript to run in a background process. Which means, your foreground app and UI can be written in JavaScript, but your background task must be written in C# or C++. The Background audio for Windows Phone 8.1 sample provides an example of a JavaScript app that supports background audio by using a C# background agent."
https://msdn.microsoft.com/en-us/library/windows/apps/dn720802.aspx
DeviceStatus.ApplicationMemoryUsageLimit doesn't work on WP Silverlight 8.1 app, it always return 0, do you know why? and is there have new replaceable API for it?
Unfortunatly it will return 0 as mentioned by this msdn link
http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.info.devicestatus.applicationmemoryusagelimit(v=vs.105).aspx
See the Caution section. the new api for this is MemoryManager. see the following link
http://msdn.microsoft.com/en-us/library/windowsphone/develop/windows.system.memorymanager.aspx
Hope this helps.
I want to use reserved URI scheme "xbls:" (as below) to launching XBox game page, but it only shows a black screen to me, and nothing in it, could you tell me why?
await Launcher.LaunchUriAsync(new Uri("xbls:"));
Are you trying to overwrite xbls url scheme?
if so, it is not possible. Because we can't use reserved URL schemes for our own apps.
If you want to open a game using that URL scheme here then here is the scheme.
xbls://game/?gameid=[GAME_ID]
Example URL xbls://game/?gameid=474607D1
I got this URL options from this link http://windowsphone.xbox.com/en-IN/MOW/gamesloft_publisher_sale_2013_8
I don't know how to get GAME_ID.
I was searching to how to send a sms in air. I found this code while googling:
var callURL:String="sms:0-123-456-7890";
var targetURL:URLRequest = new URLRequest(callURL);
navigateToURL(targetURL);
Its working, but how to add a body text to it and can it be used to send sms to multiple numbers???
Here's link to standarts of using URI schemes https://www.rfc-editor.org/rfc/rfc5724#section-2.2.
But unfortunately looks like there is no way to implement this since neither iOS nor Android supports this feature in full way.
Here's link for Android ussue about it http://code.google.com/p/android/issues/detail?id=12142
And here's answer on SO about iOS sms url scheme not working on IOS5
Here's the thing.
A two-way communication (RPC-style) is needed between JavaScript on HTML pages provided by a web server online (with session-management and whatnot) and a windows EXE application running on the PC of the website visitor.
Both are parts of the same 'package' and should be able to communicate.
There is the use of a custom protocol for sure, but some browsers like Chrome & Safari sometimes have issues with custom protocol handling, so it is not reliable enough ...
Another possibility is to build a minimal web-server inside the EXE, so the communication would work with all browsers.
It is possible to develop an extension / plugin for each browsers separately, but it's a daunting task..
The usage of flash / java seems not possible for this task because of sandboxing, but I'm not sure about this ??
Do you have any other ideas ?
You can use an embedded ActiveX (COM) object and communicate between both platforms. I've done it (and would not have believed it possible had I not). It's nasty but it works. In the project I used it on I had no choice (which is about the only reason to ever do this). I built the COM object in C#.net and exposed an interface to COM for use on the page. It goes something like this:
function doSomethingInteresting() {
// in your js:
var obj = document.getElementById('yourObjectId');
obj.MethodNameDefinedOnYourCOMObject("someParameterValue");
}
// and your HTML looks like this; note that you can even catch events thrown from the COM object in Js...
<body>
<form>
<object id="yourObjectId" height="0" width="0" classid="clsid:99999999-9999-9999-9999-999999999999" onerror="oError()" VIEWASTEXT></object>
<script for="yourObjectId" event="ThisIsTheJavaScriptEventHandlerMethod(parameterName)" language="javascript">
// event handling here for the COM object
function yourObjectId::ThisIsTheJavaScriptEventHandlerMethod(parameterName) {
// you can process the parameterName passed from the object here
}
</script>
</form>
</body>
Happy coding!