Загрузка видео...
Не удалось загрузить видео
Here's a first look at Android 14's new notetaking feature for styluses👀 🖊️📓 In this video, I first launch the default notes app from a lock screen shortcut, then I unlock the device, press the stylus tail button to launch the notes app in a bubble, and insert a screenshot.
26,767 просмотров • 3 лет назад •via X (Twitter)
Комментарии: 12

You've probably seen me talk about this feature before, but if not, this is probably the first you're hearing of it since Google hasn't made any mention of it. I've never gotten it working until today, but thanks to @narektor I can finally show it off! Here's how it works:

Android 14 adds a new role called ROLE_NOTES. This role can only be granted to apps that target SDK 34 and which handle the android.intent.action.CREATE_NOTE intent with the category set to DEFAULT and the showWhenLocked and turnScreenOn flags.

When an app qualifies for the Notes role, the user can make it the Notes role holder by going to Settings > Apps > Default apps > Notes app. This page can also be accessed through a shortcut when a stylus is connected or through the lock screen shortcut settings page.

(Currently, the Notes role is disabled by default, so you won't see this. You can enable it by going to Settings > System > Developer options and toggling "Force enable Notes role" and then rebooting. This toggles a RRO which sets config_enableDefaultNotes to true.)

When you activate the notetaking shortcut, Android sends off the android.intent.action.CREATE_NOTE intent targeting the default notes app with the intent extra android.intent.extra.USE_STYLUS_MODE. Devs of notes apps can respond to this by launching a stylus-optimized entry UI.

When an app becomes the default notes role holder, it's able to be granted the LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE permission.

Apps with this permission can use the ACTION_LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE intent action to trigger SystemUI to get a screenshot of the current window on behalf of the app. The user then has a chance to edit the screenshot, which can then be returned to the notes app.

This is what happens in the demo video, by the way. When I tap "attach screenshot" in the menu, it sends this intent to grab a screenshot of the window underneath. The screenshot opens in Markup, which I'd be able to edit by cropping/drawing before inserting it into the note.

If you're wondering how I launched the app in a floating bubble like that, that's actually Android doing that on my behalf. When you tap the tail button on a connected stylus, Android 14 launches the default notes app in a floating bubble automatically.

(I don't actually have a USI 2.0 stylus connected to a Pixel Tablet, nor do I even have a Pixel Tablet yet lol. To simulate the stylus tail button press, I used the ADB command `input keyevent`.)

FWIW, Keep currently doesn't qualify for the notes role, but I suspect it's going to eventually. There are rumors the Pixel Tablet will get an official stylus accessory (it supports USI 2.0!) so this feature makes a lot of sense.

If you're a developer of a Notes app or are just curious about how to implement this, @narektor will soon share details on GitHub. They forked the OSS Notes app "Quillpad" to test this API/notes role out, so many thanks to them for their help!

