To compile and run your Sparksee application you must take into account your development framework.
In the Installation chapter we have seen how to download and unpack the java package to get the sparkseejava.jar file. You need to include that jar in you development environment project.
If you don’t use an IDE, you just need to add the sparkseejava.jar file to the classpath. So, you can compile and run the HelloSparksee application with these simple commands:
If you use Apache Maven, then it is even easier. Sparksee is in the maven central repository, adding the dependency to the correct Sparksee version into your “pom.xml” file should be enough:
<dependency>
<groupId>com.sparsity</groupId>
<artifactId>sparkseejava</artifactId>
<version>5.0.0</version>
</dependency>
The procedure to use Sparkseejava in Android is the same for Eclipse and Android Studio, but We have separated some steps to better explain the procedure in each environment.
Copy all the content of the lib/ directory to the libs/ directory of your android project.
If you want different “.apk” files for the different target architectures instead of a single application file that supports all platforms or you only want to support certain architectures, you just need to exclude from the previous step the subdirectories of the platforms that you don’t want.
Refresh the project explorer if you can’t see the files that you just copied.
Right click on the libs/sparkseejava.jar file and select Build Path > Add to Build Path
.
Set in your “AndroidManifest.xml” a minimum sdk version greater or equal to 9.
Right click on the libs/sparkseejava.jar file and select Add as library...
.
Add this exact text “compile files('libs/sparkseejava.jar')
” to the build.gradle file.
Set a minimum sdk version >= 9 in the build.gradle file.