[Discontinued] AppSwitcher - smart SWC launcher (for Junsun, Xtrons and similar devices) incl. autostart

Search This thread

TorstenH

Senior Member
Feb 20, 2021
2,728
996
t.me
Realme GT 2 Pro
Hello, today I installed the program, I use it .. It's strange that the GPS button does not work the first time. Only from the second or even the third time. In principle, for 1 day of use, little can be said. We will continue to use, look. Thank you very much for the program. It's a pity there is no Russian language.
I would need further information to provide an answer. E.g. you could make a picture of the "About Screen" so I can see your device information.
And additionally a photo of your "Log listener" settings.
 

TorstenH

Senior Member
Feb 20, 2021
2,728
996
t.me
Realme GT 2 Pro
Does this override the default mode button behaviour on Xtrons?
No it doesn't overwrite a button. But especially if you have a dedicated button to start the navigation app or if you can assign a button to start the navigation app, it should work on Xtrons, too..

Another possibility is to bypass the CAN box for SWC (see next post). Unfortunately that's not possible for all cars.
 
Last edited:

TorstenH

Senior Member
Feb 20, 2021
2,728
996
t.me
Realme GT 2 Pro
idea.png
I supported a XDA user installing his Junsun head unit and checked the pinout of the original head unit.

His SWC is connected via a CAN box and the keys are mapped fixed to its functions. You know that the SWC learning function can't be used if a CAN box is in place.

But in his case it's easy possible to bypass the CAN box for SWC - without loosing the other CAN related features by connecting the marked wires to KEY1 and GND of the head unit, instead of the CAN box.
IMG_20230528_093111.jpg
The result is a working SWC study and the easy use of AppSwitcher via a key of his choice.
 
Last edited:
  • Like
Reactions: honda2015

h2official

Member
Apr 15, 2016
6
1
I managed to run the application on an AWESAFE PX9s (== Junsun V1 "pro" / MT 8667 8G Ram + 128Go rom - Alps FF_866x spm8667p1_64) in a 2009 Peugeot 308 MkI. The buttons are not reassignable with the "SWC" application, as they are connected via a G-PSA-RZ-51 CAN box (set to CAN Type = 127).

The buttons are not configurable, and the button I'm interested in switches the HU's modes (FM/Bluetooth etc..).

Edit: *Warning: this makes the built-in FM radio unusable! If you value radio, this won't work for you. Or you'll have to install an IP radio application.

First, I installed AppSwitcher according to the normal installation procedure.
Secondly, following TorstenH's advice, I tried to disable all the options in the system menu: 8888/"Menu Icon"*: to do this, you have to press twice on all the functions that appear on the right so that they move to the list on the left. Once done, press "SAVE".
After rebooting, the MODE button will no longer do anything.
Following TorstenH's advice, I installed and activated logcatreader with the nDealPkey filter by clicking on the magnifying glass. By clicking several times on the button I was looking for, I found that in my case the button of interest gave the value nDealPkey = = 10.
So I entered this value in the "short button press log entry" parameter of AppSwitcher's Log Listener menu, and voilà!

Now all you have to do is configure your favorite settings and applications! For the record, on this unit, the "Automate" autostart also works correctly.

There are, however, few bugs I've encountered:
- Sometimes, when switching to the launcher ("Lauwnchair" in my case), you have to press several times for the window to appear, but the "beep" is heard, and the keystroke is recorded in the logs. Other times, it works right on first attempt. In all other applications, it's fine.
- I installed the latest version and activated the "smart apps" in foreground, but it doesn't seem to work. The only apps that appear are the ones I configure (in my case: Spotify, Maps and the launcher). However, I didn't try to disable everything and leave just "smart apps". Edit: Not a bug, I had misunderstood how it worked.
- The equalizer (or the shortcut to it) doesn't appear in the window after activation and reboot. Edit: Not a bug, I had misunderstood how it worked.
- Sometimes, after saving and rebooting in a system menu (8888/8878), the default navigation engine is reset to "Maps", which then requires reapplication of "AppSwitcherStarter" in the navigation settings after reboot. This may be a default setting made by the mainapp when the parameters were saved. Edit: Not related to AppSwitcher

In any case, thanks again for the application!

For more information, here are the button "nDealPkey" values I've been able to identify for myself:
Mode = 10; Vol + = 19; Vol - = 20; next track = 44; prev track = 45
the button on the windshield washer control (a.k.a onboard display "show", the one that displays consumption information) : "cycle show" = 8
 
Last edited:

TorstenH

Senior Member
Feb 20, 2021
2,728
996
t.me
Realme GT 2 Pro
I managed to run the application on an AWESAFE PX9s (== Junsun V1 "pro" / MT 8667 8G Ram + 128Go rom - Alps FF_866x spm8667p1_64) in a 2009 Peugeot 308 MkI. The buttons are not reassignable with the "SWC" application, as they are connected via a G-PSA-RZ-51 CAN box (set to CAN Type = 127).

The buttons are not configurable, and the button I'm interested in switches the HU's modes (FM/Bluetooth etc..).

First, I installed AppSwitcher according to the normal installation procedure.
Secondly, following TorstenH's advice, I tried to disable all the options in the system menu: 8888/"Menu Icon": to do this, you have to press twice on all the functions that appear on the right so that they move to the list on the left. Once done, press "SAVE".
After rebooting, the MODE button will no longer do anything.
Following TorstenH's advice, I installed and activated logcatreader with the nDealPkey filter by clicking on the magnifying glass. By clicking several times on the button I was looking for, I found that in my case the button of interest gave the value nDealPkey = = 10.
So I entered this value in the "short button press log entry" parameter of AppSwitcher's Log Listener menu, and voilà!

Now all you have to do is configure your favorite settings and applications! For the record, on this unit, the "Automate" autostart also works correctly.

There are, however, few bugs I've encountered:
- Sometimes, when switching to the launcher ("Lauwnchair" in my case), you have to press several times for the window to appear, but the "beep" is heard, and the keystroke is recorded in the logs. Other times, it works right on first attempt. In all other applications, it's fine.
- I installed the latest version and activated the "smart apps" in foreground, but it doesn't seem to work. The only apps that appear are the ones I configure (in my case: Spotify, Maps and the launcher). However, I didn't try to disable everything and leave just "smart apps".
- The equalizer (or the shortcut to it) doesn't appear in the window after activation and reboot.
- Sometimes, after saving and rebooting in a system menu (8888/8878), the default navigation engine is reset to "Maps", which then requires reapplication of "AppSwitcherStarter" in the navigation settings after reboot. This may be a default setting made by the mainapp when the parameters were saved.

In any case, thanks again for the application!

For more information, here are the button "nDealPkey" values I've been able to identify for myself:
Mode = 10; Vol + = 19; Vol - = 20; next track = 44; prev track = 45
the button on the windshield washer control (a.k.a onboard display "show", the one that displays consumption information) : "cycle show" = 8
I will provide a detailed answer regarding your identified bugs later because in some cases it seems to be just a confusion how the options work...
 
  • Like
Reactions: h2official

TorstenH

Senior Member
Feb 20, 2021
2,728
996
t.me
Realme GT 2 Pro
I managed to run the application on an AWESAFE PX9s (== Junsun V1 "pro" / MT 8667 8G Ram + 128Go rom - Alps FF_866x spm8667p1_64) in a 2009 Peugeot 308 MkI. The buttons are not reassignable with the "SWC" application, as they are connected via a G-PSA-RZ-51 CAN box (set to CAN Type = 127).

The buttons are not configurable, and the button I'm interested in switches the HU's modes (FM/Bluetooth etc..).
You may check the pinout of your original radio. I think the chances are high that only a resistance matrix is connected directly to the head unit.

First, I installed AppSwitcher according to the normal installation procedure.
Secondly, following TorstenH's advice, I tried to disable all the options in the system menu: 8888/"Menu Icon": to do this, you have to press twice on all the functions that appear on the right so that they move to the list on the left. Once done, press "SAVE".
After rebooting, the MODE button will no longer do anything.
This is a possibility but I expect the radio app isn't working, now.

Following TorstenH's advice, I installed and activated logcatreader with the nDealPkey filter by clicking on the magnifying glass. By clicking several times on the button I was looking for, I found that in my case the button of interest gave the value nDealPkey = = 10.
So I entered this value in the "short button press log entry" parameter of AppSwitcher's Log Listener menu, and voilà!

Now all you have to do is configure your favorite settings and applications! For the record, on this unit, the "Automate" autostart also works correctly.

There are, however, few bugs I've encountered:
- Sometimes, when switching to the launcher ("Lauwnchair" in my case), you have to press several times for the window to appear, but the "beep" is heard, and the keystroke is recorded in the logs. Other times, it works right on first attempt. In all other applications, it's fine.
That would require further investigation by checking the Android log. Unfortunately I only tested with Agama, the stock launcher and on my phone without issues.

- I installed the latest version and activated the "smart apps" in foreground, but it doesn't seem to work. The only apps that appear are the ones I configure (in my case: Spotify, Maps and the launcher).
"Smart List" is not intended to enhance this list of selected media and navigation apps automatically. I want to avoid to collect all recently ran apps because AppSwitcher would offer apps which makes no sense to run while driving. E.g. the Android settings app.
However, I didn't try to disable everything and leave just "smart apps".
"Smart List" will offer the most recently run media/navigation app first (they need to be selected). And it will suppress the app which is currently in foreground.
The idea is to be able to switch between media app and navigation app by one key press.
- The equalizer (or the shortcut to it) doesn't appear in the window after activation and reboot.
It will be only offered when you touch on the header of the dialog or when you swipe over the app list.
I want to avoid people playing around with the equalizer while driving.
- Sometimes, after saving and rebooting in a system menu (8888/8878), the default navigation engine is reset to "Maps", which then requires reapplication of "AppSwitcherStarter" in the navigation settings after reboot. This may be a default setting made by the mainapp when the parameters were saved.
Please check if you activated the setting "Disable navi start activity". Please disable it.
In any case, thanks again for the application!

For more information, here are the button "nDealPkey" values I've been able to identify for myself:
Mode = 10; Vol + = 19; Vol - = 20; next track = 44; prev track = 45
Thanks for this very helpful information for 8667 units.
the button on the windshield washer control (a.k.a onboard display "show", the one that displays consumption information) : "cycle show" = 8
This is a special key of your car?
 

h2official

Member
Apr 15, 2016
6
1
You may check the pinout of your original radio. I think the chances are high that only a resistance matrix is connected directly to the head unit.
Unfortunately I don't see any "free" threads like in your previous post, only audio related and CanBus L/H. Concerning the resistance matrix, I don't think it's that on my car, as the HU receives information on consumption, outside temperature, lights state, etc...

This is a possibility but I expect the radio app isn't working, now.
I can confirm that the application starts up and closes a few seconds later without making the slightest sound.
I don't use the radio, so it's fine for me, but I'll look into alternative applications... For those who don't need "real-time" radio and have a permanent connection, you can use IP radios.

That would require further investigation by checking the Android log. Unfortunately I only tested with Agama, the stock launcher and on my phone without issues.
I didn't manage to do it again today, I'll keep an eye on it after a reboot.

"Smart List" is not intended to enhance this list of selected media and navigation apps automatically. I want to avoid to collect all recently ran apps because AppSwitcher would offer apps which makes no sense to run while driving. E.g. the Android settings app.
"Smart List" will offer the most recently run media/navigation app first (they need to be selected). And it will suppress the app which is currently in foreground.
The idea is to be able to switch between media app and navigation app by one key press.
Thanks for the explanations, this time I actually took the time to read the description... 😓 And it's clear! Sorry about that! So it works correctly.

It will be only offered when you touch on the header of the dialog or when you swipe over the app list.
I want to avoid people playing around with the equalizer while driving.
Oh right, I was expecting to see a button. I forgot to look, I'll try again later.

Please check if you activated the setting "Disable navi start activity". Please disable it.
It is properly deactivated

This is a special key of your car?
I don't think it's anything special. At least all Peugeot models with a central display screen should probably have this button, as it's what allows you to cycle between displays of fuel consumption, estimated remaining distance and so on. I attach an image.
 

Attachments

  • peugeot_RD4_pineout.png
    peugeot_RD4_pineout.png
    112 KB · Views: 41
  • peugeot_radio_can-commands.png
    peugeot_radio_can-commands.png
    2.1 MB · Views: 39

ser_hero

Member
Jan 23, 2023
21
3
Attached AppSwitcher version 2.7.5 to first post

Fixed bugs:
- AppSwitcher detected itself as current foreground app and suggests all apps including the one which is behind the AppSwitcher dialog
Hi, TorstenH!

I think, this version resolved my issue with switching apps just after exiting sleep mode on 8667. Now it works amazing, thank you.
 
  • Like
Reactions: TorstenH

TorstenH

Senior Member
Feb 20, 2021
2,728
996
t.me
Realme GT 2 Pro
- Sometimes, after saving and rebooting in a system menu (8888/8878), the default navigation engine is reset to "Maps", which then requires reapplication of "AppSwitcherStarter" in the navigation settings after reboot. This may be a default setting made by the mainapp when the parameters were saved.
This is a weird behavior of the head units. Changing the factory settings will reset some settings like:
- navigation gets set to default (Maps)
- reset of equalizer settings
- clear radio stations
- ... maybe more.

This is not related to AppSwitcher and other navigation apps getting replaced by Google Maps, too. You can remove it from your bug 🐛 list. :)
 
  • Like
Reactions: h2official

h2official

Member
Apr 15, 2016
6
1
That would require further investigation by checking the Android log. Unfortunately I only tested with Agama, the stock launcher and on my phone without issues.
For the record, I can now reproduce "the bug" effectively, I think it's more of a slowdown really. If I get to the launcher via AppSwitcher, everything happens normally, but if I get there by pressing the "home" button on the touchscreen, then the beep happens instantly but the window arrives between 3 and 5 seconds later. I've read a bit about "DuraSpeed", maybe that's the cause of the slowdown, can I safely disable it in AppSwitcher on an 8667?

It will be only offered when you touch on the header of the dialog or when you swipe over the app list.
I want to avoid people playing around with the equalizer while driving.
Oh, I see! It's pretty cool, it's like a james bond secret menu! 😎
It would be cool to have a reboot option in there too !
Just to tease, if it's already "hidden" why do you have to activate an option to display it? 😁

I try to find a fearless knight to elaborate custom SWC function with CAN box in place...

Post in thread 'Junsun V1 - Codes' https://xdaforums.com/t/junsun-v1-codes.4282299/post-88598875
Any chance of it also working on the 8667?
 

TorstenH

Senior Member
Feb 20, 2021
2,728
996
t.me
Realme GT 2 Pro
For the record, I can now reproduce "the bug" effectively, I think it's more of a slowdown really. If I get to the launcher via AppSwitcher, everything happens normally, but if I get there by pressing the "home" button on the touchscreen, then the beep happens instantly but the window arrives between 3 and 5 seconds later. I've read a bit about "DuraSpeed", maybe that's the cause of the slowdown, can I safely disable it in AppSwitcher on an 8667?
That's strange because that means different things happen depending on how you return to launcher.

Yes, you can change the Duraspeed setting but I'm not sure if changing the property will survive a reboot. Just give it a try.

Oh, I see! It's pretty cool, it's like a james bond secret menu! 😎
It would be cool to have a reboot option in there too !
Good idea. I always used the Reboot.apk from here
https://xdaforums.com/t/junsun-v1-start-equalizer-aux-bt-music-carinfo-from-launcher.4237797/

Just to tease, if it's already "hidden" why do you have to activate an option to display it? 😁

I know at least one Xtrons user and I'm not sure if the equalizer can be started in the same way. Nevertheless I wanted to provide the option to hide it completely in case it's not working on a "exotic" head unit.
Any chance of it also working on the 8667?

Sure. But it may force you to perform a re-installation of the firmware if somethings goes wrong in a first attempt. And some testing support from your side would be required.
 
  • Like
Reactions: h2official

Top Liked Posts

  • There are no posts matching your filters.
  • 9

    AppSwitcher

    SWC (Steering Wheel Control) app launcher

    This thread gets continued here

    ic_launcher_adaptive_fore.png

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


    61e11e22d8ff4a5b4a1b3346_Supportbutton-1.png
    Support the development of this free app via
    ko-fi.com/appswitcher


    Please note: This app is developed and tested only on Junsun V1 Pro with MTK825X AND MT8667 CPU. You can test on other devices and let me know if it works...
    One user reported usage on Xtrons unit - so give it a try.




    User Interface:

    IMG_20230218_103534.jpg

    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)
    - automatic screen dimming based on sunset / sunrise information
    - allows to start the (Junsun) equalizer app
    - Supports Mtk8257 and 8667 devices. Thank you @Jetblack31 for your testing engagement on 8667.


    Feedback on the web
    Unfortunately the author only picks up one specific aspect of the app.
    IMG_20230401_193710.jpg

    Testers are welcome! I need YOUR help and your feedback. Don't be a stranger!

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

    FAQ
    https://xdaforums.com/t/appswitcher...sun-and-similar-devices.4435555/post-86825555
    3
    Added version 2.6.14alpha which is the most stable version so far.

    Thanks to @Jetblack31 for his testing engagement

    Even the version is not final, I removed all previous versions on first post because they may lead to a bootloop on 8667 devices.

    As always: please provide your feedback. Not only but also in case of issues. Friendy user feedback is my motivation to continue this project...
    3
    Attached AppSwitcher version 2.7 to first post...


    Whats new:
    - new setting "Screen\Landscape overlay" which forces all apps to run in landscape orientation. This fixes the appearance issue of Spotify (and other apps like Tidal and Apcoa Flow) after disabling "Screen\Forced fullscreen system property".
    - "Apps and activities\Set media apps/activities" offers all exported activities, now. This allows to start a specific screen of your app.
    - optimized switch dialog performance and countdown sync.
    - adjusted color of settings button
    - optimized app starts (actively by user and after countdown)
    - "Dialog\Grayscale app icons" is enabled by default (after fresh installation)
    - run of media app gets skipped if SWC button gets pressed. Only relevant if "Autostart\Delay (seconds) before start of media app" is set.
    - click on AppSwitcher status bar notification opens settings screen
    - code cleansing and other code optimizations/simplifications

    Fixed bugs:
    - App crashes when settings are changed after service is stopped
    - Dialog does not disappear when user clicks on settings button
    - set delay of media activity freezes app start
    2

    idea.png

    FAQ


    Why is the starter a separate apk?
    Junsun head units check if the navigation app package is already in foreground. If that's the case home screen gets displayed. If we set 'AppSwitcher' as navigation app it would not stay in foreground. Here the relevant coding of MainUI:
    IMG_20220429_164055.jpg

    What does the different log listener log entries mean?
    AppSwitcher is listening to different log messages of the Android system log. We need not the enter the whole message, a substring is sufficient. But we need to consider spaces.
    - Short button press log entry
    The most important log entry. If this gets recognized the AppSwitcher dialog gets opened or the next app to start gets highlighted.
    On some head units we can use the message which gets written after we release the SWC key after a short period of time.
    - On button press log entry
    This message will only stop the countdown and AppSwitcher is waiting for the next configured log entry.
    Usually we configure a log message which gets written as soon as we push down the SWC key.
    - Long button press log entry
    AppSwitcher will return to home screen or close (cancel) the dialog.
    If possible we configure a message which gets written when we release the SWC key after a long period of time.

    What is DuraSpeed?
    DuraSpeed is a proprietary tool from MediaTek restricting and closing(!) background apps and services to free memory and so to make it available for starting apps.
    AppSwitcher can set the properties to turn DuraSpeed off in case you're struggling with closed services / apps and want to give back control to Android.


    AppSwitcher dialog isn't shown
    On some head units you have to provide permissions manually. According to my experience on a Junsun V1 pro (with MTK8259/MTK8257 CPU) the authorizations granted automatically.
    1. Ensure that the AppSwitcher service is running. We should see the AppSwitcher icon on top of the status bar and a notification in the status bar.
    2. Check if AppSwitcher has permission to appear on top of other apps. You can provide the authorization in "application settings".
    3. On some head units AppSwitcher doesn't get authorization to read the Android log. In this case you have to grant authorization via ADB:
    Code:
     adb shell pm grant com.thf.AppSwitcher android.permission.READ_LOGS

    How display dimming works
    Screen dimming is realized by "painting" a semi-transparent overlay on top of the screen because we don't have the possibility to access display brightness on system level.
    Some apps don't like to get overlayed and so Google PlayStore shows a warning message. AppSwitcher is pausing the overlay if Google PlayStore is the app in foreground.
    If you're using an app which doesn't work well whiles it's overlayed, let me know.

    What is Automate?
    Automate is a powerful alternative to Tasker...
    ...which allows to execute tasks, start apps, change settings, change connectivity (wifi, hotspot, Bluetooth,...) and much more.
    Unfortunately our head units are killing the Automate service during sleep and not enabling it after reboot.
    AppSwitcher can re-enable the Automate service and trigger an Automate flow.