AppSwitcher - smart SWC launcher (for Junsun 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
307
110
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
1,191
312
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
1,191
312
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
1,191
312
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
1,191
312
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
1,191
312
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
18
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
1,191
312
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
1
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: 2

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    How i can set a filter in logcat to get only a log of pressed buttons on my steering wheel?
    You could restrict the logs via the filter function inside the ... menu.
    IMG_20230118_135240_499.jpg

    After that you can filter on the main screen for keywords come into your mind. E.g. key, button,...

    Are you using a can box?
    1
    Hi Torsten,

    before I was with version 2.1.
    Ok, so I'll log the "fatal" messages and keep you informed.
    Thank you very much,
    Bernard
    1
    Hello thanks for the apk I will try on my Junsun 8259
    1
    What I just don´t understand is. With the PX3, 5, 6 it is also possible to change and assign the buttons, even a long press. Why doesn't that work with ours!?
    Because in the Junsun you just can remap the button if you don't use canbus and SWC is connected as resistance matrix to the head unit directly. The translation of can bus signal is hard coded.
    1
    Hi Torsten,

    before I was with version 2.1.
    Ok, so I'll log the "fatal" messages and keep you informed.
    Thank you very much,
    Bernard
    Bernard, I attached version 2.6.2alpha to first post. It will check if required permissions are granted and can try to authorize itself during service start (first option in settings). I hope this will simplify installation procedure for you.
  • 5
    AppSwitcher - SWC (Steering Wheel Control) app launcher.

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

    Please note: This app is developed and tested only on Junsun V1 Pro with MTK8257/MTK8259 CPU. You can test on other devices at your own risk if you are familiar with firmware flashing.


    UI:
    LMC_20230104_161458_lmc_8.4.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)
    - automatic screen dimming based on sunset / sunrise information

    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
    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
    @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
    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

    Why is my screen flickering while I switch trought the list of apps with the steering wheel button?
    The head unit starts the navigation app via the activity com.ts.main.navi.NaviMainActivity which is part of MainUI (package com.ts.MainUI). It will become the foreground activity for a short amount of time, invisible because a transparent theme is used. Unfortunately the screen is flickering during this procedure.
    You can enable the setting "disable navi start activity" in 'AppSwitcher' to avoid this. Please note the activity will be only disabled as long as the dialog of 'AppSwitcher' is active.

    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. Check if AppSwitcher has permission to appear on top of other apps. You can provide the authorization in "application settings".

    2. 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.
    2
    Added version 1.4.
    Only minor changes but the UI bug was too painful for my eyes. (-: