ChuckerTeam / chucker

🔎 An HTTP inspector for Android & OkHTTP (like Charles but on device)
Apache License 2.0
3.94k stars 344 forks source link

Adding bubbles support for Android R+ #428

Open dniHze opened 4 years ago

dniHze commented 4 years ago

:warning: Is your feature request related to a problem? Please describe

Chucker is available as notification for tracking request while using app, with only an ability to use split screen if needed.

:bulb: Describe the solution you'd like

Bubbles seems like a good solution for these who using Android 11 in future (on Pixels or Emulators) with an ability to pop the activity with logs at any time without need for split screen or switching between activities.

But there is one problem. Google restricting bubbles usage only with MessagingStyle notifications that's kinda break the default behaviour using InboxStyle. Thats why I'm filing this issue to discuss this feature with repo maintainers as this could break notification behaviour on R+.

Also within adding this feature I could consider adding shortcuts like LeakCanary does by adding dynamic shortcut to the app so it could be discovered even with the dedicated launcher icon disabled.

:bar_chart: Describe alternatives you've considered

The only existing alternate here is split screen, but lot's of apps are incompatible with it due to design limitations or so on.

:page_facing_up: Additional context

Bubbles API - link Android 11 requirements for bubbles - link

:raising_hand: Do you want to develop this feature yourself?

vbuberen commented 4 years ago

Thanks for suggestion. The idea seems interesting and would definitely be more convenient for some users than switching between activities.

However, Google's intention for Bubbles at this stage (in Android 11) is to use it solely for messaging apps, so the requirements are corresponding (like adding Person object while building such notification). Due to this fact I would like to not abuse the system and hope that in future Google decides to expand use cases for Bubbles.

dniHze commented 4 years ago

That's true, bubbles are kinda hard-linked to messaging apps only for now. But Google's own easter egg for Android 11 uses Bubbles. So I don't think it's impossible to adapt this one to bubbles on R+ with switching to MessagingStyle for this API and adding Chucker as a bot Person.

To make it more transparent for users, as it will kinda break their experience on R+, the feature could be added to library as experimental, so developers that use Chucker could manually opt-in to use bubbles or not so they don't get spammed w/ messages from Chucker bot or get bubbles with floating activity.

What do you think of this kind of implementation?

ColtonIdle commented 4 years ago

I think it would be interesting. Agree with @vbuberen that the bubbles system shouldn't be abused, but this is for a developer tool and so I don't think it'd be the worst thing in the world. Personally though... I think being able to access chucker through notifications is perfect enough for me. I would just like for the notification to stay persisted even after I click it. =)

cortinico commented 4 years ago

the feature could be added to library as experimental,

Ideally having a chucker-bubbles module that offers this support would be an easy way to self contain this feature and allow only the interested users to try it.

I generally agree with the consensus here that this feature seems to be mostly messaging focused. However we can still investigate how it will fit the Chucker use cases and collected feedback from the community