URI schemes supported in Windows 8 apps - windows-runtime

What are the URI schemes supported in Windows 8 apps? I have seen references to ms-appx: and ms-appdata: and some rare mentions of ms-resource: but I could not find any document that would be a list of the schemes (although I thought I have seen one in the past). I am wondering if URL.createObjectURL returns some other schemes, but I can't see a version of it for XAML apps. http://msdn.microsoft.com/en-us/library/windows/apps/Hh781215.aspx. Are there any other URI schemes supported in WinRT?

I believe the Metro js schemes. apply to xaml as well.
Some of those for xaml apps are listed here: How to Load File Resources (for XAML apps)
ms-resource: for xaml apps is listed here: ResourceLoader.GetStringForReference
URIs available in metro applications:
General form
<scheme>://<domain name>/<path>
Http
http://www.contoso.com/images/logo.png
App Package
ms-appx:
ms-appx:///default.html
ms-appx-web:
Content referenced via this scheme is loaded from the local package,
but runs with the abilities and restrictions of the web context.
File System
Can't be used directly. To use, obtain an IStorageItem and then use URL.createObjectURL
file://
App Data
ms-appdata://
Resources
ms-resource://
Dependent Packages
<domain name>:
URIs for WebSockets
ws: for unencrypted and wss: for encrypted. Used like this:
webSocket = new MessageWebSocket();
await webSocket.ConnectAsync("wss://www.example.com");

There now seems to be an article on Windows Dev Center that is focused specifically on URI schemes.

Related

Can I use Web APIs in chrome apps

I want to use web workers in a chrome app I plan on creating. But not certain if I can use all web apis in chrome app (or in this case web workers).
So my questions is: Can I use all web apis that the chrome browser can use in chrome apps
So I found the answer to it just a few minutes after posting this question
According to the Web API section in the chrome apps documentation:
In addition to the chrome.* APIs, extensions can use all the APIs that the browser provides to web pages and apps. If the browser doesn't support an API you want to use, you can bundle additional API libraries into your extension.
Don't worry about the term 'extension' in the quote above, it seems the documentation was copied from the extensions' web api section.

open ucbrowser from my app in windows phone 8

How can i open any other application from my application like open ucbrowser from my wp8 app.
I think uri schemes works but i don't know how to implement that in c#. I want ucbrowser uri
whatsapp uri.
You can only navigate to the uri scheme if the application has registered it.
The relevant article is here:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj206987(v=vs.105).aspx
Here are the default app uri schemes:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662937(v=vs.105).aspx
Apps that have exposed and registered for a uri scheme should note it in this page here:
http://developer.nokia.com/community/wiki/URI_Association_Schemes_List
You call the uri like so, if it is available.
var uriSchemeString = AppuriScheme;
Windows.System.Launcher.LaunchUriAsync(new Uri(uriSchemeString));

URL Scheme: How can I create a link, which will open a document in the Google Drive app

I am trying to create a web page, which embeds several Google Docs in it. My problem is that when this page is viewed on an android device, then the user is presented with the terrible web based Google Docs editor. Therefore, I would like to have a link on my page, which opens the native Google Drive app on the users phone, so he/she can edit the document there. After searching for two hours, I am unable to figure out how to make a link, which automatically opens the document in the native app.
I succeeded with viewing the Google Drive app in google market using the following link:
market://details?id=com.google.android.apps.docs
I also experimented with
googledrive://no-idea-what-to-write-here
But that did not succeed either.
Is this possible at all, or does this only work on iOS?
There does not seem to be a good way to do what you want (at least according to my testing with Android 4.0.4; maybe the situation is different with other versions).
Using http: or https: links intercepted by an app
In theory, just using the https://docs.google.com/... link for the document should work for you. According to this answer on StackOverflow, intercepting http: or https: URLs is the proper way to start an app when opening a link from the Android browser. The Google Drive app does exactly this — it registers intent filters for https://drive.google.com, https://docs.google.com, https://spreadsheets.google.com and a bunch of similar URLs (including http: with the same host names). And this actually works — when using the stock Android browser, attempting to open a link pointing to https://drive.google.com results in the chooser popup with the Google Drive app included in the list (together with all installed browsers); selecting Google Drive results in opening the document in the Google Drive editor, as you want.
But the problem is that such intercepted HTTP[S] URLs work only in the stock Android browser — I have not been able to find any third-party browser which could show the app chooser when following such links. I tested Chrome, Dolphin, Firefox, Light Browser, Opera (including Classic and Mini), UC Browser, and all of them just opened the link internally instead of offering to pass it to the Google Drive app.
Using the intent: URI scheme
There is another way to make a link which starts an Android app — use the intent: URI scheme. I have not been able to find proper documentation for the intent: URI format; of course, the source code for the function which generates such URIs is available.
For your test document:
https://docs.google.com/document/d/1zSzDnV-90Ke3dzCCJ2CZ6iQ3JQ3F1hL1udGDqbNwwbY/edit?usp=sharing
the corresponding intent: link which opens it in the Google Drive app will be:
intent://docs.google.com/document/d/1zSzDnV-90Ke3dzCCJ2CZ6iQ3JQ3F1hL1udGDqbNwwbY/edit?usp=sharing#Intent;scheme=https;action=android.intent.action.VIEW;category=android.intent.category.DEFAULT;category=android.intent.category.BROWSABLE;package=com.google.android.apps.docs;end
A test link with this URI is on a separate page (it is not possible to make an actual link pointing to such URI here).
The process of conversion is as follows:
Replace starting https: with intent:.
Append intent parameters:
#Intent;scheme=https;action=android.intent.action.VIEW;category=android.intent.category.DEFAULT;category=android.intent.category.BROWSABLE;package=com.google.android.apps.docs;end
Here scheme=https correspond to https: in the original URL, so if you want to convert a plainhttp: URL, this field should be scheme=http. And package=com.google.android.apps.docs is the package name of the app which should handle the link.
Now, when such link is followed, the browser should open the Google Drive app directly (without showing the app chooser). However, if the app is not installed, Android will open the Market app instead, and perform a search for the specified package name, so that the user could install the required app.
It is also possible to make the intent: link without the package parameter:
intent://docs.google.com/document/d/1zSzDnV-90Ke3dzCCJ2CZ6iQ3JQ3F1hL1udGDqbNwwbY/edit?usp=sharing#Intent;scheme=https;action=android.intent.action.VIEW;category=android.intent.category.DEFAULT;category=android.intent.category.BROWSABLE;end
In this case the behavior should be the same as when the intercepted https: link is followed in the stock Android browser — the app chooser with the Google Drive app and all browser apps will be displayed, and if the Google Drive app is not installed, the user will not be redirected to install it from Market.
Unlike intercepted http: and https: links, intent: links work in a wider range of Android browser apps; unfortunately, some browsers do not support them. Results of my testing:
Works: stock Android 4.0.4 browser, Chrome, Light Browser, Opera, Opera Classic.
Does not work: Dolphin, Firefox (feature request is pending), UC Browser.
And, obviously, non-Android browsers would not support such links at all, so you will need to use some kind of browser sniffing if your pages also must be usable for other clients.
Using a custom URI scheme
Some apps use completely nonstandard URI schemes, which might also work from third-party browsers. However, the Google Drive app does not do that, therefore this solution is not suitable for it (unless someone creates a “bridge” app which just passes requests to the Google Drive app).
Some browsers could also disallow nonstandard URI schemes except some whitelisted ones (such as market:) due to security concerns; I did not try to test this.

Equivalent to ASP.NET Web.Config

I'm new to Windows Phone 8 development. I'm coming from an ASP.NET Web Forms background where settings are stored in Web.Config. As some of you know, the Web.Config settings are hierarchical in nature where values are overridden depending on their location (root Web.config, machine.config, app level Web.config)
I am creating an app that calls into a third party API. The third party API uses OAuth which requires personal key information. I plan on open sourcing the code so I don't want to expose those keys.
If this was ASP.NET, I'd store the keys in a Web.config file outside of the app. This way, I'd be safe to publish my app to the public.
How would I achieve the same with a Windows Phone 8 app?
App.config functionality does not exist in Silverlight and WP apps. You can use IsolatedStorageSettings.ApplicationSettings to save/receive settings.
If you still want to use something similar to App.config then you can check this link for a similar functionality implementation.

How to determine if a particular Chrome Browser Extension is installed, with no relationship to the Extension Provider

How can I determine if a particular Chrome Browser Extension is installed, with no relationship to the Extension Provider?
It is a 'content script' (i.e. javascript running in the context of a web page) and so does not have access to chrome.i18n, chrome.extension, chrome.management objects.
The scenario is, a person has clicked on a link to an RSS feed. But as at current Chrome does not natively support the RSS/atom feed protocol, and presentation of RSS feeds in Google Chrome is best mediated by one or another of several available RSS Feed Reader Extensions.
We're recommending use of "RSS Subscription Extension (by Google)" and would like to offer the suggestion to the user that they install this Chrome Extension - download link and all - - but of course, only in the case they haven't already installed it.
How can I query the list of extensions installed into a running Chrome Browser?
You can try chrome.extension.getViews(object fetchProperties) which will return an array of the JavaScript 'window' objects for each of the pages running inside the current extension or chrome.management.getAll(function callback) which returns a list of information about installed extensions and apps.