This presentation highlights the new architecture libraries released by the Google during this year Google IO. It was presented during forLoopUyo maiden Edition.
abstraction layer over SQLite which provided object mapping similar to OrmLite. - LiveData: data holder class that keeps a value and allows this value to be observed. - - LifeCycle: it contains information about the lifecycle state of a component such as Activities and fragments - - ViewModel: store and manage UI-related data so that the data survives configuration changes such as screen rotations..
public abstract class TaskDatabase extends RoomDatabase { public abstract TaskDao taskDao(); } Room.databaseBuilder(context.getApplicationContext(), TaskDatabase.class, "task_db").build();
to data across multiple components of your app without creating explicit, and rigid dependency paths between them. - data holder class that keeps a value and allows this value to be observed.
memory until the LifeCycle it’s scoped to goes away permanently - retain data across configuration changes - ViewModel outlives the specific Activity or Fragment instances.
to other libraries such as ORMlite or greenDAO. It uses SQL while still allowing compile time guarantees on the queries. • LiveData – A Lifecycle aware observable core component. • ViewModel – The communication points with the rest of the application for Activities / Fragments. They are UI code free and outlive the activity or fragment. • Lifecycle – A core part of the Architecture components, it contains information about the lifecycle state of a component (for instance an Activity).