use of edu.berkeley.cs.amplab.carat.android.utils.Tracker in project carat by amplab.
the class AppDetailsFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View detailsPage = inflater.inflate(R.layout.graph, container, false);
DrawView drawView = new DrawView(getActivity());
if (isApp) {
drawView.setParams(fullObject, detailsPage);
setBenefitTextView(detailsPage, fullObject.getBenefitText());
} else {
// isOS or isModel
Reports reports = CaratApplication.storage.getReports();
if (reports != null) {
Tracker tracker = Tracker.getInstance();
if (isOs) {
setOsWidgets(detailsPage, drawView, reports, tracker);
} else {
// isModel
setModelWidgets(detailsPage, drawView, reports, tracker);
}
// common piece of code for both OS and Model
setBenefitWidget(detailsPage);
}
Log.d("NullReports", "Reports are null!!!");
}
// common piece of code for App, OS, and Model
setDescriptionWidgets(detailsPage);
// layout file
return detailsPage;
}
use of edu.berkeley.cs.amplab.carat.android.utils.Tracker in project carat by amplab.
the class ProcessListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.processlist, container, false);
ListView lv = (ListView) view.findViewById(R.id.processList);
List<ProcessInfo> searchResults = SamplingLibrary.getRunningAppInfo(getActivity());
lv.setAdapter(new ProcessInfoAdapter(getActivity(), searchResults));
Tracker tracker = Tracker.getInstance();
tracker.trackUser("ProcessList");
return view;
}
use of edu.berkeley.cs.amplab.carat.android.utils.Tracker in project carat by amplab.
the class DrawView method setParams.
public void setParams(SimpleHogBug fullObject, View parent) {
String ver = "";
Context activity = CaratApplication.getMainActivity();
String label = CaratApplication.labelForApp(activity, fullObject.getAppName());
PackageInfo pak = SamplingLibrary.getPackageInfo(activity, fullObject.getAppName());
if (pak != null) {
ver = pak.versionName;
if (ver == null)
ver = pak.versionCode + "";
}
this.appName = label + " " + ver;
this.icon = CaratApplication.iconForApp(activity, fullObject.getAppName());
this.type = fullObject.getType();
this.benefit = fullObject.getBenefitText();
this.sampleCount = fullObject.getSamples();
this.sampleCountWo = fullObject.getSamplesWithout();
this.error = fullObject.getError();
this.ev = fullObject.getExpectedValue();
this.evWithout = fullObject.getExpectedValueWithout();
this.errorWo = fullObject.getErrorWithout();
Tracker tracker = Tracker.getInstance();
// the field "type" should be set BEFORE calling this tracking method
tracker.trackUser(label, fullObject);
setFields(parent, true);
}
Aggregations