These docs are for v1.0. Click to read the latest docs for v2.0.

Android SDK 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.

📘

Important

If you are a new customer integrating the SDK for the first time, please integrate SDK v2.5 and refer to the integration documentation here

If you are an existing customer, please continue referring to this documentation.

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 16 (Jelly Bean) 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.
1366
  • 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)
1366
  • Go to the settings -> Cloud Messaging -> Copy the server key.
1366
  • 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 Google Analytics
  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'
1366 1366 1366
  1. Finally, press 'Sync now' in the bar that appears in the IDE.
1366
  1. Run your application.
1366

4. An App Id for Netcore SDK.

You will get this from Smartech panel.

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