Smartech

Android SDK v3 Integration

Smartech provides an Android SDK that enables app developers to track and engage with
their users and view valuable analytical insights on our powerful Smartech dashboard.

This guide will show you how to install the Netcore Android SDK in your Android project.

Prerequisites

1. Install or update Android Studio to the latest version.

Download from here.

2. Make sure that your app meets the following requirements.

  • Targets API level 19 or later
  • Uses Gradle 4.1 or later

3. Integrate Firebase Cloud Messaging in your app.

You can follow Google’s Documentation or the steps mentioned below.

  • Sign in to Firebase using your Google account.

  • Create a Firebase project.

  • Register your app with Firebase.
    Enter your app's package name in the Android package name field. You can copy the package name from Manifest file.

  • Add a Firebase configuration file.

    • Click Download google-services.json to obtain your Firebase Android config file (google-services.json).
    • Move your config file into the module (app-level) directory of your app. (app folder)
  • Go to the settings -> Cloud Messaging -> Copy the server key.
  • Add Firebase SDK
    The Google services plugin for Gradle loads the google-services.json file that you just downloaded. Modify your build.gradle files to use the plugin.
  1. Project-level build.gradle (/build.gradle):
buildscript {
  repositories {
    // Check that you have the following line (if not, add it):
    google()  // Google's Maven repository
  }
  dependencies {
    ...
    // Add this line
    classpath 'com.google.gms:google-services:4.3.2'
  }
}
allprojects {
  ...
  repositories {
    // Check that you have the following line (if not, add it):
    google()  // Google's Maven repository
    ...
  }
}
  1. App-level build.gradle (//build.gradle):
apply plugin: 'com.android.application'
dependencies {
  // add the Firebase SDK for Firebase mesaging.
  implementation 'com.google.firebase:firebase-messaging:20.0.0'
  // add SDKs for any other desired Firebase products
  // https://firebase.google.com/docs/android/setup#available-libraries
}
...
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
  1. Finally, press 'Sync now' in the bar that appears in the IDE.
  2. Run your application.

4. An App Id for Netcore SDK.

You will get this from Smartech panel.

  • Login into your Smartech panel.
  • Create an app.
  • Copy the server key from your Firebase Console account and paste it.
  • Copy the generated App ID.

Updated 6 months ago


Android SDK v3 Integration


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.