[Interest] [ Android ] Creating task that runs in background when app not in foreground or device sleeping?

Edward Sutton edward.sutton at subsite.com
Thu Jul 30 14:24:19 CEST 2015


I was hoping I could use the QBluetoothSocket connection.

However it sounds like a background service that does the Bluetooth communications must be pure java? No Qt, no C++.


-Ed


On Jul 30, 2015, at 6:53 AM, Stanislav Baiduzhyi <baiduzhyi.devel at gmail.com<mailto:baiduzhyi.devel at gmail.com>> wrote:

On Wed, Jul 29, 2015 at 8:01 PM, Edward Sutton
<edward.sutton at subsite.com<mailto:edward.sutton at subsite.com>> wrote:
My Qt widget app has Bluetooth connection that broadcasts GPS NMEA data to a
connected device.

How can I maintain this connection streaming GPS data when app is not in
foreground or device is in sleep?

Is it even possible to run Qt C++ code on Android in the background?

Does Qt have any example for this?

Is a Background Service what I need?

Creating a Background Service
https://developer.android.com/training/run-background-service/create-service.html

Thanks in advance for any tips or direction,

Yes, Qt application for android is a normal android application, so
you really need service. I was trying to do something like that last
year, the most convenient way I've found was to open the builded
project in Android Studio, fix the gradle errors, then change all you
need to make it a service. But by that time you need your Qt part
already working. I was stuck on the front-end side though, so dropped
the idea to use Qt for normal applications.
_______________________________________________
Interest mailing list
Interest at qt-project.org<mailto:Interest at qt-project.org>
http://lists.qt-project.org/mailman/listinfo/interest

This email and any files transmitted with it from The Charles Machine Works, Inc. are confidential and intended solely for the use of the individual or entity to which they are addressed. If you have received this email in error please notify the sender. Our company accepts no liability for the contents of this email, or for the consequences of any actions taken on the basis of the information provided, unless that information is subsequently confirmed in writing. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150730/5dbfb911/attachment.html>


More information about the Interest mailing list