Posts

Showing posts from October, 2017

Transactions in SQL

A transaction is a unit of work that is performed against a database. Transactions are units or sequences of work accomplished in a logical order, whether in a manual fashion by a user or automatically by some sort of a database program. A transaction is the propagation of one or more changes to the database. For example, if you are creating a record or updating a record or deleting a record from the table, then you are performing a transaction on that table. It is important to control these transactions to ensure the data integrity and to handle database errors. Practically, you will club many SQL queries into a group and you will execute all of them together as a part of a transaction. Properties of Transactions Transactions have the following four standard properties, usually referred to by the acronym  ACID . Atomicity  − ensures that all operations within the work unit are completed successfully. Otherwise, the transaction is aborted at the point of failure and all th

Lottie Animation in Android

Gradle is the only supported build configuration, so just add the dependency to your project  build.gradle  file: dependencies { ... compile 'com.airbnb.android:lottie:2.2.5' ... } Lottie supports ICS (API 14) and above. The simplest way to use it is with LottieAnimationView: <com.airbnb.lottie.LottieAnimationView android:id="@+id/animation_view" android:layout_width="wrap_content" android:layout_height="wrap_content" app:lottie_fileName="hello-world.json" app:lottie_loop="true" app:lottie_autoPlay="true" /> Or you can load it programmatically in multiple ways. From a json asset in app/src/main/assets: LottieAnimationView animationView = ( LottieAnimationView ) findViewById ( R . id . animation_view ) ; animationView . setAnimation ( "hello-world.json" ) ; animationView . loop ( true ) ; animationView . playAnimation ( ) ;