本文整理汇总了Java中com.google.firebase.perf.metrics.AddTrace类的典型用法代码示例。如果您正苦于以下问题:Java AddTrace类的具体用法?Java AddTrace怎么用?Java AddTrace使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AddTrace类属于com.google.firebase.perf.metrics包,在下文中一共展示了AddTrace类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStationNames
import com.google.firebase.perf.metrics.AddTrace; //导入依赖的package包/类
/**
* @inheritDoc
*/
@Override
@AddTrace(name="StationsDb.getStationNames")
public String[] getStationNames(Station[] Stations) {
if (Stations == null || Stations.length == 0) {
FirebaseCrash.logcat(WARNING.intValue(), LOGTAG, "Tried to load station names on empty station list!");
return new String[0];
}
String[] results = new String[Stations.length];
for (int i = 0; i < Stations.length; i++) {
results[i] = Stations[i].getLocalizedName();
}
return results;
}
示例2: onCreate
import com.google.firebase.perf.metrics.AddTrace; //导入依赖的package包/类
@Override
@AddTrace(name = "onCreateLandingActivity")
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
loggedIn = PreferenceManager.getDefaultSharedPreferences(
getApplicationContext())
.getBoolean(TOKEN_SAVED_KEY, false);
analytics = AnalyticsTracker.getInstance(this, false);
if (!loggedIn) {
setContentView(R.layout.activity_landing);
getSupportActionBar().hide();
buildAccountAuthUrl();
setUpSkipDialog();
setUpButtons();
} else {
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
}
}
示例3: onCreateView
import com.google.firebase.perf.metrics.AddTrace; //导入依赖的package包/类
@Override
@AddTrace(name="LiveboardSearchFragment.onCreateView")
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_liveboard_search, container, false);
stationRecyclerView = view.findViewById(R.id.recyclerview_primary);
return view;
}
示例4: getStationsOrderBySize
import com.google.firebase.perf.metrics.AddTrace; //导入依赖的package包/类
@Override
@AddTrace(name="StationsDb.getStationsOrderBySize")
public Station[] getStationsOrderBySize() {
SQLiteDatabase db = this.getReadableDatabase();
Cursor c = db.query(
StationsDataColumns.TABLE_NAME,
new String[]{
StationsDataColumns._ID,
StationsDataColumns.COLUMN_NAME_NAME,
StationsDataColumns.COLUMN_NAME_ALTERNATIVE_NL,
StationsDataColumns.COLUMN_NAME_ALTERNATIVE_FR,
StationsDataColumns.COLUMN_NAME_ALTERNATIVE_DE,
StationsDataColumns.COLUMN_NAME_ALTERNATIVE_EN,
StationsDataColumns.COLUMN_NAME_COUNTRY_CODE,
StationsDataColumns.COLUMN_NAME_LATITUDE,
StationsDataColumns.COLUMN_NAME_LONGITUDE,
StationsDataColumns.COLUMN_NAME_AVG_STOP_TIMES
},
null,
null,
null,
null,
StationsDataColumns.COLUMN_NAME_AVG_STOP_TIMES + " DESC"
);
Station[] stations = loadStationCursor(c);
c.close();
db.close();
return stations;
}
示例5: getStationById
import com.google.firebase.perf.metrics.AddTrace; //导入依赖的package包/类
/**
* @inheritDoc
*/
@Override
@AddTrace(name="StationsDb.getStationById")
public Station getStationById(String id) {
SQLiteOpenHelper StationsDbHelper = new StationsDb(context);
SQLiteDatabase db = StationsDbHelper.getReadableDatabase();
Cursor c = db.query(
StationsDataColumns.TABLE_NAME,
new String[]{
StationsDataColumns._ID,
StationsDataColumns.COLUMN_NAME_NAME,
StationsDataColumns.COLUMN_NAME_ALTERNATIVE_NL,
StationsDataColumns.COLUMN_NAME_ALTERNATIVE_FR,
StationsDataColumns.COLUMN_NAME_ALTERNATIVE_DE,
StationsDataColumns.COLUMN_NAME_ALTERNATIVE_EN,
StationsDataColumns.COLUMN_NAME_COUNTRY_CODE,
StationsDataColumns.COLUMN_NAME_LATITUDE,
StationsDataColumns.COLUMN_NAME_LONGITUDE,
StationsDataColumns.COLUMN_NAME_AVG_STOP_TIMES
},
StationsDataColumns._ID + "=?",
new String[]{id},
null,
null,
null,
"1");
Station[] results = loadStationCursor(c);
c.close();
db.close();
if (results == null) {
return null;
}
return results[0];
}
示例6: onCreateView
import com.google.firebase.perf.metrics.AddTrace; //导入依赖的package包/类
@Override
@AddTrace(name="RouteSearchFragment.onCreateView")
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_route_search, container, false);
}
示例7: onCreate
import com.google.firebase.perf.metrics.AddTrace; //导入依赖的package包/类
@Override
@AddTrace(name = "onCreateMainActivity")
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
analytics = AnalyticsTracker.getInstance(this, true);
WearableRecyclerView wearableRecyclerView = (WearableRecyclerView) findViewById(R.id.recycler_launcher_view);
wearableRecyclerView.setHasFixedSize(true);
OffsettingHelper offsettingHelper = new OffsettingHelper();
wearableRecyclerView.setCenterEdgeItems(true);
wearableRecyclerView.setOffsettingHelper(offsettingHelper);
exampleItemModels = new ArrayList<>();
exampleItemModels.add(new ExampleItemModel(R.string.activity_simple_mapview_title,
R.drawable.simple_map_view_screen, new Intent(MainActivity.this, SimpleMapViewActivity.class)));
exampleItemModels.add(new ExampleItemModel(R.string.activity_map_fragment_title,
R.drawable.simple_map_view_screen, new Intent(MainActivity.this, MapFragmentActivity.class)));
exampleItemModels.add(new ExampleItemModel(R.string.activity_map_offline_title,
R.drawable.simple_map_view_screen, new Intent(MainActivity.this, OfflineMapActivity.class)));
exampleItemModels.add(new ExampleItemModel(R.string.activity_location_tracking_title,
R.drawable.simple_map_view_screen, new Intent(MainActivity.this, LocationTrackingActivity.class)));
ExampleAdapter exampleAdapter = new ExampleAdapter(MainActivity.this, exampleItemModels);
wearableRecyclerView.setAdapter(exampleAdapter);
exampleAdapter.setListener(this);
checkForFirstTimeOpen();
}
示例8: onItemSelected
import com.google.firebase.perf.metrics.AddTrace; //导入依赖的package包/类
@Override
@AddTrace(name = "onItemSelected")
public void onItemSelected(int position) {
startActivity(exampleItemModels.get(position).getActivity());
analytics.clickedOnIndividualExample(getString(exampleItemModels.get(position).getTitle()), false);
analytics.viewedScreen(getString(exampleItemModels.get(position).getTitle()), false);
}
示例9: getStationsOrderByLocation
import com.google.firebase.perf.metrics.AddTrace; //导入依赖的package包/类
/**
* @inheritDoc
*/
@Override
@AddTrace(name="StationsDb.getStationsOrderByLocation")
public Station[] getStationsOrderByLocation(Location location) {
return this.getStationsByNameOrderByLocation("", location);
}
示例10: compare
import com.google.firebase.perf.metrics.AddTrace; //导入依赖的package包/类
/**
* @inheritDoc
*/
@Override
@AddTrace(name="StationsDb.getStationsOrderByLocationAndSize")
public Station[] getStationsOrderByLocationAndSize(Location location, int limit) {
SQLiteDatabase db = this.getReadableDatabase();
double longitude = Math.round(location.getLongitude() * 1000000.0) / 1000000.0;
double latitude = Math.round(location.getLatitude() * 1000000.0) / 1000000.0;
Cursor c = db.query(
StationsDataColumns.TABLE_NAME,
new String[]{
StationsDataColumns._ID,
StationsDataColumns.COLUMN_NAME_NAME,
StationsDataColumns.COLUMN_NAME_ALTERNATIVE_NL,
StationsDataColumns.COLUMN_NAME_ALTERNATIVE_FR,
StationsDataColumns.COLUMN_NAME_ALTERNATIVE_DE,
StationsDataColumns.COLUMN_NAME_ALTERNATIVE_EN,
StationsDataColumns.COLUMN_NAME_COUNTRY_CODE,
StationsDataColumns.COLUMN_NAME_LATITUDE,
StationsDataColumns.COLUMN_NAME_LONGITUDE,
StationsDataColumns.COLUMN_NAME_AVG_STOP_TIMES,
"(" + StationsDataColumns.COLUMN_NAME_LATITUDE + " - " + latitude + ")*(" + StationsDataColumns.COLUMN_NAME_LATITUDE + " - " + latitude
+ ")+(" + StationsDataColumns.COLUMN_NAME_LONGITUDE + " - " + longitude + ")*(" + StationsDataColumns.COLUMN_NAME_LONGITUDE + " - " + longitude
+ ") AS distance"
},
null,
null,
null,
null,
"distance ASC, " + StationsDataColumns.COLUMN_NAME_AVG_STOP_TIMES + " DESC",
String.valueOf(limit)
);
Station[] stations = loadStationCursor(c);
c.close();
db.close();
if (stations == null) {
return null;
}
Arrays.sort(stations, new Comparator<Station>() {
@Override
public int compare(Station o1, Station o2) {
return Float.compare(o2.getAvgStopTimes(), o1.getAvgStopTimes());
}
});
return stations;
}