This guide documents how to get started using the Android runtime library. Rive runtime libraries are open-source. The source is available in its GitHub repository.
This library contains an API for Android apps to easily integrate Rive assets.
Follow the steps below for a quick start on integrating Rive into your Android app.
1. Add the Rive dependency
Add the following dependencies to your build.gradle file in your project:
// During initialization, you may need to add a dependency
Otherwise this can be achieved by calling the initializer in your code:
If you want to initialize Rive yourself, this can be done in code:
3. Add RiveAnimation to your layout
The simplest way to get a Rive animation into your application is to include it as part of a layout. The following will consist of the Rive file loaded from the raw resources and auto-play its first animation. This assumes you have taken a downloaded .riv file (i.e off_road_car_blog.riv) and placed it in your raw resources folder.
Another way to load a Rive file in is by referencing the URL where the asset lives (see Internet Permissions section below for an extra step in setup):