com.smartmeapp.monitor.Smartme Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of monitor Show documentation
Show all versions of monitor Show documentation
Including android-maven and others all in monitor namespace. URL and CSM of project.
The newest version!
package com.smartmeapp.monitor;
import android.content.Context;
import android.support.annotation.NonNull;
/**
* Created by Juan Martinez on 06/10/17.
*/
public class Smartme {
private static Context context;
private static String deviceId;
private static String apikey;
private static SmartmeMonitor monitor = null;
private static String NAMELOG = "Smartme";
/**
* Monitoring of user activities
* @param context
* @param deviceId
* @param apiKey
* @return
*/
public static SmartmeMonitor monitor(android.app.Activity activity, Context context, String deviceId, String apiKey){
Smartme.setApikey(apiKey);
Smartme.setContext(context);
Smartme.setDeviceId(deviceId);
if (Smartme.monitor == null){
Smartme.monitor = new SmartmeMonitor(activity,context,deviceId,apiKey);
}
return Smartme.monitor;
}
/**
* Starting services in the background
*/
public static void startService(){
Smartme.monitor.startService();
}
/**
* Changing the app record time interval used
* @param interval
*/
public static void foregroundAppsInterval(int interval){
Smartme.monitor.foregroundAppsInterval(interval);
}
/**
* Assigned permission
* @param requestCode
* @param permissions
* @param grantResults
*/
public static void requestPermissionsResult(int requestCode, @NonNull String[] permissions,
@NonNull int[] grantResults){
Smartme.monitor.requestPermissionsResult(requestCode,permissions,grantResults);
}
/**
* Stop services monitor
*/
public static void stopService(){
Smartme.monitor.stopService();
}
//Method Getting Setting
private static Context getContext() {
return context;
}
private static void setContext(Context context) {
Smartme.context = context;
}
private static String getDeviceId() {
return deviceId;
}
private static void setDeviceId(String deviceId) {
Smartme.deviceId = deviceId;
}
private static String getApikey() {
return apikey;
}
private static void setApikey(String apikey) {
Smartme.apikey = apikey;
}
}