AppSwitcher - smart SWC launcher (for Junsun and similar devices) incl. autostart

Search This thread

demolite

Member
Aug 8, 2022
31
11
I meantime it tested it on my hu and it works. Good to hear it's running on your device, too.

But maybe the static list is to static. Should the current item + 1 be selected based on the current background app? On the other side it's less muscle memory and you don't know how often to press the button? I will wait for your feedback because I still don't like the static list. 🤣

The fullscreen option for the dialog will be removed because it's not looking nice to see the current foreground app changing size. Pain in my eyes.
I'll test for a few days, but how it now is seems good for me.
 
  • Like
Reactions: TorstenH

ramig

Senior Member
Jun 12, 2007
89
14
Thanks for the hard work.
v2.0b here and Smart List option is on.
The last média do not open after start de Head Unit. Install/ unistall not solve the issue
With 1.9 it's all right. :)
 

TorstenH

Senior Member
Feb 20, 2021
776
176
Thanks for the hard work.
v2.0b here and Smart List option is on.
The last média do not open after start de Head Unit. Install/ unistall not solve the issue
With 1.9 it's all right. :)
Don't worry. Missing start of media app is a bug and will be fixed with 2.1. No action from your side required.
 
  • Like
Reactions: ramig

demolite

Member
Aug 8, 2022
31
11
I've now used the static list for a few days and can say that it's great! I figured what was causing the "stuck on first item". If in settings "Disable navi start activity" is active, strange things happen (list stuck on first item, volume goes lower????, list might eventually get stuck on second item with the countdown timer stopped). If the setting is inactive it works fine.

I was thinking is it possible to cancel the list selection with a long press during switching through the list?
 

TorstenH

Senior Member
Feb 20, 2021
776
176
I've now used the static list for a few days and can say that it's great! I figured what was causing the "stuck on first item". If in settings "Disable navi start activity" is active, strange things happen (list stuck on first item, volume goes lower????, list might eventually get stuck on second item with the countdown timer stopped). If the setting is inactive it works fine.
The setting disables the activity com.ts.main.navi.NaviMainActivity which is part of MainUI (package com.ts.MainUI). I never had such side effects you're describing here. You have the same problems with dynamic / smart list? Your screen may flicker if you disable the option, isn't it?
I was thinking is it possible to cancel the list selection with a long press during switching through the list?
Yes. Based on the log entry set as 'long button press log entry'. If the event gets detected while the dialog isn't visible the home screen will be shown.
 
Last edited:

TorstenH

Senior Member
Feb 20, 2021
776
176
Added new version 2.1.

Smart list can be disabled if you prefer to use a static list. Delay before media app gets started can be set.

Includes some bug fixed which wasn't included in <= 2.0b.

Please clear app data or uninstall previous version if you use <= 1.9. Sorry!
 

demolite

Member
Aug 8, 2022
31
11
The setting disables the activity com.ts.main.navi.NaviMainActivity which is part of MainUI (package com.ts.MainUI). I never had such side effects you're describing here. You have the same problems with dynamic / smart list? Your screen may flicker if you disable the option, isn't it?
I will have to test on smart list, but I would think so... No flicker is noticeable with the option on or off. Only when the option is on the list doesn't work and strange things happen.

Yes. Based on the log entry set as 'long button press log entry'. If the event gets detected while the dialog isn't visible the home screen will be shown.

Yes I have been using this, but I mean if I press lets say 2 times short but then decide I want to stay on current app, I would hold the button to cancel the list before the time runs out. So the list wouldn't open the item if the button is being pressed down, and if pressed for the "long" duration it would just close the list. This would be just a convenience, it's not worth it if it's hard to implement.
 

TorstenH

Senior Member
Feb 20, 2021
776
176
I will have to test on smart list, but I would think so... No flicker is noticeable with the option on or off. Only when the option is on the list doesn't work and strange things happen.
Okay. But then no action for us. :)
Yes I have been using this, but I mean if I press lets say 2 times short but then decide I want to stay on current app, I would hold the button to cancel the list before the time runs out. So the list wouldn't open the item if the button is being pressed down, and if pressed for the "long" duration it would just close the list. This would be just a convenience, it's not worth it if it's hard to implement.
That's exactly how it works. If you pressed the SWC button one or multiple times by accident you can cancel the dialog with a long press.
You can use logcat reader app to check if you can find
1. The log entry for "on button press log entry" (nDealPkey = = 829)
2. The log entry for "long button press log entry" (nDealPkey = = 831)
in the Android log
after you performed a long click on SWC.

For testing purposes you could also select a longer time period before app gets started (option "dialog delay (seconds)")

1. Is the log entry which occurs as soon as you're pressing the key down. The log entry is used to stop the time / countdown.
2. Is the log entry which indicates that the button was released after holding it down long. Is used to cancel.
 

demolite

Member
Aug 8, 2022
31
11
Okay. But then no action for us. :)

That's exactly how it works. If you pressed the SWC button one or multiple times by accident you can cancel the dialog with a long press.
You can use logcat reader app to check if you can find
1. The log entry for "on button press log entry" (nDealPkey = = 829)
2. The log entry for "long button press log entry" (nDealPkey = = 831)
in the Android log
after you performed a long click on SWC.

For testing purposes you could also select a longer time period before app gets started (option "dialog delay (seconds)")

1. Is the log entry which occurs as soon as you're pressing the key down. The log entry is used to stop the time / countdown.
2. Is the log entry which indicates that the button was released after holding it down long. Is used to cancel.
Yes, no need to do anything for the setting.


Yes I have the log entries set and the long press works.

Maybe I have the dialog delay too short at 1 second, because it opens the list item even if I have the button down to cancel.
 

TorstenH

Senior Member
Feb 20, 2021
776
176
Yes, no need to do anything for the setting.


Yes I have the log entries set and the long press works.

Maybe I have the dialog delay too short at 1 second, because it opens the list item even if I have the button down to cancel.
Possible. The 'set' log entry has to be available fast enough and you could check with logcat reader the time between nDealPkey = = 830 and subsequent 829.
MainUI will need a short amount of time to compute and log the events.
 

demolite

Member
Aug 8, 2022
31
11
Possible. The 'set' log entry has to be available fast enough and you could check with logcat reader the time between nDealPkey = = 830 and subsequent 829.
MainUI will need a short amount of time to compute and log the events.
This was it, if the time is greater than 1 second it works fine. No issues otherwise, I'm really happy with the static list, a big thanks for implementing it!
 
  • Like
Reactions: TorstenH

TorstenH

Senior Member
Feb 20, 2021
776
176
This was it, if the time is greater than 1 second it works fine. No issues otherwise, I'm really happy with the static list, a big thanks for implementing it!
Here I list the log entries for TAG 'AppSwitcherService'. Problematic could be if 1 has no successor.

1.
"send onPress broadcast - short or long press will follow"
Log entry indicating the push down of the SWC button. Timer will be stopped if dialog is visible. No action if dialog is not shown.

2.
"start dialog"
Log entry indicating the release of the button after a short amount of time. AppSwitcher dialog currently not visible. First item will be selected. Timer will start.

3.
"send broadcast to dialog"
Log entry indicating the release of the button after a short amount of time. AppSwitcher dialog is already visible. Next item will be selected. Timer will be resetted and start again.

4.
"send broadcast to close to dialog"
Log entry indicating the release of the button after a long period of time. AppSwitcher dialog is already visible. Dialog will be closed without action.
 
  • Like
Reactions: demolite

cabraspower

Member
Nov 14, 2013
7
2
Hi, thanks for your work!
I have a junsun v1 (similar) with canbus box, so I cannot remap swc to navigator app.
Is there any way to make to work your app?
Thanks in advance.
 

TorstenH

Senior Member
Feb 20, 2021
776
176
Hi, thanks for your work!
I have a junsun v1 (similar) with canbus box, so I cannot remap swc to navigator app.
Is there any way to make to work your app?
Thanks in advance.
Which functions are currently predefined on your steering wheel keys (volume (+/-), next/previous track, ...)?
 

cabraspower

Member
Nov 14, 2013
7
2
Which functions are currently predefined on your steering wheel keys (volume (+/-), next/previous track, ...)?
lgEdC.jpeg

Volume +/- Phone, assistant, next and previous, and the other two that changes the media. Everything works ok with their original functions.

thanks for replying ☺️
 
  • Like
Reactions: TorstenH

TorstenH

Senior Member
Feb 20, 2021
776
176
View attachment 5694453
Volume +/- Phone, assistant, next and previous, and the other two that changes the media. Everything works ok with their original functions.

thanks for replying ☺️
You're welcome.

Please install logcat reader from Google PlayStore and let me know if you can find log entries (e.g. for the media button):

You can filter on TAG "MainUI" and should be able to find entries like "nDealPkey = = xxx" whereby xxx is a three digit number.

This will help me to find the relevant coding part in MainUI and to identify if we have a chance to overwrite the standard functionality. Unfortunately I can't do that by myself because I don't have canbus.
 

cabraspower

Member
Nov 14, 2013
7
2
You're welcome.

Please install logcat reader from Google PlayStore and let me know if you can find log entries (e.g. for the media button):

You can filter on TAG "MainUI" and should be able to find entries like "nDealPkey = = xxx" whereby xxx is a three digit number.

This will help me to find the relevant coding part in MainUI and to identify if we have a chance to overwrite the standard functionality. Unfortunately I can't do that by myself because I don't have canbus.
Ok thanks a lot. Tomorrow will try,
 
  • Like
Reactions: TorstenH

cabraspower

Member
Nov 14, 2013
7
2
Hi the
You're welcome.

Please install logcat reader from Google PlayStore and let me know if you can find log entries (e.g. for the media button):

You can filter on TAG "MainUI" and should be able to find entries like "nDealPkey = = xxx" whereby xxx is a three digit number.

This will help me to find the relevant coding part in MainUI and to identify if we have a chance to overwrite the standard functionality. Unfortunately I can't do that by myself because I don't have canbus.
Hi the key that appear each time I press the "mode" button is == 10
If I configure this number in the AppSwitcher nothing happens.
Thx
 

Attachments

  • Screenshot_20220824-173423_Gallery.jpg
    Screenshot_20220824-173423_Gallery.jpg
    221 KB · Views: 12

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Hi,
    I've logged the SWC. So regarding the previous posts, it should work fine. I'll keep you posted !
    Jetblack
    IMG_7545.jpg


    By the way, it seems I don't have "long press feature" through the canbus decoder. So I will set another key for the long press. That's not an issue, there are so many keys on Renault SWC !
    TorstenH, thank you so much for your amazing and brilliant software development!
    1
    Thank you for your help. For the moment I have a problem. It does not work. I set AppSwitcher like in the picture but with no results. When I press the mode key (key 10), the HU keeps its native behavior, i.e. changing the source.

    View attachment 5709251

    Some notes :
    I had to enable READ LOGS for logcat to run properly, perhaps AppSwitcher is not granted with enough permissions to read the logs ?
    When I set AppSwitcherStarter as NAVI app, each time I reboot the HU, the NAVI app goes back to Maps. So I put AppSwitcherStarter as an autorun app in AGAMA car launcher.
    Thank you very much for you help !
    Jetblack

    EDIT : for long press, I have no supplementary log for "CanNative". For some keys, like vol+ vol-, if I long press then the message ky pressed is repeated each second.
    You could try to grant the permission. On my Junsun V1pro that was not needed wherby one user already mentioned that he had to grant the permission.

    Unfortunately then the head unit doesn't provide the long press information and for AppSwitcher we don't have a trigger.
    1
    I'm new in Android, could you give me the command line to grant the proper permission to AppSwitcher ?
    Many thanks!
    Should work similar to Logcat Reader:

    Code:
    adb shell pm grant com.thf.AppSwitcher android.permission.READ_LOGS
    1
    Should work similar to Logcat Reader:

    Code:
    adb shell pm grant com.thf.AppSwitcher android.permission.READ_LOGS
    Thanks ! I try now !
    1
    You could try with another navigation software from Google PlayStore to check if it's a specific problem with AppSwitcherStarter on your device.

    Please be aware that USB storage devices can prevent the head unit from saving settings. And as soon as you change factory settings (8888 / 8878) the navigation app will be changed back to Maps automatically which is imho a bug.
    Thank you very much, I will try what you suggest in your 2 messages and I keep you posted !
  • 3
    AppSwitcher - SWC (Steering Wheel Control) app launcher.

    Stay focused on the street and don't touch the head units display to switch between apps.


    UI:
    IMG_20220623_095831.jpg

    Video of 1st alpha version:


    Covered features:
    - allow to select an app to start without the need to jump from app to app.
    - one button press to switch between last used navigation app and last used media app.
    - support usage of multiple navigation apps.
    - works with pre-installed apps like Radio and apps added by the user.
    - start the last used media app automatically.
    - long button press to cancel (if dialog is shown) or to jump to home screen.
    - reactivate accessibility service of Automate and start initial Automate Flow
    - enable/disable DuraSpeed
    - change system property to make Android status bar visible (work as on other Android devices)

    Open:
    - May not work on devices with canbus.

    Testers are welcome! I need YOUR help to make it work on head units connected to canbus.

    Please install both apps because 'AppSwitcher Starter' is just used to start the App Switcher Service. Find installation instruction in 3rd post.

    FAQ

    2
    @demolite @Apk07

    Started to implement that static list feature. Because I have to change a lot of classes I hope you will provide your test feedback.

    IMG_20220816_154012.jpgIMG_20220816_153937.jpg
    2
    Didn't see this mentioned; if someone has problems setting this up on Junsun V1 Pro w/ canbus, I had to give AppSwitcher permission to "READ_LOGS" with ADB. Now works great!
    2
    2.0a --> 2.0b
    Start of AppSwitcher Service wasn't possible if app data was cleared.
    2
    Added version 1.4.
    Only minor changes but the UI bug was too painful for my eyes. (-: