Fire event on Opera Mobile browser for orientation change - mobile

How can I fire an event when orientation is changed on a mobile device.
onresize works fine on iPod Touch but not on mobile device using Opera mobile as browser.
Any help on how to fire event on Opera mobile.
Thanks,
Abhishek Jain

I've racked the web trying to find a good solution to this, I was in the same boat. There dosn't seem to be any really fantastic solutions out there, but what I use is this. Like I said not the best option, but mobile and mini Opera don't seem to fire anything catchable when the screen is resized. Since I'm looking at mobile devices I set the viewport to which ever (width/height) is smallest. When the user turns their device it will at least be kind of intuative.
Edit: I actually did this and coupled it together with a update width&height routine on my div's, based on screen.width/height, and it turned out pretty good.

Related

Physical-button-hold shortcut on mobile

Is it possible to utilize button-hold on mobile phone as a trigger for some programmed action? E.g. my app runs in background and it is programmed to open up if I hold both volume up and volume down buttons for 3 seconds.
I want to make iPhone/Android app. I haven't choose any framework yet, it's a question of technical possibility of such an idea, but I'll probably use objective-C/Swift as I have an iPhone.
I found an information for iOS on how to use events from volume buttons here, however it seems to be impossible to use events from power button or home button in the background, except from noticing that the app went from foreground to the background at home/power-button action.

Change of orientation performance issue - codenameone

when orientation changes in android, native android call the destroy method and total new layout is to be made as far as I know. But I think codenameone doesn't do that which is a great thing. But when I checked the cn1 app in devices while changing from portrait to landscape a blank screen is seen for a while and then the orientation changes.
My Problem is that when I have many more components displayed in a form,
the blank screen appears for a longer duration and sometime it hangs. Does it
happen as I don't use Orientation listener methods etc or is there anything I
can do to solve this issue?
I just tried this on my device and it worked fine for the latest build on my Android 6 device. There was the rotation animation from Android where the screen rotated into its new place.
I'm guessing the rendering of your screen is so slow that Android takes too long to draw it and ends up drawing a black screen instead so it can proceed with the animation.
I can't benchmark an application remotely but I suggest going over the performance of your app and making sure it is truly optimized.

Does the MouseLeftButtonDown work on WP7 devices?

I've recently started work on an application for Windows Phone 7 devices and I haven't yet acquired a WP7 device so I do all the debugging and testing in the emulator.
So. In my application I use the MouseLeftButtonDown event handler to catch a click and navigate from one page to the other. It works perfectly on the emulator but I would like to know for sure if it will work on the real devices as well.
The reason I got doubts is because of the name of the event MouseLeftButtonDown... a phone doesn't have mouse.
So anyone knows? Anyone can try this and tell me?
For Windows Phone 7.1 (Mango) all FrameworkElements now support Tap and DoubleTap, and you're recommended to use those instead of the Mouse Events.
If it works in the emulator then it works on the device. It would be a poor emulator that behaved differently from the device in such a fundemental area.
Yes, MouseLeftButtonDown works on the device.

How do you detect tablet PC screen rotation in a full screen Silverlight application?

I am working on a Silverlight 4 out of browser (OOB) application on a Windows 7 tablet PC. The majority of the time, the program is in full screen mode. However, if the user rotates the tablet, the application rotates and stays full screen, but is scaled for the previous screen orientation. Taking the application out of full screen and putting it back into full screen rescales everything correctly. Is there any way I can detect when the screen rotates? So far I've tried the app's Resize, LayoutChanged and FullScreenChanged events and have a handler for the main page's SizeChanged event. None of these get fired when the application is rotated in full screen mode.
Per Josh Einstein's suggestion, I tried polling the ActualWidth/Height of the application on a timer. It looks like after the rotation, the ActualWidth/Height values returned from the Silverlight plug-in are the pre-rotated values. Only taking it out of full screen and putting it back in full screen will change the resolution of the plug-in. The HtmlPage.Eval hack didn't work since I am OOB.
The WP7 version of Silverlight has the OnOrientationChanged event, which doesn't seem to be available in the desktop version. Anyone have any ideas?
Great question but as far as I can tell, it doesn't seem to be possible. I tried changing the screen resolution in a virtual machine (orientation change is really just a screen resolution change that results in width being larger than height or vice versa) and could not trigger any layout events.
The issue seems to be that the Silverlight plugin itself is not resized. With an elevated out-of-browser application you could presumably use COM interop with WMI to get the actual screen resolution, but it's kind of hacky. If it's an in-browser application, you could use the HTML DOM. In both cases, you'll probably have to poll for the current screen resolution instead of being notified via an event.
Mister Goodcat has written a blog post about how to get at this information in both scenarios.
I would file it as a Silverlight bug too.

Track "commands" send to WPF window by touchpad (Bamboo)

I just bought a touchpad wich allows drawing and using multitouch. The api is not supported fully by windows 7, so I have to rely on the build in config dialog.
The basic features are working, so if I draw something in my WPF tool, and use both fingers to do a right click, I can e.g. change the color. What I want to do now is assign other functions to special features in WPF.
Does anybody know how to find out in what way the pad communicates with the app? It works e.g. in Firefox to scroll, like it should (shown on this photo). But I do not know how to hookup the scroll event, I tried a Scrollviewer (which ignores my scroll attempts) and I also hooked up an event with the keypressed, but it does not fire (I assume the pad does not "press a key" but somehow sends the "scroll" command direclty. How can I catch that command in WPF?
Thanks a lot,
Chris
[EDIT] I got the scroll to work, but only up and down, not left and right. It was just a stupid "listbox in scrollviewer" mistake. But still not sure about commands like ZOOM in (which is working even in paint).. Which API contains such things?
[EDIT2] Funny, the zoom works in Firefox, the horizontal scrolling does not. But, in paint, the horizontal scrolling works...
[EDIT 3] Just asked in the wacom forum, lets see about vendor support reaction time...
http://forum.wacom.eu/viewtopic.php?f=4&t=1939
Here is a picture of the config surface to get the idea what I am talking about: (Bamboo settings, I try to catch these commands in WPF)
alt text http://img340.imageshack.us/img340/3751/20091008210914.jpg
Have you had a look at this yet.
WPF 3.5 does not natively support multi-touch (it is coming in WPF 4.0) however the samples in that kit should get you started using the Windows7 Integration Library which access the native Win32 APIs to provide the required support (Don't worry its not real ugly:).

Resources