diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 7d7ec2e..245a82c 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index cb41453..d50bec8 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,7 +4,7 @@ diff --git a/.idea/misc.xml b/.idea/misc.xml index 59135fb..2925c96 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 93e4b17..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 94a25f7..9661ac7 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,6 @@ - - - - - + + + + + \ No newline at end of file diff --git a/README.md b/README.md index e52387c..9f4c6c6 100644 --- a/README.md +++ b/README.md @@ -1,70 +1,70 @@ - - - -# TVS Navigator -App to navigate Apache RTR using Google Maps notifications. -
-## About - -The official application offered by TVS has navigation features. Unfortunately the map being used is MapMyIndia. There are limitations of using MapMyIndia like not having enough locations tagged and choosing route depending on live traffic. -The app works by parsing the Google Maps notifications and creating the commands to be sent to the bike's console. -I used bt-snoop logs and unpacked the official app to reverse engineer the instruction set. -This is certainly not a replacement for official app offered by the manufacturer, there are many features missing which I may add in the future. -I like to create solutions to the problems I face in real life using code, the quality of the code may not be perfect but hey as long as it works :) - -## Features - -The app lets you: -- Send the Google Maps navigation directions to the bike's console -- Displays the remaining distance and ETA time information -- Displays information about people calling, also sends SMS to a contact with information like ETA and current location. - -## How It Works -The Google Maps notifications are read by the GMapsParser. -GMaps notification contains the direction as a bitmap, the direction is identified by comparing it with a repo of possible bitmaps (app\src\main\assets). - -#### TVS Apache RTR console instruction set -The instructions are encoded in hexadecimal. -Some sample instructions: -| Instruction | Hexadecimal | -| ------------- |:-------------:| -| 50M TURN RIGHT |4e01f40003015455524e20524947485424| -| REROUTING | 4e00000063015265726f7574696e6724 | - -Let's decode them: -| N/O | Distance | Unit | Pictogram/MessageId | Multiline Flag | Text Message | $ | -| --- | ------------- | ---- | ------------------- | -------------- | -------------------- | -- | -| 4e | 01 f4 (050.0) | 00 | 03 (03) | 01 | 5455524e205249474854 (TURN RIGHT) | 24 | -| 4e | 00 00 (000.0) | 00 | 63 (99) | 01 | 5265726f7574696e67 (REROUTING) | 24 | - -| Unit Values | Symbol | -| ----------- | ------ | -| 00 | M | -| 01 | KM | - -- Multiline flags are used for big instructions are which sent in two parts separated by 100ms. -- The pictogram id is a unique id for the images shown in the console. - -## Screenshots -[](/readme/screenshots/Screenshot_20210513-173948457.jpg) - -[](/readme/screenshots/Screenshot_20210513-173945084.jpg) - -## Permissions - -Requires the following permissions: -- Call logs - For displaying incoming call details. -- Contacts - For showing who's calling. -- Location - Used for BLE. -- Phone - For displaying incoming call details. -- SMS - For sending SMS to the contact in case of missed call. -- Notification Access - To read GMaps notifications. - -## Libraries Used -- [GMapsParser](https://github.com/3v1n0/GMapsParser) - used for reading Google Maps notification data + + + +# TVS Navigator +App to navigate Apache RTR using Google Maps notifications. +
+## About + +The official application offered by TVS has navigation features. Unfortunately the map being used is MapMyIndia. There are limitations of using MapMyIndia like not having enough locations tagged and choosing route depending on live traffic. +The app works by parsing the Google Maps notifications and creating the commands to be sent to the bike's console. +I used bt-snoop logs and unpacked the official app to reverse engineer the instruction set. +This is certainly not a replacement for official app offered by the manufacturer, there are many features missing which I may add in the future. +I like to create solutions to the problems I face in real life using code, the quality of the code may not be perfect but hey as long as it works :) + +## Features + +The app lets you: +- Send the Google Maps navigation directions to the bike's console +- Displays the remaining distance and ETA time information +- Displays information about people calling, also sends SMS to a contact with information like ETA and current location. + +## How It Works +The Google Maps notifications are read by the GMapsParser. +GMaps notification contains the direction as a bitmap, the direction is identified by comparing it with a repo of possible bitmaps (app\src\main\assets). + +#### TVS Apache RTR console instruction set +The instructions are encoded in hexadecimal. +Some sample instructions: +| Instruction | Hexadecimal | +| ------------- |:-------------:| +| 50M TURN RIGHT |4e01f40003015455524e20524947485424| +| REROUTING | 4e00000063015265726f7574696e6724 | + +Let's decode them: +| N/O | Distance | Unit | Pictogram/MessageId | Multiline Flag | Text Message | $ | +| --- | ------------- | ---- | ------------------- | -------------- | -------------------- | -- | +| 4e | 01 f4 (050.0) | 00 | 03 (03) | 01 | 5455524e205249474854 (TURN RIGHT) | 24 | +| 4e | 00 00 (000.0) | 00 | 63 (99) | 01 | 5265726f7574696e67 (REROUTING) | 24 | + +| Unit Values | Symbol | +| ----------- | ------ | +| 00 | M | +| 01 | KM | + +- Multiline flags are used for big instructions are which sent in two parts separated by 100ms. +- The pictogram id is a unique id for the images shown in the console. + +## Screenshots +[](/readme/screenshots/Screenshot_20210513-173948457.jpg) + +[](/readme/screenshots/Screenshot_20210513-173945084.jpg) + +## Permissions + +Requires the following permissions: +- Call logs - For displaying incoming call details. +- Contacts - For showing who's calling. +- Location - Used for BLE. +- Phone - For displaying incoming call details. +- SMS - For sending SMS to the contact in case of missed call. +- Notification Access - To read GMaps notifications. + +## Libraries Used +- [GMapsParser](https://github.com/3v1n0/GMapsParser) - used for reading Google Maps notification data - [blessed-android](https://github.com/weliem/blessed-android) - used for BLE communications \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_headlamp_logo_icon.xml b/app/src/main/res/drawable/ic_headlamp_logo_icon.xml index 43dc350..69c9f80 100644 --- a/app/src/main/res/drawable/ic_headlamp_logo_icon.xml +++ b/app/src/main/res/drawable/ic_headlamp_logo_icon.xml @@ -1,28 +1,28 @@ - - - - - + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml index 19137ed..a533751 100644 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -1,33 +1,33 @@ - - - - - - - + + + + + + + diff --git a/app/src/main/res/values/ic_launcher_background.xml b/app/src/main/res/values/ic_launcher_background.xml index ddcec82..748770c 100644 --- a/app/src/main/res/values/ic_launcher_background.xml +++ b/app/src/main/res/values/ic_launcher_background.xml @@ -1,4 +1,4 @@ - - - #1a1a1a + + + #1a1a1a \ No newline at end of file