Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android Enterprise on Chrome OS

Android Enterprise on Chrome OS

Learn about the process of bringing your app to and optimizing for Chrome OS. DroidCon Berlin 2018 (will upload link when available)

Kenneth Ford

June 29, 2018
Tweet

More Decks by Kenneth Ford

Other Decks in Programming

Transcript

  1. • Multiple different form factors • Productivity • Re-use apps

    you’ve already built • Android brings easier offline support • Chrome OS update cycle is fast Why?
  2. • If not already, upload your app to your Managed

    Play Store • Approve your apps for your organization What do you need to do?
  3. • If not already, upload your app to the Play

    Store • Approve your apps for your organization • Upload configuration txt file What do you need to do?
  4. • If not already, upload your app to the Play

    Store • Approve your apps for your organization • Upload configuration txt file What do you need to do? { "can_say_hello": true, "message": "Hello, it's me", "approvals": [ "read", "write" ], "items": [{ "key": "key1", "value": "1"}, { "key": "key2", "value": "2"}] }
  5. • If not already, upload your app to the Play

    Store • Approve your apps for your organization • Upload configuration txt file • Optimize for this new environment! What do you need to do?
  6. • Target API Level 23 or higher • Make sure

    what you’re only requiring what is actually needed in your manifest • New 1st class input methods ◦ Keyboard ◦ Mouse/Trackpad ◦ Stylus • Multi window environments and larger screens ◦ More on this later! Optimize?
  7. yourView.setOnHoverListener{ _, motionEvent -> when (motionEvent.actionMasked) { MotionEvent.ACTION_HOVER_ENTER -> {

    //UI Change } MotionEvent.ACTION_HOVER_EXIT -> { //revert } ... } } Mouse/Trackpad Right click support Hover actions
  8. yourView.setOnGenericMotionListener { view, event -> if (event.actionMasked == MotionEvent.ACTION_SCROLL) {

    //scroll action } ... } Mouse/Trackpad Right click support Hover actions Scroll events
  9. yourView.setOnGenericMotionListener { view, event -> if (event.actionMasked == MotionEvent.ACTION_SCROLL &&

    KeyEvent.metaStateHasModifiers( event.metaState,KeyEvent.META_CTRL_ON)) { //ctrl + scroll action } ... } Mouse/Trackpad Right click support Hover actions Scroll events
  10. yourView.setOnGenericMotionListener { view, event -> if (event.actionMasked == MotionEvent.ACTION_SCROLL &&

    KeyEvent.metaStateHasModifiers( event.metaState,KeyEvent.META_CTRL_ON)) { //ctrl + scroll action } ... } Mouse/Trackpad Right click support Hover actions Scroll events
  11. yourView.setOnKeyListener { _, _, keyEvent -> if (keyEvent.keyCode == KeyEvent.KEYCODE_ENTER)

    { //submit form } … } Keyboard Navigation Actions on key-press
  12. override fun dispatchKeyShortcutEvent( event: KeyEvent): Boolean { if (event.keyCode ==

    KeyEvent.KEYCODE_Z && event.hasModifiers(KeyEvent.META_CTRL_ON)) // undo action return true } return super.dispatchKeyShortcutEvent(event) } Keyboard Navigation Actions on key-press Shortcuts
  13. • Layouts for larger screens • Handling both orientations •

    Free form window resizing Window Management
  14. • Layouts for larger screens • Handling both orientations •

    Free form window resizing • Use window size not screen size! Window Management
  15. • Layouts for larger screens • Handling both orientations •

    Free form window resizing • Use window size not screen size! • Drag and drop Window Management
  16. • What happens? ◦ Configuration change occurs when crossing layout/view

    boundaries ◦ onDraw() called constantly • Just like orientation changes, but more frequent • Save and restore state process must be fast • Architecture components help make this easier! What is Free-form Resizing?
  17. • Chrome OS Emulator ◦ Preview • ADB over USB

    ◦ Pixelbook & HP Chromebook X2 ◦ More information on it’s way • Android Studio on Chrome OS ◦ Preview only for Pixelbooks currently Developer Tools
  18. • Requires none or little code changes to run on

    Chrome OS • Restrictions are handled through the Cloud DPC and admin site, but on the device is no different. • Reusability of already developed applications • Optimize and allow your users to be more productive and take advantage of these new platforms! Android Enterprise on Chrome OS
  19. • Codelabs ◦ Optimize for Android on Chrome OS ▪

    https://codelabs.developers.google.com/codelabs/optimized-for-chromeos/ ◦ Resizing ▪ https://codelabs.developers.google.com/codelabs/chromeos-resizing/ • Documentation ◦ https://d.android.com/topic/arc/ • Google I/O 2018 presentation ◦ https://www.youtube.com/watch?v=6kIZ_u4QE9U • Blog Posts ◦ https://medium.com/google-developers/search?q=android%20chrome%20os Resources