Getting GPS coordinate in Qt 5 android application
-
From a Qt 5 perspective Qt Location is an unrelease library. I outlined the reasons why it has not been released in my previous post. It takes time to port to new platforms and this work is only just being started now.
If you look at the bug report I linked to you will see that the short term plan is to release Qt Location as part of Qt 5.2, for the platforms that Qt Location currently works on.
A mid to long term goal is to add iOS and Android support. There is no target Qt 5 release specified, but it is probably safe to assume this is post Qt 5.2.
Why do you need to give up porting your application. Qt does not prohibit you from using native APIs if a Qt API is not currently available.
-
I've planned to port my app "Softair":http://www.softairrealfight.net that use gps as important part of game.
I've already started port of that on android using Qt 5.1 and it sounds very good...it almost works with just some changes, but I need gps to use that....
I've seen the storyboard but, sincerily, I didn't catch why they didn't use necessitas QtLocation (ok that isn't so good, but it is a already done). -
You could use JNI (Java Native Intrface) to access the GPS, or any other native Android features which are not supported by Qt directly. This is not simple but it seems it works (I haven't tested yet, but I have to, for NFC).
See this link as an example : "QT in Android -- Example for accessing the GPS Service":http://www.qtcentre.org/threads/41698-QT-in-Android-Example-for-accessing-the-GPS-Service This is an example with Qt 4.x + Necessitas but I think you can easily adapt it for Qt 5You can also find good tutorials there "JNITurorial":https://code.google.com/p/awesomeguy/wiki/JNITutorial#Create_Android_Project
or from Google of course.Hope this helps
-
Ok thank you,
I had already seen this post, but I don't know, because I don't want to waste my time so much and then go back with official solution -
2014 Now and i see Qt 5.2.1 has QGeoPositionInfo and QGeoSatelliteInfo.. but checking sources on my Galaxy Note 2 i get no available sources ?
Is this suppose to work yet on Android using Qt 5.2.1 deploying to Devices?
D/Qt ( 5617): appmodel.cpp:77 (void AppModel::networkSessionOpened()): QGeoPositionInfoSource *Available Sources: () *
D/Qt ( 5617): appmodel.cpp:78 (void AppModel::networkSessionOpened()): QGeoSatelliteInfoSource *Available Sources: () * -
Sorry, please ignore my last post.. here is a topic about this
"here":http://qt-project.org/forums/viewthread/35845 -
I think we can expect the functional QtPositioning Class working in Qt 5.3
-
[quote author="jeffreyholmes" date="1393151238"]I think we can expect the functional QtPositioning Class working in Qt 5.3
http://qt-project.org/wiki/New-Features-in-Qt-5.3[/quote]
Thank you for your reminder of the new features of Qt5.3 , it's very helpful for me.I was also puzzled by QtPositioning, it doesn't work in My Android 4.4 and Windows 7.Sorry,I can't use English fluently,I just want to say thanks for you
-
I can't give my android app a icon,can you give me advice on how to set an icon for android?
my english more poor than you ^_^ -
I use "Eclipse" for setting an icon.And you can also add "ANDROID_PACKAGE_SOURCE_DIR" in the *.pro file,then create a folder and put "AndroidManifest.xml",it also can help to set icon.You can see Example:"Qt Notifier" in Qt. (^.^)
[quote author="xsjqqq123" date="1393515753"]I can't give my android app a icon,can you give me advice on how to set an icon for android?
my english more poor than you ^_^[/quote]