# `Mob.Device.Android`
[🔗](https://github.com/genericjam/mob/blob/master/lib/mob/device/android.ex#L1)

Android-specific device events. Symmetrical with `Mob.Device.IOS`.

Messages are tagged `:mob_device_android`:

    {:mob_device_android, event}
    {:mob_device_android, event, payload}

## Subscribe

    Mob.Device.Android.subscribe()

## Status

The `:app` lifecycle events (`:will_resign_active`, `:did_become_active`,
`:did_enter_background`, `:will_enter_foreground`, `:will_terminate`) are
re-emitted here as `{:mob_device_android, event}`, as `Mob.Device.IOS` gets
them on iOS; see `Mob.Device` for when each fires. Nothing Android-specific
fires yet: the events below need `ComponentCallbacks2` and broadcast
receivers in the generated app's Kotlin side. Tracked in `PLAN.md` under
"Native event surface — Batch 1".

## Planned events

- `:doze_mode_changed` — Doze mode entered/exited (no iOS counterpart)
- `:idle_mode_changed` — light idle mode (`ACTION_LIGHT_DEVICE_IDLE_MODE_CHANGED`)
- `:trim_memory` with level — `ComponentCallbacks2.onTrimMemory(level)`
- `:airplane_mode_changed` — `ACTION_AIRPLANE_MODE_CHANGED`
- `:user_present` — `ACTION_USER_PRESENT` (device unlocked)
- the remaining cross-platform `Mob.Device` events re-emitted under this tag

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

# `subscribe`

```elixir
@spec subscribe() :: :ok
```

Subscribe the calling process to Android-specific device events.

# `unsubscribe`

```elixir
@spec unsubscribe() :: :ok
```

Unsubscribe the calling process.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
