package com.codename1.continuity
Saves what the user was doing and brings it back – after the operating system kills the app, and on the other devices that person owns.
Start at Continuity. The framework already knows the com.codename1.router.Navigation stack,
so an app whose screens carry @Route gets them restored with no code; a StateProvider adds
whatever else matters. AppState is the snapshot the two halves make, and it is the same value
that is written to storage, advertised to a nearby device and sent through a StateRelay.
Referencing this package is what makes the build declare the activity type and compile the
native continuation handling in. Its sibling com.codename1.continuity.sync is separate
because it costs an entitlement on iOS.
See the State Restoration and Continuity chapter of the developer guide for the platform capability table, the build hints and the relay contract.
Types
class AppState | A snapshot of where the user was and what they were doing: the route stack, plus whatever your StateProvider chose to add. |
class Continuity | Saves what the user was doing, brings it back when the app starts again, and – where the platform or your own endpoint can carry it – lets them pick it up on another device. |
interface ContinuityListener | Notified when a state arrives from somewhere other than this device’s own storage: one of the user’s other devices handed off what they were doing, or a StateRelay produced something newer than what is here. |
class RestStateRelay | A StateRelay over your own HTTPS endpoint, which is all most applications need. |
class StateCodec | Turns an AppState into the two forms it has to travel in, and refuses payloads that cannot make the trip. |
interface StateProvider | Supplies and consumes the half of the application state the framework cannot work out for itself. |
interface StateRelay | Carries state between devices the platform will not carry it between – an iPhone and an Android tablet, two devices that are never in the same room, a phone and the web build. |