com.eg.agent.android.Egurkha Maven / Gradle / Ivy
package com.eg.agent.android;
import android.content.Context;
import android.os.Build;
import android.util.Log;
public final class Egurkha {
private static boolean started = false;
private static final AgentConfiguration agentConfiguration = new AgentConfiguration();
public Egurkha() {
}
protected Egurkha(String token) {
if(token.trim().length()==0)
{
Log.e("eGAndroidAgent","Please provide valid application token");
}
else {
agentConfiguration.setApplicationToken(token);
System.out.println(" This is Egurkha Constructor" + token);
}
}
public static Egurkha withApplicationToken(String token){
return new Egurkha(token);
}
public void start(Context context){
if (started) {
System.out.println("eG Android is already running.");
return;
}
try{
printDeviceDetails();
AndroidAgentImpl.init(context, agentConfiguration);
}
catch(Exception e){
System.out.println(" Exception Occured while printing Device Details ");
}
}
public String getValue()
{
return "Eg Agent started";
}
private boolean isInstrumented()
{
return true;
}
public static boolean isStarted() {
return started;
}
private void printDeviceDetails(){
String manufacture = Build.MANUFACTURER;
String brand = Build.BRAND;
String device = Build.DEVICE;
String model = Build.MODEL;
String display = Build.DISPLAY;
System.out.println(" MANUFACTURER :"+manufacture+" Brand : "+brand +" Device :"+device+" Model :"+model+" display "+display );
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy