Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Build with Android O SDK (Android 8.0 / API 26) #863

Closed
8 tasks done
pocmo opened this issue Jul 5, 2017 · 4 comments
Closed
8 tasks done

Build with Android O SDK (Android 8.0 / API 26) #863

pocmo opened this issue Jul 5, 2017 · 4 comments

Comments

@pocmo
Copy link
Contributor

pocmo commented Jul 5, 2017

This is at least needed to support home screen shortcuts on Android O (#833).

I tried using the new SDK in June (#758). Building worked fine but running our Robolectric tests failed.

  • Update SDK and other dependencies like support library in build.gradle files
  • Use new Shortcut API to implement Add to home screen #833
  • Use startForegroundService() to show permanent notification (this depends on multitasking refactoring)
  • Create a notification channel for our on-going notification
  • Fix other behavior changes or deprecated code: https://developer.android.com/preview/behavior-changes.html
  • Fix automated tests that depend on a different SDK version
  • Replace "placeholder code" that doesn't work with newest build tools anymore
  • Finalize notification channel strings (See comment with screenshots below)
@pocmo pocmo added the build label Jul 5, 2017
@pocmo pocmo mentioned this issue Jul 5, 2017
9 tasks
@pocmo pocmo self-assigned this Jul 25, 2017
@pocmo pocmo changed the title Build with Android O SDK (API 26) Build with Android O SDK (Android 8.0 / API 26) Jul 25, 2017
@pocmo pocmo added v2.1 and removed needs triage labels Jul 25, 2017
@ekager
Copy link
Contributor

ekager commented Jul 25, 2017

Would we also have to refactor now-deprecated methods? If this isn't too complicated I think it would be great to be able to include homescreen shortcuts (#833) for Android O+ with the ShortcutManager. 👍

@pocmo
Copy link
Contributor Author

pocmo commented Jul 26, 2017

If it's straight-forward to do. Otherwise I'd be okay to do it later. I'm more worried about some behavior changes in the SDK that break some of the existing features (like the ongoing notification). I'll try to get patches up for that soon! :)

@bbinto bbinto modified the milestone: Burgundy Jul 26, 2017
ekager referenced this issue in ekager/focus-android Jul 28, 2017
This was referenced Jul 28, 2017
@bbinto bbinto removed the Burgundy label Aug 1, 2017
@pocmo
Copy link
Contributor Author

pocmo commented Aug 22, 2017

@antlam @mheubusch While Focus is active we show an on-going notification. Now on Android 8+ we need to create a so called "notification channel" for all notifications. Whenever we display a notification we need to assign it to a channel. A user can configure how (or if) notifications from a specific channel show up. Here's a pretty good article about the feature:
https://www.androidcentral.com/notification-channels

For our on-going notification we need to create a channel with a "name" and an (optional) description. The Android guidelines say:

  • name: The recommended maximum length is 40 characters; the value may be truncated if it is too long.
  • description: The recommended maximum length is 300 characters; the value may be truncated if it is too long.

I have absolutely no clue how we should name this thing.

However here are some screenshots from Android's UI showing the strings:

Showing all notification channels of the app. "Session" is how I named the channel in my build:
overview

This is the screen shown when tapping on the channel to configure it. "Text text" is the description of the channel I used in my build:
channel

And just in case, this is the notification we show:
notification

@bbinto bbinto modified the milestones: Cobalt*, Burgundy Aug 22, 2017
@jenn-chaulk jenn-chaulk modified the milestone: Cobalt* Aug 22, 2017
pocmo added a commit that referenced this issue Aug 23, 2017
@mheubusch
Copy link

"name" Private browsing session
"description" Notifications let you erase your Focus session with a tap. You don’t need to open the app or see what’s running in your browser.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants