Coder Social home page Coder Social logo

androidradar's Introduction

AndroidRadar

The easiest way to get started is by adding the android-radar Maven repository to your application's gradle build.

Getting Started

To get up and running quickly, we'll follow these steps:

  1. Add the jCenter repository.
  2. Add a dependency on the android-radar library module.
  3. Specify Android permissions.
  4. Execute Radar sessions programmatically.

Add the jCenter repository

First, make sure your application build.gradle file specifies the jCenter repository:

repositories {
    jcenter()
}

Alternatively, you can also specify this in the project build.gradle file like this:

allprojects {
    repositories {
        jcenter()
    }
}

Add dependency on android-radar module

In your application grade.build file, add a line to the dependencies section indicating the android-radar library. The latest version available: Download

// replace x, y and z with the latest version of the AndroidRadar library.
dependencies {
    ...
    compile 'com.cedexis:android-radar:x.y.z'
}

Add permissions to AndroidManifest.xml

The Radar client requires a couple of permissions in order to get its work done. These should be added to your application's AndroidManifest.xml file, inside the root <manifest> element and before the <application> element:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

See the sample application's AndroidManifest.xml for a complete example.

Execute Radar sessions

Select one or more appropriate spots in your application code where you would like to execute a Radar session. Since every application is different, it's hard to suggest a one-size-fits-all approach. You'd like to strike a balance between allowing Radar to do too much network activity and not enough. In general, if your application spends most of its time on a particular activity, then that activity's onResume method is a good place to start.

To invoke a Radar session, simply insert the following code, here shown being placed in an activity's overridden onResume method.

@Override
protected void onResume() {
    Intent radarService = new Intent(this, RadarService.class);
    radarService.putExtra(
        RadarService.EXTRA_SESSION_PROPERTIES,
        new RadarSessionProperties(1, <your customer id>));
    startService(radarService);

    super.onResume();
}

That's it. Now every time the user navigates or returns to that activity, a Radar session will fire.

Note that the RadarSessionProperties constructor requires at least two integer arguments, namely your Cedexis zone and customer ids. You may already know these from correspondence with our team. In a pinch, these can be obtained when logged into the Cedexis Portal at https://portal.cedexis.com/ui/radar/tag. This page shows the JavaScript Radar tag with your zone and customer ids embedded.

Portal Screenshot

The two numbers in the URL (enclosed by the red box in the screenshot above) are your zone id and customer id, respectively.

Impact

Impact is not currently supported from the Radar Android SDK. Support will be included in future releases and documentation for using Impact will be added when it is available from the SDK.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.