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.
-
ClassDescriptionA snapshot of where the user was and what they were doing: the route stack, plus whatever your
StateProviderchose to add.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.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 aStateRelayproduced something newer than what is here.AStateRelayover your own HTTPS endpoint, which is all most applications need.Turns anAppStateinto the two forms it has to travel in, and refuses payloads that cannot make the trip.Supplies and consumes the half of the application state the framework cannot work out for itself.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.