Getting location data from GPS in android and ios
-
Hi: I am trying to get my location via mobile GPS and like to use Qt
to port my app onto both android and ios. Can I read from GPS sensor in those
mobile platforms directly via QNmeaPositionInfoSource
(http://doc.qt.io/qt-5/qnmeapositioninfosource.html) or must
I go through NDK (in Android) and C (in ios) to read from GPS sensor?thanks
-
I am using
PositionSource
in my application to receive the current position, which works pretty well. (see example here: http://doc.qt.io/qt-5/qml-qtpositioning-positionsource.html) -
thanks.
I see on the C++ side, there's a complementary API to what you suggested:http://doc.qt.io/qt-5/qnmeapositioninfosource.html
It seems that I can set the source directly to read from GPS sensor by declaring
a QIODevice(). How do I point to my GPS sensor on the phone using this class?
I am unclear about this.Thanks!
-
@vyau said in Getting location data from GPS in android and ios:
I see on the C++ side, there's a complementary API to what you suggested:
http://doc.qt.io/qt-5/qnmeapositioninfosource.htmlNMEA isn't want you want, this is just a specific position source - IIRC taken from special formatted text files
See this
-
@raven-worx thanks, let me check out your link.
-
@raven-worx Your example works. Do you have any Qt example that leverages Wifi or 4G to determine mobile phone location? Thanks
-
@vyau said in Getting location data from GPS in android and ios:
Do you have any Qt example that leverages Wifi or 4G to determine mobile phone location?
No, i am not aware of such feature in Qt yet.
(But this doesn't mean that it doesn't exists)