how do you control Alert behavior on J2ME phones? - java-me

I'm testing my midlet on 2 different Nokia model phones: 7210 Supernova and 6600 Fold.
Both are S40 5th ed SP1, still I get a different behavior with the alerts and I was wondering whether there is a way to fix that.
At various times my MIDlet beeps and puts up a self-dismissing Alert for n seconds (meaning it goes away after n seconds unless the user dismisses it earlier).
If that happens after the phone goes into screen saving mode (darkens), this is what happens:
on the 7210 Supernova, the screen lights up, you see the alert, and if you don't touch it it dismisses itself after n seconds and you can see the background screen - this is the desired behavior.
on the 6600 Fold, you hear the beep, but the screen remains dark. If you now press some button the phone lights up, but only then it displays the alert. The rest is similar. But this is problem because the whole MIDlet is at a stop until the user hits a key.
So I can fix it by not displaying this alert on phones that behave like my 6600, but I still want it on phones that behave like my 7210. Is there a way to check for this
programmatically? what do you check for?

Related

UI Glitches when using pyqt5+qml

I have a windows application written in qml+pyqt5 (and run on a windows 10 tablet).
Sometimes after a tap or on page switch, the application's background turning white, while the buttons are still visible and can be clicked - once I click them or on the screen - the white background disappear.
Sometimes after a tap or on page switch, there are strange triangles appearing from random places, and disappears on tap or click.
There is no indication of this bugs in the app's logs, and they fixes themselves on tap or click.
I've noticed that it happens more frequently when there is animation in the page - do you think there is a connection between the things?
Do you familiar with the phenomena, and know by any chance what is the root cause of them and how to deal with it?

How can I disable Chrome opening the Windows on-screen keyboard when debugging as iPad?

When I open the Chrome debug view and set the device to "iPad Mini" to simulate its screen size (and touch events), interacting with a text input causes the Windows on-screen keyboard to open.
This computer is not a tablet, and has never had a touch screen. In the Windows Ease of Access -> Keyboard settings Turns on the On-Screen Keyboard is off.
I can only assume that Chrome "simulating" an iPad Mini is causing Windows to think there's a touchscreen. I've been using this feature for a few months now, and the keyboard opening only started happening recently. I may have simply flipped a switch in the settings (of Chrome or Windows) on accident. If that's the case, I'd like to know how to flip it back!
This is frustrating because I have to close the keyboard each time as it covers up a large portion of the web-app.
The same page without the "iPad Mini" simulation does not open the keyboard:
(This keyboard also opens when choosing any device that has a touch screen, not just iPad Mini.)
Chrome doesn't emulate the keyboards of the device profiles you pick. An image of a keyboard will show for certain ones, like the iPhone 5X, but it is non-functional and is just present to allow you to see how the various elements on the page respond to the keyboard. You can see my answer here for more details on viewing that. However, this is not the same keyboard you are seeing.
It looks as though there is something in Windows, which is triggering the on-screen keyboard. I'm not sure why it would still appear if you have it disabled, but you could try a couple of things, based on what I've found online:
Make sure 'Touch Keyboard and Handwriting Panel Service' is set to disabled in Services (services.msc)
SetLOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\ ShowTabletKeyboard from value 1 to 0 (regedit.exe)
Check there is no other 3rd party software running, which may affect your keyboard behaviour.

iOS 8: UIAlertController text field losing focus when presented over UIWebView

When a user taps on a portion of a webpage in a UIWebView, I trigger a native UIAlertController asking for a password. This communication is done via the JavaScriptCore framework, so the creation and presentation of the alert is native.
Unfortunately, once the UIAlertController with the text box is presented, the keyboard briefly appears and is immediately dismissed. The user can still tap the text box to get the keyboard back. This does not happen when the alert is presented over a normal UIViewController without a UIWebView that has focus.
I suspect the UIWebView is stealing back first responder status after the alert is presented, but I don't know how to stop it.
The alert was previously a UIAlertView, and exhibited the same behavior on iOS 8. It functioned as expected in iOS 7, and the keyboard was not dismissed upon presentation. I updated to UIAlertController in the hopes of eliminating this bug, but it looks like it's specific to the UIWebView + iOS 8.

Is there a way in j2me, or at least on nokia phones, to light up the screen after screen saver kicks in?

I have a midlet which checks some conditions and at some point, when some condition becomes true, I display a pop-up dialog to the user.
If nothing happens for a while, the screen saver kicks in and after that the pop-up is not shown to the user - the screen is simply dark.
Is there way to wake up from the screen saving mode programmatically?
I know I can alert the user by sound and vibration and I do that, but I'd like to be able
to get the screen to react in some way (either to flash the lights, or just turn the light on).
Is there any way to do that?
You can implement showNotify() and hideNotify() from the Canvas class.

Why does the task bar appear when I display a self-drawn modeless dialog? .. sometimes?

I have an interesting (but frustraring) problem. I have an application which uses the full screen (this is meant to simulate a third-party fullscreen POS application).
My application displays a sequence of modeless dialog boxes on top of the full screen application. It shows one, hides it, then shows the next, hides it etc. After the 3rd show, the Windows taskbar appears about 1 second later. I can't figure out why.
I've stripped my code right back to see if its something I'm doing in my OnNcActivate handler (which I use to draw my skinned window) but I don't think it is as the problem appears to be timing related. I've tried running Spy++ as well as dumping messages in m WindowProc myself and I still can't see anything odd that would give me any clues.
There are some messages with ID 0x36e in my logs but I can't find out what they are supposed to be. I've checked various message ID lists and can't find them. They shouldn't be any message IDs of my own since WM_USER doesn't start until 0x400.
I know I could get around this problem by auto-hiding the taskbar but I can't ask our customers to configure their taskbars to auto-hide to get round my problem.
Any ideas why the taskbar would appear in relation to my modeless dialog boxes?
EDIT: I completely stripped out my self-drawn GUI code and I still have the same problem. I could be wrong but it would seem that when I call ShowWindow( SW_HIDE) first, Windows tries to activate "another Window" (as it says in MSDN). I think in this case its activating the taskbar rather than the POS application. If on the other hand I open my second window before calling ShowWindow( SW_HIDE ) on the second, then it seems to behave itself.
Cheers
Sparky
Following a long discussion I come to the conclusion that DestroyWindow was not the problem. I found in the end that displaying a dialog.. clicking on the POS, then clicking back on the dialog that sometimes the taskbar would appear. I have spent an entire week trying to find reasons for all of this but to no avail. I thought that assigning the POS window as the owner would solve the problem - it didn't. In the end the solution for my problem was to determine if the taskbar is obscured completely before showing my dialog. If it is, I hide the taskbar for the duration which my dialog is displayed (set its placement to SW_HIDE) and then set it to SW_SHOW when I close my dialog. The task bar doesn't pop up and annoy people anymore. Not a fantastic solution for other peoples' applications perhaps, but perfect for our customers.

Resources