Quick Start Guide

This Quick Start Guide explains how to configure an application to use Qualcomm Snapdragon Power Optimization SDK given the binary distribution. The installer package contains pre-compiled shared libraries for Android (32-bit and 64-bit ARM). Install the distribution on your system following the installer prompts, and then see the appropriate section below on how to use it on your particular platform.

Longer form documentation about this process is available in the SDK documentation.

Legal Disclaimer: Your use of this guide, including but not limited to the instructions, steps, and commands below, is subject to the Website Terms of Use and may contain references to third party or open source software that is not distributed by Qualcomm Technologies, Inc. or its affiliates. You are solely responsible for the installation, configuration, and use of any such third party or open source software and compliance with any applicable licenses. 

System Requirements

Windows 7 or later, Mac OS X 10.10 or later, or Ubuntu 14.04 or later.

Devices
We currently support Android devices running Android 6.0 (Marshmallow) or later powered by the following Qualcomm Snapdragon processors:

  • Snapdragon 425/430/435
  • Snapdragon 630/650/652/653/660
  • Snapdragon 808/810/820/821/835

Software

  • Android
    The precompiled Power Optimization SDK libraries can be easily integrated with an existing native Android application. The Power Optimization SDK assumes the existence of a working Android NDK and SDK. We recommend using NDK r13b or later.

Verifying your Installation

By default, the installer places the Power Optimization SDK libraries, headers and samples in the following directory.

However, during installation a different path may be specified by the user.

Windows: C:\Qualcomm\SnapdragonPowerOptimizationSDK\<version>
Linux/Mac: /opt/Qualcomm/SnapdragonPowerOptimizationSDK/<version>

QSPOWER_DIR referred to throughout the document is the path where Power Optimization SDK is installed. This may be an absolute path, or a path relative to your current project.

As mentioned previously, Android 32-bit and 64-bit pre-compiled libraries are distributed as part of the installation. These variants are installed in separate directories in the install path, in $QSPOWER_DIR/lib/.

Android 32-bit (armeabi-v7a), Android 64-bit (arm64-v8a): libqspower-<version>.so

To verify the installation, build and execute a Power Optimization SDK sample application by performing the following:

cd $QSPOWER_DIR/samples/build/android/jni
$ANDROID_NDK/ndk-build

# Create a directory on the device to push the executable
$ANDROID_SDK/adb shell mkdir /data/local/tmp/powersdk

# Push the executable to the device
# Replace armeabi-v7a with arm64-v8a for 64 bit devices
$ANDROID_SDK/adb push ../libs/armeabi-v7a/power_static /data/local/tmp/powersdk

Run the sample on a rooted device:
# enable root access
$ANDROID_SDK/adb root
$ANDROID_SDK/adb remount

# Push the Power Optimization SDK dynamic library to the device.
# Replace armeabi-v7a by arm64-v8a for 64 bit devices.
# Also, the 64-bit library should be pushed to /system/vendor/lib64
$ANDROID_SDK/adb push ../libs/armeabi-v7a/libqspower-<version>.so /system/vendor/lib

# Run the sample on the device
$ANDROID_SDK/adb shell chmod 755 /data/local/tmp/powersdk/power_static
$ANDROID_SDK/adb shell /data/local/tmp/powersdk/power_static

Run the sample on a non-rooted device:
# Push the Power Optimization SDK dynamic library to the device.
# Replace armeabi-v7a by arm64-v8a for 64 bit devices.
$ANDROID_SDK/adb push ../libs/armeabi-v7a/libqspower-<version>.so /data/local/tmp/powersdk

# Run the sample on the device
$ANDROID_SDK/adb shell chmod 755 /data/local/tmp/powersdk/power_static
$ANDROID_SDK/adb shell LD_LIBRARY_PATH=/data/local/tmp/powersdk /data/local/tmp/powersdk/power_static

Integrating Qualcomm Snapdragon Power Optimization SDK with Android NDK Applications

The precompiled Power SDK library can be easily integrated with an existing native Android application.

These libraries have been compiled with the Google NDK r13b, using the clang toolchain and linked against the c++_static runtime. The default Android build platform is android-19.

The Power Optimization SDK can be integrated into an application by making the following additions to the project’s jni/Android.mk file.

# Power Optimization SDK prebuilt
include $(CLEAR_VARS)

LOCAL_MODULE := qsower
QSPOWER_VERSION := 2.0.0
LOCAL_SRC_FILES := $(QSPOWER_DIR)/lib/$(TARGET_ARCH_ABI)/libqspower-$(QSPOWER_VERSION).so
LOCAL_EXPORT_C_INCLUDES := $(QSPOWER_DIR)/include

include $(PREBUILT_SHARED_LIBRARY)

Also, for each build target include the following in Android.mk:
LOCAL_SHARED_LIBRARIES := qspower