I'm using this code attached to a button:
public void openURL() {
Application.OpenURL("https://www.google.com/"); }
How do I get this to open when running on Android?
Do not worry about running it on a specific platform. Unity will take care of it. Just run the game on android and on click of the button, the url will open.
Try changing the player setting from auto to required for internet access. Also make sure you have http://www. If you don't do both, then it will work on windows but not android.
Related
I use and install zkteco 's SDK on my pc.
I have tested to remote open with zkaccess 3.5 standalone software.It is OK.
I have to know some of my development code.
I try to remote open door with ACUnlock method by passing machineNo and Delay time .
ACUnlock Method is return true but door does not open.
Is ACUnlock to open door ?and may need to configure or register door data or other event to fire in my development code?
I also found DisableDeviceWithTimeOut Method in SDK .It can be use to open door?
if (axCZKEM.ACUnlock(iMachineNumber, iDelay)) {
axCZKEM.RefreshData(iMachineNumber);
}enter image description here
I have a IOS app which show product details and for the AR section it opens another unity app.What I want to do is Quit the Unity app and go back to same page in the main app.I have used the following code.
public void BackHome()
{
Application.Quit();
}
The problem with this code is it quits like termination not smooth closing of app.Also it goes directly to the Home screen not to the app (that is main app page from where the Unity App opened up).What I want to do is open Unity app from the main app and after that while hitting a back button would like to close the unity app and return to the main app.
In player setting in Unity I have given Behaviour in BackGround - Exit.
Before Application.Quit, try open main app by URLSCHEME: Application.OpenURL("XXXXXX").
The Application and Voice commands are not shown in Cortana when typing "what can I say?"
I am attempting to use Voice Commands in the Foreground with Cortana and am running the Cortana Voice Command Sample and have been unable to get Cortana to show the application or Open / Perform Voice commands for the application named "AdventureWorks".
I am using the Cortana Voice Command Sample which I am running from Visual Studio 2015 locally on Windows 10 in debug. According to this link this should create an unpackage version of the sample on my local machine that I should be able to see from the Start screen which I cannot.
I have activated Microphone under the capabilities of the app and included the en-GB resources.resw file and changed the Package.appxmanifest to the Default language of en-GB to match in an attempt to ensure that Cortana's language matches with the application to eliminate that as a potential issue.
Here is the link showing that a unpackaged version of the application should be visible in the Start screen after running the app from VS (with or without debugging):
How to deploy a Metro App to the Desktop?
Cortana Voice Commands Sample:
https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/CortanaVoiceCommand
Note:
The application is standard apart from me including the en-GB resource file, changing the package.appxmanifest location to en-GB and adding Microphone to the capabilities of the application. Developer mode has also been enabled on my pc.
Update: There are no exceptions happening when adding the vcd.xml to the VoiceCommandDefinitionManager.. It looks like it should be working..
I have also noticed that when running the sample I cannot see the picture of London or the microphone icon saying "listening" like in this video: https://channel9.msdn.com/Events/Build/2015/3-716 at 04:16
At this time google searches for "application not showing in Cortana" does not show any useful results.
Has anyone else had any luck getting this sample to work? or similar issues? Also are you using the en-GB version?
Any help or ideas would be appreciated
I have successfully tested the AdverntureWorks sample using en-US.
Also I have developed another sample regarding Cortana Foreground.
Basically I have created the VCD and then installed it:
protected async override void OnLaunched(LaunchActivatedEventArgs e)
{
...
// Install the VCD
try
{
StorageFile vcdStorageFile = await Package.Current.InstalledLocation.GetFileAsync(#"HomeControlCommands.xml");
await VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync(vcdStorageFile);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("There was an error registering the Voice Command Definitions", ex);
}
}
And then handled the activation:
protected override void OnActivated(IActivatedEventArgs e)
{
// Handle when app is launched by Cortana
if (e.Kind == ActivationKind.VoiceCommand)
{
VoiceCommandActivatedEventArgs commandArgs = e as VoiceCommandActivatedEventArgs;
SpeechRecognitionResult speechRecognitionResult = commandArgs.Result;
string voiceCommandName = speechRecognitionResult.RulePath[0];
string textSpoken = speechRecognitionResult.Text;
IReadOnlyList<string> recognizedVoiceCommandPhrases;
System.Diagnostics.Debug.WriteLine("voiceCommandName: " + voiceCommandName);
System.Diagnostics.Debug.WriteLine("textSpoken: " + textSpoken);
switch (voiceCommandName)
{
...
}
}
}
The detailed process is described here
I had exactly same issue.
Make sure you have microphone capabilities turned on for your Package.appxmanifest otherwise it doesn't work.
Tu turn it on select your Package.appxmanifest in Solution Explorer go to Capabilities and check Microphone.
More info: http://jamescroft.co.uk/blog/universal-windows-8-dev/how-to-get-your-apps-cortana-ready/
Hope this helps,
damtur
I had the same problem as you, as noted by DevEnitly, if your region is set, for example, to UK and in your VCD file your CommandSet's language is en-US it won't work, simply changing the CommandSet's language to us-gb (or whatever language fits your region) should do the trick (it did for me), also note that, if you want to support different languages you should add more CommandSets. Hope this solve your problems.
Windows Phone 8 gives the ability to change the default camera app with another one downloaded from the store, making this new app the one that's launched when you hit the camera hardware button.
So I was wondering if is there any chance to launch this app using the CameraCaptureTask.
What I'd like to do is something simple like
var camera = new CameraCaptureTask();
camera.Show();
camera.Completed += new EventHandler<PhotoResult>(camera_Completed);
but I want this to work with the default app that the user chose on its device, and not with the basic Microsoft's one.
I've not found anything online, so I'm asking to you guys if I can make what I want.
Sorry, not possible with the current API.
Whether there is such a way that helps to restore the application from the background when the user launches it from the menu again?
If this not possible please provide link to documentation.
P.S. I just want to see the same behavior as on Android and iOS
There isn't a way to directly do this with the SDK - it supports fast app resuming on the back key press, but when they launch it from the menu it launches it new.
You could manually keep track of application status, similar to what you would have done with pre-Mango tombstoning, and then resume yourself when the application is launched new. A little info: http://blogs.microsoft.co.il/blogs/alex_golesh/archive/2010/07/14/silverlight-for-windows-phone-7-tombstoning.aspx
You can use functions Application_Deactivated,Application_Closing of App.xaml.cs
private void Application_Deactivated()
{
Save your application state in isolated storage.
}
private void Application_Closing()
{
Delete application state from isolated storage.
}
private void Application_Launching()
{
check if there is a application state stored in isolated storage.
if yes then resume it
else start fresh
}
hope it helps :)