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

Search This thread

Ukiews

Member
Nov 25, 2022
10
0
Hi Thorsten, I found your app through your reply in other thread regarding fyt. I test it on teyes cc3, it works as you describe. I assign the 3rd party dvr app to steering switch long press. However I wonder if next version could be expanded to not only replace navi app/button but other button/function as well, or when assigned button press it will cycle to different apps. And one more thing I’m pretty sure I downloaded the latest version of your app but the app info still showing version 1.3 instead version 1.4. Thank you for the app.
Are you using CANBUS or key1 & key2 wires?
 

Ukiews

Member
Nov 25, 2022
10
0
Try SystemUI or look in headunit about settings and provide the MCU version here please for further disscution. On some units it's SystemUI, on others is MTCManager MTKManager HTC Manager and so on ...
The CC3 is based on the ums512 (aka uis7862) processor.
The MCU: 2022.06.25 10:26:23 TZY_53_L6315_G23P48F64_3G_E60_V:1.0R

After digging around in various settings (factory, developer, etc.) could not find anything. There is a steering wheel programming app, but only for KEY1-KEY2 setup, not CANBUS.
 

Ukiews

Member
Nov 25, 2022
10
0
I can identify the left and right buttons, and up down comes through (on a different filter), but nothing specific for the SOURCE button.
CC3 log.jpeg
 

tvladan

Senior Member
Oct 23, 2012
313
116
Timisoara

Ukiews

Member
Nov 25, 2022
10
0
Y

You can find the keycode (source) by using tasker and this plugin https://play.google.com/store/apps/details?id=com.joaomgcd.autoinput
Than search logcat for that keyid and maybe find the process that your need.
This is one way I would do it.
Are there any particular instructions for how the keycode would be captured.
When running the Autoinput on its own and try to capture the SOURCE button (Tasker is also installed), i get this:
Screenshot 2022-12-09 at 22.25.54.png

which is obviously not a keycode.
 

TorstenH

Senior Member
Feb 20, 2021
2,732
1,003
t.me
Realme GT 2 Pro
I can identify the left and right buttons, and up down comes through (on a different filter), but nothing specific for the SOURCE button.
View attachment 5780527
The second one from the bottom may be relevant. Check if the message always appears if you press the source/mode button and check how it looks when you press another button.

Using Google and searching for fythwonekey I found this which may be relevant:
But if you have questions to this app check if another thread is already present on XDA and continue discussion regarding Fythwonekey there or create a new thread.
 
Last edited:

Ukiews

Member
Nov 25, 2022
10
0
The second one from the bottom may be relevant. Check if the message always appears if you press the source/mode button and check how it looks when you press another button.

Using Google and searching for fythwonekey I found this which may be relevant:
But if you have questions to this app check if another thread is already present on XDA and continue discussion regarding Fythwonekey there or create a new thread.
I did have the FytHWOneKey installed at that moment of that capture. It does not work very effectively on the CC3. Was hoping to get AppSwitcher working instead. It's deleted for now, so I can identify the keycode.

Here are a couple more options that show up with AutoInput that might be relevant:

Screenshot 2022-12-10 at 16.29.33.png


But not sure what would be done with them.

After running Logcat again, and searching for "systemui," I see the "recent_apps" id that is triggered, but nothing in terms of an actual keycode:

Screenshot 2022-12-10 at 16.36.03.png
 

TorstenH

Senior Member
Feb 20, 2021
2,732
1,003
t.me
Realme GT 2 Pro
I attached new version 2.5alpha to first post:

This version can dim the screen according to sunrise 🌅 and sunset 🌇 information.
Click on the dialog (black area) to show the icon for this:
IMG_20221214_160016.jpg

By clicking multiple times on the icon you can set the current mode:
Sun: no screen dimming
Sun/moon: automatic switch based on sunset/sunrise
Moon: dim screen (allows to check if your setting "Screen brightness at dimming" was a good choice)
IMG_20221217_084444.jpg

Please be aware the app needs location permission to be able to calculate time of sunset/sunrise.

This version is explicitly marked as alpha and your test participation is very welcome.
 
Last edited:

TorstenH

Senior Member
Feb 20, 2021
2,732
1,003
t.me
Realme GT 2 Pro
I attached new version 2.5alpha to first post:

This version can dim the screen according to sunrise 🌅 and sunset 🌇 information.
Click on the dialog (black area) to show the icon for this:
View attachment 5785153

By clicking multiple times on the icon you can set the current mode:
Sun: no screen dimming
Sun/moon: automatic switch based on sunset/sunrise
Moon: dim screen (allows to check if your setting "Screen brightness at dimming" was a good choice)


Please be aware the app needs location permission to be able to calculate time of sunset/sunrise.

This version is explicitly marked as alpha and your test participation is very welcome.
In my first tests it worked like a charm. My display was dimmed this morning as expected.
I just deactivated the dimming function of Agama launcher and in the head unit settings.

Looking forward for your feedback...
 

TorstenH

Senior Member
Feb 20, 2021
2,732
1,003
t.me
Realme GT 2 Pro
Added AppSwitcher 2.5.1alpha

- Dimming gets paused if Google PlayStore is in foreground (see FAQ dimming)
- Added option to start media app twice. This may improve reliability of app autostart after head unit was in sleep mode. Especially DAB-Z sometimes stuck on splash screen so we can give it a second trigger, now. Let's test if it solves that issue...
 

TorstenH

Senior Member
Feb 20, 2021
2,732
1,003
t.me
Realme GT 2 Pro
Unfortunately DAB-Z still freezes on its splash screen. This happens if app gets started directly after sleep mode and even if I start it via Agama.
It's sufficient to switch to home screen and back to DAB-Z to get it running.

I'm the only one having this issue?
 

DarkTWH

Member
Sep 25, 2021
21
3
POCO X4 Pro
For me dab-z works fine. I've set it to open dab-z automatically on reboot in the USB device dialogue. However I've found one issue with the dimming. I've set up my unit so that it hides the controls bar / info center on the top of the screen. When I dim the screen the control center permanently appears. Is this fixable through the app or one of the great system bugs of junsun?
 

TorstenH

Senior Member
Feb 20, 2021
2,732
1,003
t.me
Realme GT 2 Pro
For me dab-z works fine. I've set it to open dab-z automatically on reboot in the USB device dialogue.
But this means it will always start as soon as the USB adapter gets detected. I just want to start the app if it's the last app I used before leaving the car.
However I've found one issue with the dimming. I've set up my unit so that it hides the controls bar / info center on the top of the screen. When I dim the screen the control center permanently appears. Is this fixable through the app or one of the great system bugs of junsun?
I think you're talking about the Android Status Bar?
Unfortunately Google doesn't allow overlaying the status bar by non-system apps. I think this is one of Googles security features. But it's interesting that an overlay let the status bar appear even if it's set to be hidden. Could you please create a screenshot/photo of the setting where you hided the status bar and let me know which head unit you have in use?
 

Mati102

New member
Dec 31, 2022
3
0
Hi,

I'm using version 2.5.1 with 8259 device + can box. I already used key 10 for short press. Generally app is really great but I have two problems. First auto start of media app doesn't working and sometimes something i happening with the app because is stopping working. In first moment I fot that's the app is crash but dimming working fine and icon was visible on status bar.
Interesting thing is the log cat doesn't see input from buttons, when I restart app everything is working fine.

Did anybody have similar problems?
 

Renate

Recognized Contributor / Inactive Recognized Dev
I saw this thread because I'm interested in app switching despite not having a head unit.
I just have a tablet, fixed, with a battery-ectomy and a wired 4V supply.
I love SWC. My ride is 1995 so I had to install my own.
It has no clockspring so I "steal" power off the horn to run a Bluetooth module.

If I read correctly, the screen brightness for this app is controlled using a translucent overlay?
And that this might make problems so?
- Dimming gets paused if Google PlayStore is in foreground (see FAQ dimming)

There's a couple of ways of doing this differently. You can:
Code:
$ settings put system screen_brightness 123
Code:
System.putInt(cr, System.SCREEN_BRIGHTNESS, bright);
You can also inject BRIGHTNESS_DOWN/BRIGHTNESS_UP KeyEvents although this is more blind and applicable to user controls more than automatic dimming.

I love my app switching. It's like you're switching video, the screens swap instantly (when you disable the animation).
 

Attachments

  • keypad1.jpg
    keypad1.jpg
    91.1 KB · Views: 5

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.