Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Bluetooth GNSS app on Google Play Store

License

NotificationsYou must be signed in to change notification settings

ykasidit/bluetooth_gnss

Repository files navigation

Connect your Android phone to external Bluetooth GPS, GLONASS, Galileo and BeiDou receivers and use the received location in your android phone via the mock location provider.

Official app is available on Google Play asBluetooth GNSS.

Build instructions

  • Install the theFlutter SDK as per official instructions including the 'Android setup' and make sure that the Android SDK is installed.

  • Make sure the flutter sdk version matches that in pubspec.yaml:

flutter downgrade v<flutter ver in pubspec.yaml>

  • In this folder run:flutter pub get

  • Install Rust - follow instructions in:https://rustup.rs/

  • Install flutter_rust_bridge: match that of flutter_rust_bridge in pubspec.yaml (replace 2.7.0 in below) - seehttps://cjycode.com/flutter_rust_bridge/quickstart)example:

rustup install 1.84rustup default 1.84cargo install flutter_rust_bridge_codegen --version 2.7.0
  • If you modify the rust code then update with:flutter_rust_bridge_codegen generateBut you might have to restoremain.dart after above command

You might need below if above faces issues:

flutter_rust_bridge_codegen integrate
storeFile=/path/to/keystore.jksstorePassword=*********keyAlias=bluetooth_gnsskeyPassword=**********
  • Connect an android phone with adb workingadb devices

  • Try build and run the app in debug mode:flutter runIf all went well, you would see the app now run in your connected phone.

  • Try build a release android installer (apk) file:flutter build apkIf all went well, it would create the apk file in the folder:build/app/outputs/flutter-apk/app-release.apk

  • Develop in Android studio:

    • Open android studio, and choose 'Projects' > 'Open' to this folder (or File > Open... menu) and you can edit the source code then run 'main.dart' from there. This is suitable for editing the dart files in the lib folder.
    • UI changes to main.dart can be seen immediately (hot-reload) on phone but function changes or java/engine part changes won't, you need to 'stop' then 'run' main.dart again for the changes to take effect.
    • Auto-completion of java code (in the android subfolder) and running of the java unit-tests won't work as this Android Studio is run in a 'flutter' project mode.
    • To edit the engine part and run the java unit tests, simply open the 'android' subfolder of this folder in a new Android Studio instance: File > Open ... choose: bluetooth_gnss > android. After Android Studio is ready, then you can try run some tests like browse on the left panel to libecodroidgnss_parse > java > (test) and right click on 'test_nmea_parse' > Run.
  • Use theflutter build apk command when you want to build a release apk file.

Initiate connection using external intent

I'm usingTasker to send the intent, but other methods are possible

Configure the task

On theTASKS tab, create a new task (e.g.Connect GPS) and add the actionSend Intent. It is configured as follows:

  • Action:bluetooth.CONNECT
  • Cat:Default
  • Mime Type:text/plain
  • Data:<empty>
  • Extra:<see json string below>
  • Package:com.clearevo.bluetooth_gnss
  • Class:<empty>
  • Target:Broadcast Receiver

json string in Extra field

Add this string without newlines. All values are optional. Note thatconfig is without double quotes

config: {    "bdaddr": "%bt_address",    "secure": false,    "reconnect": true,    "log_bt_rx": true,    "disable_ntrip": true,    "extra": {        "ntrip_user": "taskeruser",        "ntrip_mountpoint": "taskermount",        "ntrip_host": "taskerhost",        "ntrip_port": "2000",        "ntrip_pass": "taskerpass"    }}

Example

If you only want to override the bluetooth address, you can send this as extra:

config: {bdaddr:"%bt_address"}

If you don't use the BT Connection Event (see below) but the BT Connection state, you have to use the real address of your device:

config: {bdaddr: "00:11:22:33:44:55:66"}

If you want to disable ntrip as well:

config: {bdaddr: "00:11:22:33:44:55:66", disable_ntrip: true}

Configure the event

On thePROFILES tab, you can use a state change or a event. In this example, I'm using theBT Connection event with the following conditions:

  • %bt_connected EQ true
  • $bt_address EQ 00:11:22:33:44:55:66, the bluetooth address of the GPS receiver

This will trigger the event only when my GPS receiver is connected. You can add multiple devices here, which is why I choose this method: in the action, the variable%bt_address will be available as well and I'll use that to pass to Bluetooth GNSS.

Special thanks

  • Thanks to Geoffrey Peck from Australia for his tests, observations and suggestions.
  • Thanks to Peter Mousley from Australia for his expert advice, tests, code review, guidance and code contribution.
  • Thanks toAuric Goldfinger for his great contribution in developing the auto connect on boot feature and the detailed readme merged into above.
  • Thanks to everyone who provided comments/suggestions on thebluetooth_gnss project issues page on github.

Authors

Copyright and License

Copyright (C) 2019 Kasidit Yusuf and all respective project source code contributors.

This program is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation, either version 2 of the License, or(at your option) any later version.

This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.

You should have received a copy of the GNU General Public Licensealong with this program. If not, seehttps://www.gnu.org/licenses/.


[8]ページ先頭

©2009-2025 Movatter.jp