Code Monkey home page Code Monkey logo

Comments (17)

Niklas04 avatar Niklas04 commented on June 15, 2024 1

Thank you.
I did a quick test and it seems to work :D

from garminuino.

skyforcetw avatar skyforcetw commented on June 15, 2024

Hi

I update version because add new function.
But I don't test it yet, so I would release apk after testing.

Lane detection is captured with screenshot every 2 seconds, so I cannot use complicated mechanism to detect.
I detect the green background of lane to locate the lane zone, and detect the white arrow to judge how many lanes here.

from garminuino.

skyforcetw avatar skyforcetw commented on June 15, 2024

Please enjoy it.

https://github.com/skyforcetw/Garminuino/releases/tag/0.4.4

from garminuino.

Niklas04 avatar Niklas04 commented on June 15, 2024

Lane detection is captured with screenshot every 2 seconds, so I cannot use complicated mechanism to detect.
I detect the green background of lane to locate the lane zone, and detect the white arrow to judge how many lanes here.

Nice idea!

Please enjoy it.

Thanks!

I've tested it a little bit, but unfortunately, no lane information had been displayed. Maybe it needs some more testing.

Furthermore, at the second run the app keeps crashing, but I don't have any idea why.
(In the first run I activated all switches (show speed, lane detect, show ETA, ...)

First scenario:
Bluetooth turned off. The app opens and shows the normal screen. Popup shows that app will be recording all activities. App crashed. In the background: Popup for activating bluetooth had been opened.
Terminal showed the following error code:
2019-08-14 21:32:56.019 27779-27779/? E/AndroidRuntime: FATAL EXCEPTION: main Process: sky4s.garminhud.app, PID: 27779 java.lang.RuntimeException: Error receiving broadcast Intent { act=sky4s.garminhud.app.MainActivity.RECEIVER flg=0x10 (has extras) } in sky4s.garminhud.app.MainActivity$MsgReceiver@26ea88b at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0(LoadedApk.java:1401) at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6718) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int app.akexorcist.bluetotohspp.library.BluetoothService.getState()' on a null object reference at app.akexorcist.bluetotohspp.library.BluetoothSPP.send(BluetoothSPP.java:280) at sky4s.garminhud.GarminHUD.SendPacket(GarminHUD.java:66) at sky4s.garminhud.GarminHUD.SendHud2(GarminHUD.java:118) at sky4s.garminhud.GarminHUD.SetDistance(GarminHUD.java:194) at sky4s.garminhud.hud.HUDAdapter.SetDistance(HUDAdapter.java:17) at sky4s.garminhud.app.MainActivity.setSpeed(MainActivity.java:237) at sky4s.garminhud.app.MainActivity.access$2400(MainActivity.java:86) at sky4s.garminhud.app.MainActivity$MsgReceiver.onReceive(MainActivity.java:1001) at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0(LoadedApk.java:1391) at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2)  at android.os.Handler.handleCallback(Handler.java:873)  at android.os.Handler.dispatchMessage(Handler.java:99)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:6718)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
I think the problem is somewhere in line 1001 of MainActivity.java

Second scenario:
Bluetooth activated. App tries to open but closes immediately.
Terminal shows the following error:
2019-08-14 21:44:47.178 29597-29597/? E/AndroidRuntime: FATAL EXCEPTION: main Process: sky4s.garminhud.app, PID: 29597 java.lang.RuntimeException: Unable to start activity ComponentInfo{sky4s.garminhud.app/sky4s.garminhud.app.MainActivity}: java.lang.IllegalArgumentException: GARMIN HUD is not a valid Bluetooth address at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2951) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6718) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.IllegalArgumentException: GARMIN HUD is not a valid Bluetooth address at android.bluetooth.BluetoothDevice.<init>(BluetoothDevice.java:769) at android.bluetooth.BluetoothAdapter.getRemoteDevice(BluetoothAdapter.java:647) at app.akexorcist.bluetotohspp.library.BluetoothSPP.connect(BluetoothSPP.java:239) at sky4s.garminhud.app.MainActivity.init_bt(MainActivity.java:302) at sky4s.garminhud.app.MainActivity.onCreate(MainActivity.java:343) at android.app.Activity.performCreate(Activity.java:7144) at android.app.Activity.performCreate(Activity.java:7135) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2931) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:6718)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
Thing error should be somewhere in line 301/302 in MainActivity.java .

Maybe you can fix these errors. I'm not anymore familiar with the whole code.

from garminuino.

skyforcetw avatar skyforcetw commented on June 15, 2024

Thanks for your comment.
I think I mess up the bluetooth connection.
I will test it more.

from garminuino.

zornhub avatar zornhub commented on June 15, 2024

Hello skyforcetw,

some days ago I've discovered your garminuino project. I am very happy that I can continue to use my Garmin HUD thanks to your software. Thank you very much for your effort and work.

Yesterday I've installed and tested version 4.4 on my cell phone (Android 8.0) and discovered two bugs:

  1. At the first run it works out-of-the box. The display of lane information worked without any problems - even over a longer distance (>100 km). However, the lane information displayed on the HUD is displayed inversely to the GoogleMaps app on the cell phone.
    For example, if GoogleMaps displays the right lane of three available lanes, the left lane will be displayed on the HUD. The behavior is reproducible with other lane combinations as well:
    GoogleMaps displays the left of four available lanes, the right lane is displayed on the HUD.
    GoogleMaps displays the middle of three available lanes, the middle lane is displayed on the HUD.

  2. At the second run the app crashed and keeps crashing. Turning Bluetooth on and off or dis- and reconnect the HUD has not changed anything. The app did not work or started until I cleared the apps cache as well as the apps memory to soft-reset the app (not reinstalled!).

I'll take a look at the source code at the weekend to contribute a little bit more than just a description of the error.

Best greetings!

from garminuino.

skyforcetw avatar skyforcetw commented on June 15, 2024

Hi zornhub :

  1. It looks like I forgot the HUD is mirror!

  2. I add bluetooth reconnect mechanism after 1st bt connection, but some bugs there.
    In other words the bug appear after 1st bt connection.
    I will remove the reconnect mechanism first.

Thanks for your contribution.
skyforce

from garminuino.

Niklas04 avatar Niklas04 commented on June 15, 2024

One question regarding to lane information:
Do you have the old or the new UI of Google Maps?

from garminuino.

skyforcetw avatar skyforcetw commented on June 15, 2024

Niklas04:

The app can recognize it .
There are some different in color between old & new google map ( I call it v1 & v2).

skyforce

from garminuino.

skyforcetw avatar skyforcetw commented on June 15, 2024

Is anyone want to try this release?
https://github.com/skyforcetw/Garminuino/releases/download/0.4.4/gmaps_hud-release_v0.4.4.apk

Because of I don't have time and no car to test except weekend.
I appreciate if someone can test it.

I fix:

  1. Lane arrow mirror problem
  2. Don't use new bt reconnect(bind address) mechanism in default. (There is a switch can turn on)

from garminuino.

Niklas04 avatar Niklas04 commented on June 15, 2024

The app can recognize it .
There are some different in color between old & new google map ( I call it v1 & v2).

Ok

Is anyone want to try this release?

I'd made a short test:
BT reconnect seems to work with and without bind address enabled

But if I disabled bluetooth after first run, the app crashed on the second run.
Same error as mentioned above.
I think you want to set speed in line 975 (MainActivity.java), but bluetooth is not enableed. So the app crashed.

One small thing I noticed: If I activate lane detection, a little cast-symbol will appear in the status bar. But if I close the app the symbol will not disappear.
Maybe the screencapture-service has to be stopped in onDestroy-function

Lane detection seems to still not work on my device.

from garminuino.

skyforcetw avatar skyforcetw commented on June 15, 2024

The app can recognize it .
There are some different in color between old & new google map ( I call it v1 & v2).

Ok

Is anyone want to try this release?

I'd made a short test:
BT reconnect seems to work with and without bind address enabled

But if I disabled bluetooth after first run, the app crashed on the second run.
Same error as mentioned above.
I think you want to set speed in line 975 (MainActivity.java), but bluetooth is not enableed. So the app crashed.

It's weird , is there no any dialog about bluetooth when you disable BT?
image

If you press deny, the app will terminated and show "Bluetooth was not enabled.
image

One small thing I mentioned: If I activate lane detection, a little cast-symbol will appear in the status bar. But if I close the app the symbol will not disappear.
Maybe the screencapture-service has to be stopped in onDestroy-function

Lane detection seems to still not work on my device.

Ok, I will stop screen capture service at onDestroy, what symbol are you see? Do you have any screenshot?

from garminuino.

Niklas04 avatar Niklas04 commented on June 15, 2024

It's weird , is there no any dialog about bluetooth when you disable BT?

Yes, there is, but before I can click allow the app had already crashed.
I think the MessageReceiver and the setSpeed-function had been executed before Bluetooth could be activated.

Ok, I will stop screen capture service at onDestroy, what symbol are you see? Do you have any screenshot?

Perfect! Yes, it's that symbol:
Cast-symbol

from garminuino.

skyforcetw avatar skyforcetw commented on June 15, 2024

It's weird , is there no any dialog about bluetooth when you disable BT?

Yes, there is, but before I can click allow the app had already crashed.
I think the MessageReceiver and the setSpeed-function had been executed before Bluetooth could be activated.

Yes, you are right, I add bluetooth checking before any BT operation to avoid same situation.

Ok, I will stop screen capture service at onDestroy, what symbol are you see? Do you have any screenshot?

Perfect! Yes, it's that symbol:
Cast-symbol

Got it.

from garminuino.

skyforcetw avatar skyforcetw commented on June 15, 2024

I update the version to v0.4.5.
And fix the bugs that we talk about in this thread.

https://github.com/skyforcetw/Garminuino/releases/download/0.4.5/gmaps_hud-release_v0.4.5.apk

from garminuino.

Niklas04 avatar Niklas04 commented on June 15, 2024

Thanks.
Yes now the Bluetooth connection seems to working fine.
Only autoconnect doesn't work, if Bluetooth hasn't be enabled before starting the app.
Stopping screen capture service with closing the app seems to work too.

Just downloaded the whole project and opened it in AndroidStudio.
Maybe that will helped you to get the lane detection to work:
image
Can't do anything with that, without work in the code.

This was the test case:

from garminuino.

skyforcetw avatar skyforcetw commented on June 15, 2024

Thanks.
Yes now the Bluetooth connection seems to working fine.
Only autoconnect doesn't work, if Bluetooth hasn't be enabled before starting the app.
Stopping screen capture service with closing the app seems to work too.

Just downloaded the whole project and opened it in AndroidStudio.
Maybe that will helped you to get the lane detection to work:
image
Can't do anything with that, without work in the code.

This was the test case:

Thanks for your information.
I think it is cons of using simple color detection to judge lane.
I release new version here:
https://github.com/skyforcetw/Garminuino/releases/download/0.4.6/gmaps_hud-release_v0.4.6.apk

from garminuino.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.