Forums - Hexagon Shared Library in Android App

2 posts / 0 new
Last post
Hexagon Shared Library in Android App
dkartis
Join Date: 18 Nov 13
Posts: 8
Posted: Fri, 2015-04-10 11:02

I cloned the calculator example and added my own functions to run on the DSP. This works fine when running from the terminal, but I'm trying to incorporate this into an Android application. I copied the calculator_test.so file with the added functions, used  System.loadLibrary() on the java side and have been able to successfully call functions that do not run on the dsp and get the correct results.

 

The problem is when I try to run functions that process on the DSP I get a result of -1 every time. When I try the calculator_test function and give it parameters to run on the DSP, it returns with a value of 1 meaning there was an error. I believe I'm missing a library in my android project, which should I add? the libcalculator_skel.so give me erros when trying to load. Also, I'm using Android Studio on a Windows 7 machine. Thank you.

  • Up0
  • Down0
dkartis
Join Date: 18 Nov 13
Posts: 8
Posted: Tue, 2015-04-14 17:05

Figured out the answer to this. I just needed to load libcalculator.so, reference it in the Android.mk file, and call the functions within it from native code. Pretty straight forward actually.

  • Up1
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.