Back to top

Custom boot and shutdown animations

This topic describes how to replace the default boot and shutdown animations with your own animations. For example, you might replace the default animations with animations that use your company logo.

About custom animations

The general steps to create your own boot and shutdown animations are:

  1. Verify that your device can use custom animations
  2. Create sets of PNG image files for the animations
  3. Request QMG animations from Samsung
  4. Use audio with your bootup and shutdown animations
  5. Load your animations on devices using the Customization SDK

Custom animations

1. Verify that a device can use custom animations

To use custom boot and shutdown animations, a device must support Knox v2.5 or higher. Follow these steps to check which version a device currently supports:

  1. Open the device’s Settings page. Scroll down and click About device.

    GalaxySettingsDevice.png

  2. Scroll to the Knox version section. If the Customization SDK version is 2.5.0 or higher, then the device can use custom animations.

    GalaxyAboutDeviceKNOX.png

2. Create a set of PNG files for an animation

The QMG file format is used by Samsung for the boot and shutdown animations. There are three animation files required for the boot and shutdown animations:

  • bootup.qmg — an animation that plays once after the “powered by android” logo
  • bootloop.qmg — an animation that continually plays after boot.qmg until booting is complete
  • shutdown.qmg — an animation that plays on device shutdown

You can’t directly create QMG files. Instead, you must provide Samsung with PNG files for each animation, which are used to create QMG animations.

You must create PNG files to suit the resolution of the device that will display the animation. Each PNG file can be a maximum of 2MB in size.

You can include up to 99 images (frames) for the bootup and bootloop animations, while the shutdown animation supports a maximum of 30 images. All QMG animations play at 12 frames per second.

Name the PNG files in chronological order from start to end of animation. For example:

  • bootup — bootup01.png, bootup02.png,…, bootup99.png
  • bootloop — bootloop01.png, bootloop02.png,…, bootloop99.png
  • shutdown — shutdown01.png, shutdown02.png,…, shutdown30.png

animationsequence.png

For example, the bootup animation would start by showing bootup01.png, and continue playing each image in order, ending with bootup99.png.

sampleanimation.gif

Compress the PNG files for each animation into zip files that are named after the target device and animation. For example, SM950L_bootup.zip would contain bootup01.png, bootup02.png,…, bootup40.png; assuming that the boot animation consists of 40 frames, and is intended to be the bootup animation for SM950L devices.

image.png

The maximum supported zip file size is 50 megabytes (50MB).

3. Request QMG animations from Samsung

To use custom animations on a device, Samsung must convert the PNG images to QMG animation files. To request QMG animations, go to the Knox Partner Portal support page.

Use audio with animations

You specify which audio to play with your bootup and shutdown animations when you set the animations using the Customization SDK.

The Customization SDK supports Ogg Vorbis, or Ogg, sound files. The sound file bit rate must not exceed 48 KHz. The length of the audio should not exceed the length of your animation. If you do not want any sound to play with your animations, pass a silent Ogg file when you set the animations to play for bootup and shutdown.

Load animations on a device

To install custom animations on your device, you must download the Customization SDK, and then create an app to load the animations on your device. Version 2.5 of the Customization SDK introduced the ability to load custom animations.

For the following examples, suppose that the results of your requests for bootup, bootloop, and shutdown animations are the files bootup.qmg, bootloop.qmg, and shutdown.qmg, and that you have sound files that pair with the animations.

Set animations on devices running Lollipop or lower

To set the bootup and bootloop animations on a device running Lollipop or lower, call setBootAnimation() with animationFile set to bootup.qmg, loopFile set to bootloop.qmg, soundFile set to your animation’s sound file, and delay set to the number of milliseconds to delay playing the bootup sound. For example to set the animations with a 50 millisecond delay, call:

setBootAnimation(bootup.qmg, bootloop.qmg, bootupsound.ogg, 50);

Similarly, to set a custom shutdown animation, call setShutdownAnimation() with animationFile set to shutdown.qmg, and soundFile set to your shutdown sound:

setShutdownAnimation(shutdown.qmg, shutdownsound.ogg);
Set animations on devices running Marshmallow or higher

To set animations on devices running Marshmallow or higher, you must use Knox v2.6 or higher. The methods setBootingAnimation() and setShuttingDownAnimation() replace setBootAnimation() and setShutdownAnimation(), respectively. You must use these new functions to comply with the Marshmallow permissions model; if you try to use the old methods on devices running Marshmallow, you will encounter errors.

Instead of String arguments that hold the names of the animation files, the setBootingAnimation() and setShuttingDownAnimation() methods take ParcelFileDescriptor arguments. For example, to build a ParcelFileDescriptor for the bootup.qmg animation:

String bootupAnim = getFilesDir() + "/bootup.qmg";

File bootupAnimFile = new File(bootupAnim);
bootupAnimFile.setReadable(true, false);
ParcelFileDescriptor bootupAnimFD = ParcelFileDescriptor.open(bootupAnimFile, ParcelFileDescriptor.MODE_READ_ONLY);

To set the bootup animation, create three instances of ParcelFileDescriptor to point to the bootup animation, bootloop animation, and bootup sound file, then call setBootingAnimation():

try {
    String bootupFile = getFilesDir() + "/bootup.qmg";
    String bootloopFile = getFilesDir() + "/bootloop.qmg";
    String soundFile = getFilesDir() + "/bootupsound.ogg";
    int soundDelay = 2000; // milliseconds

    File fileBootup = new File(bootupFile);
    fileBootup.setReadable(true, false);
    ParcelFileDescriptor bootupFD = ParcelFileDescriptor.open(bootupFile, ParcelFileDescriptor.MODE_READ_ONLY);

    File fileLoop = new File(bootloopFile);
    fileLoop.setReadable(true, false);
    ParcelFileDescriptor bootloopFD = ParcelFileDescriptor.open(bootloopFile, ParcelFileDescriptor.MODE_READ_ONLY);

    File fileSound = new File(soundFile);
    fileSound.setReadable(true, false);
    ParcelFileDescriptor soundFD = ParcelFileDescriptor.open(soundFile, ParcelFileDescriptor.MODE_READ_ONLY);

    kcsm.setBootingAnimation(bootupFD, bootloopFD, soundFD, soundDelay);
    catch (SecurityException e) {
    Log.w(TAG, "Security exception: " + e);}
}

Similarly, create an instance of ParcelFileDescriptor for the shutdown animation and call setShuttingdownAnimation():

try {
    String shutdownAnim = getFilesDir() + "/animation.qmg";
    String soundFile = getFilesDir() + "/sound.ogg";

    File fileShutdown = new File(shutdownAnim);
    fileShutdown.setReadable(true, false);
    ParcelFileDescriptor shutdownFD = ParcelFileDescriptor.open(shutdownAnim, ParcelFileDescriptor.MODE_READ_ONLY);

    File fileSound = new File(soundFile);
    fileSound.setReadable(true, false);
    ParcelFileDescriptor soundFD = ParcelFileDescriptor.open(soundFile, ParcelFileDescriptor.MODE_READ_ONLY);

    kcsm.setShuttingDownAnimation(shutdownFD, soundFD);
    } catch (Exception e) {
    Log.w(TAG, "SecurityException:" + e);
    }

From the MDM, the admin can use the functions to set the custom boot and shutdown animations on enterprise devices.

Is this page helpful?