I'm making a game support MogaPro run on both WP10 and WP8.
Here is the Capabilities code on packet manifest
<Capabilities>
<Capability Name="internetClientServer" />
<DeviceCapability Name="proximity" />
</Capabilities>
Create gamepad object:
if (!g_GamePad)
{
try
{
g_GamePad = ref new Moga::Windows::Phone::ControllerManager();
g_GamePad->Connect();
}
catch (Platform::Exception^ e)
{
return false;
}
if (!g_GamePad)
return false;
}
And code check connection:
if ((g_GamePad) && ((Moga::Windows::Phone::ControllerManager^)g_GamePad)->GetState(Moga::Windows::Phone::ControllerState::Connection) == Moga::Windows::Phone::ControllerResult::Connected){//code callback}
The problem is when I run on WP10 device, a system popup appear ask user want to use moga pro on this app or not. If I chose Yes, game run perfect. If I chose No, the Moga and Game never connect until I Uninstall and reinstall app.
But in WP8.1 I doesn't see any confirm popup and can not connect moga pro and game. Always assert at code check connection.
What is different between WP10 and WP8.1, and how I connect Moga and WP8.1.
Please help,
Thanks.
It looks like some incompatibility between MOGA control and Windows Phones; it's not possible to answer your question without access to the MOGA source code, but issue definitely not in your code.
I recommend you to try my open source library: worked perfectly with MOGA Mobile and should work with MOGA Pro.
Related
I have tried to Google and read the Quintus wiki but no solution. Why does quintus platformer need server to run? Because this I can't use phonegap nor cocoonjs to convert my project to android game. Is there a better HTML5 2d game engine that I can use without server? Or what can I do to get quintus run as android application?
So I finally managed to get the game running with little bit of help, so I am answering here for myself. To get the game running on Android phone you need to quote some code.
Try commenting out this code from your quintus.js file and try again. I was facing a similar issue, commenting out this code resolved it:
if(document.location.origin === "file://" || document.location.origin === "null") {
if(!Q.fileURLAlert) {
Q.fileURLAlert = true;
alert("Quintus Error: Loading assets is not supported from file:// urls - please run from a local web-server and try again");
}
return errorCallback();
Then compile it with CocoonJS Webview+ and install debug.apk to get the game running.
I want to integrate some voice commands in my windows phone 8.1 app.
The first thing I want to do is to open my app by a voice command and navigate to a certain page.
According to MSDN article Quickstart: Voice commands (XAML) I can use the override of protected virtual void OnActivated(IActivatedEventArgs args) method in App.xaml.cs to meet my requirements. But it does'nt work the way I though it would!
I have the method with the following structure:
protected override void OnActivated(IActivatedEventArgs args)
{
if (args.Kind == ActivationKind.VoiceCommand)
{
var commandArgs = args as VoiceCommandActivatedEventArgs;
if (commandArgs != null)
{
// ... some logic here
}
}
}
The problem is when I'm activating my app by saying "Open 'name of my app' [optional words]" the app opens but the Activated event never fires! The app opens and OnLaunched event fires. So I can't even enter the OnActivated method.
Does anyone know the problem? Why can't I enter OnActivated method using voice commands?
P.S. I tried it with a simulator as well as with a real device.
you can see this article,
http://t.co/Q5hRxRPvwR
is in spanish, but you will understand.
After you install the app and run it, the xml should be installed, like said in documentation.
After ask to cortana "What can I say?" it will show all you can said, and the apps that supports cortana. Choose you app and you will see what you can say for your app, like
If you say what your app can listen, your app will be activated.
in my windows phone 8 application i am using custom uri association to launch another application through my phone.
i.e
await Windows.System.Launcher.LaunchUriAsync(new Uri("sixtag:"));
but my app is not able to get certified for store because of this. the testing team tells that you app terminates unexpectedly while executing this.
now, i don't know how to deal with this.
is there any way to throw exception if the app which i am launching is not installed on phone ?
or i should try something else so my task gets accomplished and app gets certified for store as well.
You do not need to wrap your launch in try/catch or check for success as described in the other answers. As soon as you call LaunchUriAsync, the platform takes over and will automatically handle the possibility of no app being installed by asking the user if she wishes to search in the store.
A couple of things to double-check:
1) Ensure that you can successfully back into your app following the navigation to sixtag.
2) Ensure that your call to LaunchUriAsync is the direct result of a user action (eg. tapping a button)
try
{
await Windows.System.Launcher.LaunchUriAsync(new Uri("sixtag:"));
}
catch
{
MessageBox.Show("please install Sixtag from the app store","AppMissing", MessageBoxButton.OK);
}
you can perhaps display another button and on clicking directly navigate to the app store. See if this solves your problem. Do vote it up if it does :)
You are needed to handle that as shown here . Also Read out Remarks given there.
Hello I'm writing Windows phone application for working with OneDrive. My code is pretty simple:
XAML:
<OneDrive:SignInButton Name="signInButton1"
Height="72"
Margin="152,436,144,0"
VerticalAlignment="Top"
ClientId="MYCLIENTID"
Scopes="wl.basic wl.photos wl.skydrive wl.offline_access wl.signin wl.skydrive_update"
SessionChanged="signInButton1_SessionChanged"
TextType="Custom" />
CS code:
private void signInButton1_SessionChanged(object sender, Microsoft.Live.Controls.LiveConnectSessionChangedEventArgs e)
{
if (e.Session != null && e.Status == LiveConnectSessionStatus.Connected)
{
Session = e.Session;
}
}
When I push drive sign in button Signin the window is opened and if i don't submit this window but instead just press the back button then the white screen is shown and I get:
An exception of type 'Microsoft.Live.LiveAuthException' occurred in
mscorlib.ni.dll and wasn't handled before a managed/native boundary
User has not granted the application consent to access data in Windows
Live
Could somebody help me with it?
Try upgrading to the LiveSDK 5.6, which was just released a week or two ago. In using a sample Windows Phone 8 app with your code, this exception appears to be handled internally and doesn't get thrown into the UI (aka, I can't repro this with Live SDK 5.6).
I run next code in blank project and got "Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"
private Windows.Devices.Geolocation.Geolocator locator = new Windows.Devices.Geolocation.Geolocator();
private async void Button_Click(object sender, RoutedEventArgs e)
{
try
{
var position = await this.locator.GetGeopositionAsync();
}
catch (Exception ex)
{
//Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
}
}
Also, I tried to run Geolocation Sample 8.1 (c# and JS) but got the same exception and I tried to run this sample not on 1 PC and not on 1 network. All the same.
I have win8.1 rtm and VS2013 RC on my laptop.
Also, I run this code and Microsoft sample on ARM tablet with 8.1 Pro preview (with GNSS module) and on tablet(i5-3317U Processor and without GPS module) with 8.1 rtm. I didn't get this exception and all works fine. So I think it only occured on PC/Simulator.
How to test GeoLocation app on PC/Simulator?
The code works, I tested this on my computer:
private async void Button_Click(object sender, RoutedEventArgs e)
{
var locator = new Windows.Devices.Geolocation.Geolocator();
var position = await locator.GetGeopositionAsync();
}
I tested both on Windows 8 with Visual Studio 2012 as well as Windows 8.1 (Preview) and Visual Studio 2013 (preview). As long as the capabilities were set there were no problems. I did not download the sample, the code is fairly straight forward to write even for complex scenarios. Look at the sample for inspiration, but code your own. Always easier not having to debug somebody elses logic :)
Code was tested 'on pc' as well as simulator (although there shouldn't be a difference since the simulator IS your PC as it remote desktop's to your own computer)
Make sure that you set capabilities for location:
Use the location option in the simulator to set a specific address if you want:
My breakpoint
If all fails, do the usual. Uninstall the app, clean and rebuild, restart computer and Visual Studio, and check that the location capability is set by using getting the charm bar once the app is installed and running, and select permissions. It should say that it has permissions, see below:
Best of luck!
Test this code on 8.0 - work fine.
On 8.1 rtm still got class not registered exception.
I think I need to add some library, but don't know where.
UPD:
I found where is problem.
I have Pro N version of win 8.1. In Pro N this code throw exception.
On Enterprise and Pro versions all work fine.
As said "zedkommander" above, error com from "N" version of windows 8.
But he didn't give the solution, so i'm going to give it :
Microsoft employee confirmed this problem :
This behaviour is indeed specific to the āNā editions. For geolocation to work on N-editions of Windows, the Microsoft Media Feature Pack needs to be installed.
Geolocation has a dependency on WPD (Windows Portable Devices) infrastructure which is not present in N editions until the feature pack is installed.
If you want to fix it, you need to install "Microsoft Media Feature Pack" by clicking here : https://www.microsoft.com/fr-fr/download/details.aspx?id=30685