Created
September 29, 2017 09:13
-
-
Save dimmduh/9ab5bfef5cf23ae266555d1f3c1046c7 to your computer and use it in GitHub Desktop.
App2top event tracking MainActivity example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.app2top.tracking.example; | |
import android.os.Bundle; | |
import android.support.design.widget.Snackbar; | |
import android.support.v7.app.AppCompatActivity; | |
import android.view.View; | |
import org.app2top.tracking.App2top; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
App2top.debug = true; | |
findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
App2top.sendEvent(getApplicationContext(), "Launch"); | |
Snackbar.make(view, "Event sent - Launch", Snackbar.LENGTH_LONG).setAction("Action", null).show(); | |
} | |
}); | |
findViewById(R.id.button2).setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
App2top.sendEvent(getApplicationContext(), "Level45"); | |
Snackbar.make(view, "Event sent - Level45", Snackbar.LENGTH_LONG).setAction("Action", null).show(); | |
} | |
}); | |
findViewById(R.id.button3).setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
App2top.sendEvent(getApplicationContext(), "HeroReachedLevel5"); | |
Snackbar.make(view, "Event sent - HeroReachedLevel5", Snackbar.LENGTH_LONG).setAction("Action", null).show(); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment