...
Download the aar
library from the GREENSPECTOR Modules page on the Web Interface and install it:
...
Code Block |
---|
|
mvn install:install-file
-Dfile=greenspector-probe-android-[version].aar
-DgroupId=com.greenspector.probe.android
-DartifactId=greenspector-probe-android
-Dversion=[version]
-Dpackaging=aar |
Android Studio integration
...
Integration in your Android project
If you have installed the library in the libs
folder of your Android project
Add the dependency in your project's module build.gradle file:
Code Block |
---|
language | java |
---|
title | build.gradle |
---|
|
dependencies {
compile files('libs/greenspector-probe-android-[version].aar')
} |
If you have installed the library in a Maven repository
Check your Maven repository is configured inside the project's build.gradle file.
Example with for a local Maven local repository:
Code Block |
---|
language | java |
---|
title | build.gradle |
---|
|
buildscript {
repositories {
jcenter()
mavenLocal()
}
} |
Inside the dependencies of the application Add the dependency in your project's module build.gradle file (your application and not the build.gradle in the root project), add the library :
Code Block |
---|
language | java |
---|
title | build.gradle |
---|
|
dependencies {
compile ('com.greenspector.probe.android:greenspector-probe-android:[version]')
} |
Android
...
project configuration
In order to be able to correctly use the Probe API you need to add some permissions in your application's AndroidManifest.xml file.
- Permission to use Internet (to send the results to the GREENSPECTOR Server):
Code Block |
---|
|
<uses-permission android:name="android.permission.INTERNET"/> |
...
- Permissions to read and write on the SD Card (to read and write results files):
Code Block |
---|
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> |
IMPORTANT
Beginning in From Android 6.0 (API level 23), some permissions are now considered *dangerous*.
The permissions *android.permission.READ_EXTERNAL_STORAGE
* and *android.permission.WRITE_EXTERNAL_STORAGE
* must be granted explicitly via ADB commands for the measures to workrun correctly.
First install your application on your mobile, then launch the following commands to grant permissions:
Code Block |
---|
|
adb shell pm grant com.example.myapp android.permission.READ_EXTERNAL_STORAGE
adb shell pm grant com.example.myapp android.permission.WRITE_EXTERNAL_STORAGE |
Related articles
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@185bfa9a |
---|
showSpace | false |
---|
sort | modified |
---|
reverse | true |
---|
type | page |
---|
cql | label = "probeapi" and type = "page" and space = "DOCUMENTATION" |
---|
labels | kb-how-to-article |
---|
|
...