GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - DanielWorld/UserTracker: UserTracking SDK : Tracks Users action

BranchesTags
Open more actions menu

Latest commit

 

History

58 Commits
58 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
UserTracker
UserTracker
 
 
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
UserTracker.iml
UserTracker.iml
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

UserTracker

UserTracking SDK : Tracks Users action

Development Environment

  • Apple OS X 10.10 & Windows 10
  • Android Studio 1.4.0
  • Java version 1.8.0_45
  • Android 6 (23)

Environment Settings

  • in app/build.gradle minSdkVersion should be 10 or higher level

AndroidManifest.xml Settings

INTERNET, GET_ACCOUNTS, READ_PHONE_STATE are required

<uses-permission android:name="android.permission.INTERNET" /> 
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> 
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

set app id in string.xml

<resources>
    ...
    <string name="app_id">0123456789</string>
</resources>

To read app id, set meta-data in AndroidManifest.xml

<application
    ...>
    ...
    <meta-data
        android:name="com.danielworld.utility.appId"
        android:value="@string/app_id" />

Tracking data is transmitting through service

<service
      android:name="com.danielworld.usertracker.service.TrackingService" />

Set Receiver to get InstallReferrer

<receiver
      android:name="com.danielworld.usertracker.receiver.InstallReferrerReceiver"
      android:enabled="true"
      android:exported="true">
        <intent-filter>
            <action android:name="com.android.vending.INSTALL_REFERRER" />
        </intent-filter>
</receiver>

How to use UserTracker

You can get UserTracker like this

synchronized public static final UserTracker getInstance(Context context)

UserTracker gives you 4 methods

  • public final void sendFirstRun()
  • public final void sendForeground(String tag)
  • public final void sendBackground(String tag)
  • public final void sendAction(String tag)

public final void sendFirstRun()

This is called when application execute for the first time
It won't be transmitted unless install referrer is arrived

If it is called in Activity

UserTracker.getInstance(getApplicationContext()).sendFirstRun();

If it is called in Fragment

UserTracker.getInstance(getActivity().getApplicationContext()).sendFirstRun();

public final void sendForeground(String tag)

This is called when application is on the foreground mode
If String tag is null then it will print null

If it is called in Activity

UserTracker.getInstance(getApplicationContext()).sendForeground(String tag);

If it is called in Fragment

UserTracker.getInstance(getActivity().getApplicationContext()).sendForeground(String tag);

public final void sendBackground(String tag)

This is called when application is in the background mode
If String tag is null then it will print null

If it is called in Activity

UserTracker.getInstance(getApplicationContext()).sendBackground(String tag);

If it is called in Fragment

UserTracker.getInstance(getActivity().getApplicationContext()).sendBackground(String tag);

public final void sendAction(String tag)

This is called when application does certain action If String tag is null then it will print null

If it is called in Activity

UserTracker.getInstance(getApplicationContext()).sendAction(String tag);

If it is called in Fragment

UserTracker.getInstance(getActivity().getApplicationContext()).sendAction(String tag);

How to test InstallReferrer in local

Using terminal, you can deliver install referrer to your device
Go to folder where adb is installed

$ adb shell $ am broadcast -a com.android.vending.INSTALL_REFERRER -n danielworld.usertracker/com.danielworld.usertracker.receiver.InstallReferrerReceiver --es "referrer" "com=userTracker&name=daniel&com=danielworld&id=234"

Caution

sendFirstRun() will invoke only one time when install referrer is arrived before calling it
If install referrer wasn't received when sendFirstRun() is invoked, sendFirstRun() will be called without install referrer and wait for install referrer to send sendFirstRun()

About

UserTracking SDK : Tracks Users action

Resources

Readme
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.