Getting the orientation in windows phone native/xaml app - windows-phone-8

To apply orientation support to my game, I have been trying to get the screen orientation via
Windows::Graphics::Display::DisplayProperties::CurrentOrientation
But this throws an immediate exception. I searched on the net what might be the cause of it, but couldnt find any helpful resources. In this link , http://developer.nokia.com/community/discussion/showthread.php/246733-DisplayProperties-CurrentOrientation-not-supported-in-XAML-app a similar exception is discussed , and as a solution using App.RootFrame.Orientation in c# side is proposed.
But I need to get the orientation in native code. What could you suggest on this?

You could use the Accelerometer sensor to get the exact orientation when the device doesn't move much or simply use the Frame dimensions.

Related

Changing Chromecast orientation from browser to monitor

I have a google sheet I need to cast to a separate monitor, but all the data must be displayed without scrolling so I need to have the sheet displayed in portrait mode.
I have to build the spreadsheet using Excel then paste it into a Google Sheet in order to cast it. Any idea how to cast to a monitor that is setup for portrait mode so that all the data will fit on one screen? Thanks so much for ANY advice!!
If you are trying to cast in a vertically mounted TV (Portrait), I think this is not possible as per Chromecast Help Forum post. It was also identified that the rotation of the display using Chromecast is not possible as it is a work that should be done by the settings of the mobile/PC device you are casting from. Also, to help you understand more, check the overall design principles.
Wound up using Chromebits. It was a bit more expensive but the option to change the screen orientation is built in to the OS.

How to programmatically know if tablet is orizontal or vertical in windows 8 app

I'm developing a win8 / winrt xaml app. In my app I need to know if the orientation of the tablet is vertical or horizzontal..
Where can I find this information? I tried to use ActualWidth and ActualHeight properties but without any success.
I try to take a look at:
Frame
Application
Window
But I can't find what I'm looking for!
Any suggestion?
static property Windows.UI.ViewManagement.ApplicationView.Value will return the following values.
FullScreenLandscape
Filled
Snapped
FullScreenPortrait
Actually, since the ApplicationView.Value is deprecated in Windows 8.1, I'd recommend not using that for your app now. DisplayProperties provides some data here in their API. Also, depending on your scenario you may not want to think only about the device orientation but the Window size itself that your app is in. In Win8.1 since you can have 50/50 split, your app may be in a "taller than wider" viewport which effectively is a portrait view as well.
If your app relies on knowing portrait to make assumptions about edges of the physical device, then that is different, but consider looking at Window size and determining if "taller than wider" is a good indication for your app and use that to trigger any changes.

Improve touchscreen handling on Chrome

I am working on a web app that will be run off a local server on Windows 8 on Chrome. Unfortunately, Chrome doesn't seem to handle touch events very well. For example, often instead of clicking on a button, it will select it instead. Is there any way I can make it behave more like native touchscreen apps do?
I can't make it a metro app because I need to talk to a Python service.
I've done some testing in Chrome with a touch screen and don't seem to run into this issue (of course not doubting you are though!). If you have a site I'd be more than happy to check it out.
One option is to try scaling the content larger, I'm wondering if your touch surface is very sensitive to tiny movements upon touch and treating it as a touch/scroll ie select. Try a simple test in the browser to start by increasing the size before trying any css scaling transforms (which I'm not sure how in this how well that approach would even work)
What type of hardware is it being tested on?
Can you elaborate a bit more on the python service? What part of the service makes it so you can't interact with it? Is it just an http service object or something else?

crop screen maximized resolution

i would like to create some Flex Desktop Application that will be always in front of other applications (appWindow.alwaysInFront = true). It should looks like tiny bar at the top of the screen (eg. width = screenWidth, height = 50px). I know how to do that. But I have problem with other applications - when i maximize them, they are under my application. Is there any way how to say to the system, that maximized resolution for other apps is other than default?
Thanks for your answer.
You cannot do this with flash code, because you're interfering with external applications. At best, you could write some native code in another language and use AIR to execute that code but I can't really see that working out well, or at least being anything less than a massive undertaking.
If you do want to attempt this however, you can find some info about executing native code from AIR here: How can i on button press execute a command in the command prompt and get back the output in ActionScript?

How to force a Blackberry device to use GPS positioning in stead of cell triangulation in an HTML5 app?

We are doing some tests with HTML 5 geolocation and our code already works really well on Android and iPhone browsers: we get a continuous update of our precise position on Google maps. You can check our code here: http://93.113.255.166/testHTML5.htm
We also want to make this code work on a Blackberry device, the 9780 Bold with Blackberry 6.0 O.S., but it doesn't work as we would like. The position you get is a rough one, probably calculated through cell triangulation, and there is no precise position displayed. The position is most of the time some 300-400m wrong.
It's clear that the GPS positioning of the phone isn't used, because when you try the native Blackberry positioning apps, you get a very precise position.
We also use the enableHighAccuracy: true attribute in the code: this helps for the iPhone and Android browsers, but not for Blackberry browsers.
So it seems that we are unable to force the device to use the GPS. Is there anybody who could help us? Thanks!
Kristof
I don't know if this can help, but I have a problem using geolocation with Blackberry os6 using 3G; it works as designed (cell triangle if GPS hasn't fix) using GPRS, 3G with WiFi, GPRS with WiFi, but NOT using 3G alone.
My carrier is Vodafone Italy, but I read other people using os6 have the same problem. Obviously it works when GPS has fixed.
Reading around it seems it is a carrier problem, not a BB firmware problem, but I haven't any way to test roaming at the moment.
Looking at the BB log it seems it switches from BIS to wap when asking position, but then it is not able to reconnect BIS like os5 does (try with Google Maps on BB).
I have exactly the same problem. No matter if I set enablehighaccuracy to true of false, the phone always gives rough location. But GPS tool gives accuracy results.
A temporary way to solve this is to disable cell connection for couple of minutes. Then test your site again. If it can get accurate location, you can turn cell connection back on and the location will always be accurate till next reboot.