Link Search Menu Expand Document

Initializing the Studio Library for Android

🔥NOTE: The Studio library for Android is currently in beta and under development. Information on this page is subject to change.

To use Lofelt Studio haptics in your app, you must first create a LofeltHaptics object. You will then be able to play and control haptic clips with that object. Note that all of the following code examples are written in Java.

import com.lofelt.haptics.LofeltHaptics;

LofeltHaptics haptics = new LofeltHaptics(this);

The constructor of LofeltHaptics needs a Context object as a parameter to trigger vibrations. Therefore, a good place to initialize LofeltHaptics would be in the onCreate() method of your activity.

Each LofeltHaptics object you create is capable of playing back one haptic file at a time.

< Prev Next >


Copyright © 2020-2021 Lofelt GmbH. All rights reserved.