Skip to main content

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

settings.gradle

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven { url 'https://jitpack.io' }
}
}

Docusaurus logo

gradle.properties
android.useAndroidX = true;
android.enableJetifier = true;

2.1 open your root build.gradle file, add the following

build.gradle

allprojects {
repositories {
...
maven { url '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)
}

Docusaurus logo

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:

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");
}});
}
}

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

KeyDataTypeValueDescription
pageBackgroundColorString"#E8F1FF"Set page background color
appBarBackgroundColorString"#E8F1FF"Set appbar background color
appBarTitleTextString"Add Remark"Set appbar title text
appBarTitleColorString"#000000"Set appbar title color
remarkTypeLabelTextString"Remark Type"Set remark type label text
descriptionLabelTextString"Description"Set description label text
descriptionHintTextString"Add description here..."Set description hint text
descriptionMaxLengthint255Set description max length
buttonTextString"Submit"Set button text
buttonTextColorString"#FFFFFF"Set button text color
buttonBackgroundColorString"#007AFF"Set button background color
labelColorString"#000000"Set text field label color
hintColorString"#B1B1B3"Set text field hint color
inputTextColorString"#000000"Set text field input text color

Step 4. Manually open AppRemark Screen

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");
}})
}
}

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.

For more details explore the example