I work on .NetFramework WPF app and I need to run some UWP app, like calculator having only APPID (or family package name, I suppose) like:
Microsoft.WindowsCalculator_8wekyb3d8bbwe!App
Honestly I have no idea how to do it. Google doesn't help.
Process.Start() will not manage, as I don't have exe filepath.
Any suggestions?
I tried to reference UWP launcher but it failed.
Launching UWP application in simple C# app (WPF/Console)
WindowsCalculator is open source, you could get app's protocol name here. So you could use Launcher to launch WindowsCalculator app from WPF or Console.
private async void Button_Click(object sender, RoutedEventArgs e)
{
var res = await Launcher.LaunchUriAsync(new Uri("ms-calculator:"));
}
And this is sample. Please note, you need add Windows.winmd and System.Runtime.WindowsRuntime.dll for the WPF app. For more please refer this reply.
Related
I am creating a Kiosk Application for opening a single URL everytime the app run.
But unable to create a frame in c# to open such URL.
Please suggest me hot to do this coding.
Thanks in advance.
You can also use a DotNetBrowser component based on Chromium for your case. Here is an article with code examples for creating browser-based Kiosk applications with C#/VB.NET.
From VS add a WebBrowser component to your 'Kiosk' application..
And when the form loads, simply do this..
private void Form_Load(object sender, EventArgs e){
Uri url = new Uri("http://google.com");
webBrowser1.navigate(url);
}
I am new to windows phone app development. I am trying to build a simple speech recognition app using SpeechRecognizerUI class. But the problem is whenever i try to debug the app in my Lumia 520 device(working on 8.1 platform), it load the listener as usual and then debugger stopped automatically at the same time it load within a second, don't allow me sufficient time to speak even a single word. I am googling since 2 days but got nothing helpful. I have provided a single button on "MainPage.xml" of my app for which i have given the following code.
namespace Kundali
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
private async void button_Click(object sender, RoutedEventArgs e)
{
![SpeechRecognizerUI][1] sprec = new SpeechRecognizerUI();
SpeechRecognitionUIResult result = await sprec.RecognizeWithUIAsync();
MessageBox.Show(string.Format("You said {0} ", result.RecognitionResult.Text));
}
}
When i tried to handle the exception in catch handler it shows the exception "The text associated with this error code could not be found" not even listening the single text. Some one please help me.
Actually i am working with Visual studio 2012 (Express for windows Phone 8) but my device is on 8.1. Is this the problem?? If yes then please provide the solution. How do i integrate the functionality of 8.1 in vs2012?
I can think of two possible causes:
Did you add the Speech capability and the Microphone capability in your manifest WMAppManifest.xml file?
Do you have speech support for your current language? (Try setting to en-US to test)
Did you try using TTS (Text to Speech) which is also compatible with Windows Phone 8.1?
Sample
Windows Phone 8.1 Text to Speech
I am working on a project in which i have to integrate other apps/games with my platform. Through which i can run them. So their is one bad test solution is that i make them hardcodedly integrate them inside my framework as a part of framework. But that is crap.
So, my question is can i run other installed apps(these apps will be downloaded from store separately) through some code from my platform and I know data can be transfer from one app to other apps.
It should be like when i click on Play App Button then an installed app will get start and i transfer some settings to it and when user finish playing that app some data get transfer back to my platform and my platform resumes to corresponding state.
For opening other app form your app you have to know the uri for the app for example You want to open "another app"
string anotherappURI = "anotherapp_uri_value:///?anyVariable=value";
Uri uri = new Uri(anotherappURI);
await Launcher.LaunchUriAsync(uri);
And if you want to make a uri for your app so that it can be open from another app please follow the steps
Double click on package.appxmanifest file in the project
In the Declaration tab, select "Protocol" in the drop-down list and click on add
Enter "your_app_URI_displayname" as Display Name and "your_app_URI" as the Name
Save these changes
Now after activation (when your app is called and opened) how get the activation
Go to App.xaml.cs file
Override the OnActivated method
Insert this piece of code within :
Code:
protected override void OnActivated(IActivatedEventArgs args)
{
if (args.Kind == ActivationKind.Protocol)
{
ProtocolActivatedEventArgs eventArgs = args as
ProtocolActivatedEventArgs;
// TODO: Handle URI activation
// The received URI is eventArgs.Uri.AbsoluteUri
}
}
NOTE: Please upvote and accept it as answer if helpful
I am developing an app for Windows Phone 8.0 in VS2012.
I wanted to add a notification system for my app, so I searched for guides and found this one from MDSN.
I used the same methods as those in the guide, but the notification doesn't appear when I click the button.
Here's the event handler method:
private void Button_Click_1(object sender, RoutedEventArgs e)
{
ShellToast toast = new ShellToast();
toast.Content = "Hello!";
toast.Title = "StackOverFlow";
toast.Show();
}
I don't think you can use the native Toasts within your own app. These can be used via background tasks when you app is not running.
An alternative is using Coding4Fun Toolkit which has a ToastPrompt that can be used within the app.
Or if you don't want to get the whole Coding4Fun package, you can get Toastinet instead.
Both are also available on Nuget.
I'm trying call my application on OnShareTargetActivated() method by LaunchUriAsync() but it doesn't work.
I have a protocol called "myapp" in appmanifest. When I put "myapp://test" on File Explorer, my application is launched, but when I do it:
protected async override void OnShareTargetActivated(ShareTargetActivatedEventArgs args)
{
Uri uri = new Uri("myapp://test");
await Windows.System.Launcher.LaunchUriAsync(uri);
}
This occurs when the user clicks on my application that is on Charm Bar in Share option. But the application is never launched.
sharing app sample (http://code.msdn.microsoft.com/windowsapps/Sharing-Content-Target-App-e2689782)
You should check the format , of what you are sharing , metro will only accept some type of content to share , Sharing format are Text,uri,Bitmap,storageitems,Html
share target code and pictures (http://blogs.msdn.com/b/going_metro/archive/2012/05/03/integrating-with-windows-8-share-charm-part-1-receiving-data.aspx)
if u find useful , pls acccept as answer