mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-15 14:51:14 -08:00
revisions
This commit is contained in:
parent
9699a0ce6f
commit
fd4a381717
3 changed files with 10 additions and 8 deletions
|
|
@ -6,18 +6,19 @@
|
|||
(defun ini ()
|
||||
#+android
|
||||
(qt:ini-positioning qt:*cpp*)
|
||||
#+ios
|
||||
(q> |active| ui:*position-source* t)
|
||||
#+mobile
|
||||
(progn
|
||||
(q> |active| ui:*position-source* t)
|
||||
(update-my-position)))
|
||||
(update-my-position))
|
||||
|
||||
#+mobile
|
||||
(defun update-my-position ()
|
||||
"Mobile only: update position from GPS of mobile device."
|
||||
(unless (getf *positions* (lora:my-num))
|
||||
(destructuring-bind (lat lon time)
|
||||
#+android
|
||||
(qt:last-position qt:*cpp*)
|
||||
#-android
|
||||
#+ios
|
||||
(qjs |lastPosition| ui:*position-source*)
|
||||
(if (zerop lat)
|
||||
(qsingle-shot 1000 'update-my-position)
|
||||
|
|
@ -29,6 +30,7 @@
|
|||
(set-position (lora:my-num) pos)
|
||||
(send-to-radio)))))) ; just once on startup (for now)
|
||||
|
||||
#+mobile
|
||||
(defun send-to-radio ()
|
||||
(if lora:*config-complete*
|
||||
(lora:send-position *my-position*)
|
||||
|
|
|
|||
1
examples/meshtastic/qt-location-hack/path.txt
Normal file
1
examples/meshtastic/qt-location-hack/path.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
~/Qt/5.15.2/android/src/android/java/src/org/qtproject/qt5/android/bindings/
|
||||
|
|
@ -8,18 +8,17 @@ Why
|
|||
This is needed on android because a mobile device which doesn't move only
|
||||
receives one (or maybe two) GPS updates before stopping the updates.
|
||||
|
||||
Since we have a long startup time with this app, we would completely lose
|
||||
Since we have a long startup time with this app, we would completely miss
|
||||
the first GPS updates using the convenient QML wrapper `PositionSource`,
|
||||
hence not being able to communicate our position to the radio device.
|
||||
|
||||
The only workaround seems to be to directly access the Java `Location`
|
||||
functions.
|
||||
The only workaround seems to directly access the Java `Location` functions.
|
||||
|
||||
|
||||
HowTo
|
||||
-----
|
||||
|
||||
Just copy `QtActivity.java` to path in `path.txt` (for Qt 5.15);
|
||||
alternatively apply patch `git.diff`.
|
||||
alternatively apply patch `diff.java`.
|
||||
|
||||
See also [cpp/qt.cpp](../cpp/qt.cpp).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue