-
Notifications
You must be signed in to change notification settings - Fork 4
Android sandbox project configuration
The Android sample app lives under Charts/TRChartsAndroidSandbox and has been tested with devices as low as API16 with low specs, yielding performance of 60+ frames per second.
The project uses gradle as its build system with android-tools pre-1.3, prior to the official C++ support. We're accepting pull requests to update it. Usage of Android Studio is recommended. The project requires Android NDK downloaded and available on your computer. The C++ library will recompile itself for all platforms after every C++ file change.
Last Update - 07/2015
- To import the project, go to Android Studio ->
File
->New...
->Import Project...
- From there, navigate to Charts/TRChartsAndroidSandbox in your repository, and accept on the dialog.
- Your project may need a new gradle wrapper, so accept in the following dialog to create an updated one.
- At this point your gradle build will fail, because of the missing ndk configuration. Open your local.properties and add your ndk path as
ndk.dir=/Users/MYUSER/android-ndk-r10c
or your OS equivalent. - Sync your project with the gradle files now, and watch the project build on the gradle console.
- Your project should build now.
The C++ library needs to be loaded as early as possible, either from the initial Activity
, or by the Application
class.
The package com.thomsonreuters.charts.trchartsandroidsandbox.chartlib contains an approximation of how a library would be structured. TRChartsView is an extension of GLView you can put on your layout files, and it uses a TRChartsAbsRenderer to update its state. The renderer handles internal update of the C++ model via native calls.
Under the com.thomsonreuters.charts.trchartsandroidsandbox.chart package you can find an example of an implemented renderer called LineChartRenderer, and a fully styled chart factory called ChartExample.