Java library in your Android level 8+ or JRE 1.5+ application to
track events directly from your customers’ devices. This
library using an asynchronous processing queue to make Event tracking
a non-blocking affair. This document should give you a quick
run-through of how you might go about tracking user sessions.
- Download the
latest version of the Katana Java library from: https://bitbucket.org/ninja_metrics/kapi-java-lib
- Add the JAR
to your classpath and import
- Initialize a
fresh tracking object in your source code: KApi
- Register an
Account Id for later use:
aTestDob = new GregorianCalendar(1983,
December 20 1983
This equates to saying that an American male born on Dec 20, 1983
had his account created just now (the new Date() call), with 20.78
in currency, using the “mobile” platform.
- Register a
Character Id (if you application uses the concept of characters):
A new character registration happened just now for a character named
“that one guy” identified by the string
- Log a Login:
A login by account “firstname.lastname@example.org” with
his character “wizard” occurred, at the method calling
time, using the “android” platform.
- Log a
A corresponding logout occurred at the logger method invocation
that wasn’t too bad?
real-ish example Eclipse project, please see our kapi-android-test project:
https://bitbucket.org/ninja_metrics/kapi-android-test. If you
are using our library in your Android project, do not forget to allow
the Katana API library access to the Katana data-service: <uses-permission android:name="android.permission.INTERNET" />.
that any Account Id or Character Id you want to reference must first
be initialized; the initialization only has to happen once over the
lifetime of any Id. Please see the javadoc help in your IDE’s
code completion for accepted parameter values. The numeric values for
theClientId and theAppId can be
obtained from the account management panel, or ask your account
manager for help.