Android SDK Setup AppRemark
To integrate AppsOnAir Android SDK to your Android native Apps with Java or Kotlin, follow the below steps
Step 1. Basic Requirements for service usage
apiKey Setup
- Make sure to configure the API key properly. For additional information Getting started
- Install or update Android Studio to its latest version.
- Make sure that your project meets these requirements:
- Targets API level 24 (NOUGAT) or higher
- Uses Android 7.0 or higher
- Android Gradle Plugin (AGP): Version 8.0.2 or higher
- Requires Gradle version
8.0+
- Uses Jetpack (AndroidX), which includes meeting these version requirements:
compileSdkVersion
34 or later
Step 2. Add AppsOnAir Gradle Plugin and SDK
Newer versions of Android Studio
When creating a new project from Android Studio Artic Fox (or newer) the allprojects{...}
is no longer added in the project level gradle.so need add in settings.gradle
- Groovy
- Kotlin
settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven { url 'https://jitpack.io' }
}
}
settings.gradle.kts
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven("https://jitpack.io")
}
}
gradle.properties
android.useAndroidX = true;
android.enableJetifier = true;
2.1 open your root build.gradle file, add the following
- Groovy
- Kotlin
build.gradle
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
build.gradle.kts
allprojects {
repositories {
...
maven("https://jitpack.io")
}
}
2.2 Add the following to your dependencies section.
libs.versions.toml
[versions]
appsonairAndroidAppremark = "Tag" // latest version
[libraries]
appsonair-android-appremark = { module = "com.github.apps-on-air:AppsOnAir-Android-AppRemark", version.ref = "appsonairAndroidAppremark" }
app/build.gradle
dependencies {
implementation (libs.appsonair.android.appremark)
}
Sync Gradle
Make sure to press "Sync Now" on the banner that pops up after saving!
Step 3. Add the AoA Initialization code and usage
You can call initialization at your preference however, we recommend that you add the initialization code in Main Launcher Activity(MainActivity.java) file onCreate
method as follows:
- Java
- Kotlin
MainActivity.java
import com.appsonair.appremark.services.AppRemarkService;
public class MainActivity extends AppCompatActivity {
private ActivityMainBinding binding;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//AppRemark service Initialization with customizes and handle shakeGestureEnable
AppRemarkService.initialize(this,true,new java.util.HashMap<String, Object>() {{
put("appBarTitleText", "Add Remark");
}});
}
}
MainActivity.kt
import com.appsonair.appremark.services.AppRemarkService
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//AppRemark service Initialization with customizes and handle shakeGestureEnable
AppRemarkService.initialize(this,true, mapOf("appBarTitleText" to "Add Remark"))
}
}
Properties Information (optional)
initialize(context: Context,shakeGestureEnable: Boolean = true,options: Map<String, Any> = OPTIONS.toMutableMap())
- This method initializes the AppRemark services.
context
: The context of the activity in which the remark service is being initialized.shakeGestureEnable
: A boolean value that enables or disables the shake gesture for triggering the remark screen.options
: A Map that allows customization of the remark screen’s UI, such as setting the app bar title or other visual elements.
Available keys of options for Customization
Key | DataType | Value | Description |
---|---|---|---|
pageBackgroundColor | String | "#E8F1FF" | Set page background color |
appBarBackgroundColor | String | "#E8F1FF" | Set appbar background color |
appBarTitleText | String | "Add Remark" | Set appbar title text |
appBarTitleColor | String | "#000000" | Set appbar title color |
remarkTypeLabelText | String | "Remark Type" | Set remark type label text |
descriptionLabelText | String | "Description" | Set description label text |
descriptionHintText | String | "Add description here..." | Set description hint text |
descriptionMaxLength | int | 255 | Set description max length |
buttonText | String | "Submit" | Set button text |
buttonTextColor | String | "#FFFFFF" | Set button text color |
buttonBackgroundColor | String | "#007AFF" | Set button background color |
labelColor | String | "#000000" | Set text field label color |
hintColor | String | "#B1B1B3" | Set text field hint color |
inputTextColor | String | "#000000" | Set text field input text color |
Step 4. Manually open AppRemark Screen
- Java
- Kotlin
MainActivity.java
import com.appsonair.appremark.services.AppRemarkService;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//Help to open remark screen manually and add extra data about app
AppRemarkService.addRemark(view.getContext(), new java.util.HashMap<String, Object>() {{
put("xx", "xx");
}})
}
}
MainActivity.kt
import com.appsonair.appremark.services.AppRemarkService
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//Help to open remark screen manually and add extra data about app
AppRemarkService.addRemark(this, mapOf("XX" to "XX"))
}
}
Properties Information
addRemark(context: Context,extraPayload: Map<String, Any> = emptyMap())
- This method is used to manually open the remark screen, allowing users to provide feedback.
context
: The context of the activity in which the remark service is being initialized.- The
extraPayload
parameter is optional and can be used to pass additional metadata, such as the app version, flavors, or any other contextual information. This data is sent along with the feedback to enhance tracking and categorization, making it easier to analyze and act on user inputs effectively If you want to Use this method as follows:
Step 5. Run your App and Setup your app remark services
Run your app by using Android Studio on Android simulators or any physical device to make sure it builds correctly.
note
All submitted screenshots and feedback will be displayed on a web portal.