当前位置: 首页>>代码示例>>Java>>正文


Java AddTrace类代码示例

本文整理汇总了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;
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:19,代码来源:StationsDb.java

示例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);
  }
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:22,代码来源:LandingActivity.java

示例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;
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:12,代码来源:LiveboardSearchFragment.java

示例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;
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:31,代码来源:StationsDb.java

示例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];
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:42,代码来源:StationsDb.java

示例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);
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:9,代码来源:RouteSearchFragment.java

示例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();
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:33,代码来源:MainActivity.java

示例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);
}
 
开发者ID:mapbox,项目名称:mapbox-android-demo,代码行数:8,代码来源:MainActivity.java

示例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);
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:9,代码来源:StationsDb.java

示例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;
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:54,代码来源:StationsDb.java


注:本文中的com.google.firebase.perf.metrics.AddTrace类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。