Getting GPS data in background mode on iOS with Qt app - c++

Location updates stops being delivered to application in background after about a 20 minutes. Application is not closed because when I click on app icon it is brought back from background in state I left it and then updates starts comming again. I can also see that in top right corner of task bar there is little arrow when it is displayed I got the updates, when it disappears I'm not receiving updates. I'm getting GPS data every 5 seconds, keep it in some queue and every minute I connect to my server via tcp socket and send these updates. When top right arrow disappears my app no longer connects to the server (and it should even with empty data) so I assume that app is in some suspend mode.
I have written app in Qt/QML and then converted the project to XCode. I have checked "Background Modes" (Location updates, Background fetch) in Capabilities. I have in plist file UIBackgroundModes fetch,location. I have also NSLocationWhenInUse NSLocationAlways and NSLocationAlwaysAndWhenInUse UsageDescription And App in system checking has
settings->myapp->location->Always
Maybe the problem is that app is suspended or put to sleep. In some other project I have used some code to prevent screen fading with some simple code:
void IosLockHelper::setTimerDisabled() {
[[UIApplication sharedApplication] setIdleTimerDisabled: YES];
}
Is this this case? But I don't want to have screen turned on all time.
It should continue sending gps location to my server in some intervals it can be 1,5 minutes.
I'm testing on iOS 12.3.1 and with Qt 5.12.3
Thanks in advance
Marek

Related

Accessing wacom tablets from a background process (exclusive mode)?

One nice ascpect about MIDI is that one can route it explicitly to some app - unlike regular input devices like your run of the mill mouse or keyboard.
Is there a similar way to use a Wacom pen tablet exclusively with one app that doesn't even have a visible window resource (Windows 10)? I'd like to repurpose it as a jog dial for video editing and need to intercept the device data in order to simulate specific key presses or mouse movements.
Here is what I'm currently working with:
https://github.com/Wacom-Developer/wacom-device-kit-windows/tree/master/Wintab%20ScribbleDemo
https://developer-docs.wacom.com/intuos-cintiq-business-tablets/docs/wintab-reference#logcontext
The scribble demo works fine out of the box. Setting g_penMovesSystemCursor = false makes the system cursor ignore the tablet, but only as long as the demo's window is in focus. I want the system cursor to always ignore the tablet input and the demo to always receive the wacom events.
Well, I guess this answers it:
How can my application have exclusive access to all tablet pen events?
You must force your application to be the front-most (foreground) app.
https://developer-docs.wacom.com/intuos-cintiq-business-tablets/docs/wintab-faqs#how-can-my-application-have-exclusive-access-to-all-tablet-pen-events
Bummer. Such a simple and useful thing for an input device, and it's not supported.

Qt5: How to create interrupt driven gpio button based qt app

My problem is......... I am trying to develop an application.In this application there are certain pages and which is displaying on the LCD on my board.and my board has a gpio button by default the value of this button is high when i press this button value of this button become low after releasing again high.i want to make my app interrupt based when i pressed hold button for 3 second display should be rotate and if i just press and release button page should change.In my app i have interface my gpio button.
QString btnInput = "/sys/class/gpio/gpioN/value";
In my apps I can read the value from value file when my app start after that if i press button nothing will happen.what should i do.
how can i generate interrupt after pressing button.
please help me i am new in qt I start qt just before 2 week.
I can't tell for a Qt5 application actually (I don't have experience in the Qt field), but you may use a inotify file watcher with /sys/class/gpio/gpioN/value in user space.
That way your program will receive notifications (interrupts) whenever the value changes.
I'm almost sure there's also some (portable) Qt intrinsic mechanism, that resembles the same.
Update (after a little research):
Specifically for Qt I found this answer where the QFileSystemWatcher is mentioned for doing that portably.

detect touchscreen desktop

My ultimate wish is to allow users using a touchscreen desktop (an All-in-one computer without mouse or keyboard) to navigate on a website that uses tooltips. Using a mouse, hovering over a tooltip opens it, the tooltip contains links that can be clicked. Using a touchscreen, there is no hover, only 'touches'/clicks. In both cases the page will be displayed on the same OS using the same browser, once the user has a mouse, the other time the user has a touchscreen.
So I need to distinguish between the two: a desktop computer with a mouse and a touchscreen desktop computer without a mouse. Modernizr touch tests (http://modernizr.github.com/Modernizr/touch.html) fail completely on a touchscreen desktop (http://shop.lenovo.com/us/landing_pages/thinkcentre/2010/m90z). Sniffing the UA or browser does not work either.
(After a fair amount of searching, all the detection tries to distinguish different versions of mobile phones or tablets, browsers, UAs... Not desktop touchscreens that are running on the same OS using the same browser.)
Any ideas?
Add event listeners touchstart and mousemove to your page, then wait the user starts to interact with your page. If the first event is mousemove, then user operates with mouse, so it is probably a desktop, otherwise this is a touch-screen.
$(document).on('touchstart.desktopDetect mousemove.desktopDetect', function(ev) {
window.IS_TOUCHSCREEN_DEVICE = (ev.type == 'touchstart');
$(document).off('.desktopDetect');
});
Check working example here:
https://jsfiddle.net/evpozdniakov/uvb51cnm/embedded/result/

windows resume from sleep message in MFC

I am working on a program for Windows, and only on Windows xp 32 bit my bug happens.
The thing is that when Windows is in sleep mode and I wake it up and my GUI is messed up.
My program is connected to a server, and when the computer is waking up, the connection is broken. My GUI is going to the Login panel and doing a re-connection, but for some reason, the GUI display is only showing the animation of the re-connection, with all the rest of the components from the last screen also displayed.
What it should be showing is a blank screen with-reconnecting animation.
I want to catch the event/message that the system is passing to my application when it is waking up to clear the screen before reconnecting.
Is there any way to do so?

Appcelerator. Options dialog is opening several times when refreshing table

Titanium SDK version: 1.7.0.RC1
iPhone SDK version: 4.2
I am developing an iOS app in Appcelerator. I am retrieving tweets from twitter and inserting them into a table. For each row/tweet I am also extracting the containing links for that individual tweet/row and the user can select them from an options dialog which is opened when the row is clicked.
The problem is that if I reload the page and click the row, two dialogs are open upon each other. If I click three times, three dialogs is opened and so on. How can I make sure that the dialog only opens once?
This is my code: http://pastie.org/2004091
Thankful for all help!
I had a similar problem. Especially on the iPhone 3G as this runs slowly and you're more tempted to tap things more than once. The way I got around it is to either remove the event listener from within the event listener itself. Or you set a variable and test for its value in the event listener. So, if you set a variable call 'clicked' to false. When the listener is first check for 'clicked' = false, if it is set it to true so next time the code is not executed.