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


Java FirebaseAnalytics.getInstance方法代码示例

本文整理汇总了Java中com.google.firebase.analytics.FirebaseAnalytics.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java FirebaseAnalytics.getInstance方法的具体用法?Java FirebaseAnalytics.getInstance怎么用?Java FirebaseAnalytics.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.firebase.analytics.FirebaseAnalytics的用法示例。


在下文中一共展示了FirebaseAnalytics.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mAnalytics = FirebaseAnalytics.getInstance(this);

    Intent i = new Intent(SplashActivity.this, WelcomeActivity.class);
            startActivity(i);

            finish();
}
 
开发者ID:mangoblogger,项目名称:MangoBloggerAndroidApp,代码行数:12,代码来源:SplashActivity.java

示例2: onCreate

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
@Override
public void onCreate() {
    super.onCreate();
    Fabric.with(this, new Crashlytics());

    Prefs.initPrefs(this);

    if (BuildConfig.DEBUG) {
        Stetho.initializeWithDefaults(this);
    }

    FirebaseAnalytics analytics = FirebaseAnalytics.getInstance(this);

    _myComponent = DaggerMyComponent.builder()
            .myModule(new MyModule(this, analytics))
            .build();

}
 
开发者ID:StephanBezoen,项目名称:tumblrlikes,代码行数:19,代码来源:LikesApplication.java

示例3: getDefaultFATracker

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
public synchronized FirebaseAnalytics getDefaultFATracker() {
    if (mFTracker == null) {
        mFTracker = FirebaseAnalytics.getInstance(this);
        mFTracker.setAnalyticsCollectionEnabled(false);
    }
    return mFTracker;
}
 
开发者ID:xRahul,项目名称:FicsaveMiddleware,代码行数:8,代码来源:FicsaveMiddlewareApplication.java

示例4: onCreate

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_post_search);

    mRecyclerView = (RecyclerView) findViewById(R.id.rv_post_search);
    mLayoutManager = new StaggeredGridLayoutManager(SPAN_COUNT, StaggeredGridLayoutManager.VERTICAL);
    mRecyclerView.setLayoutManager(mLayoutManager);
    mSwipeRefreshLayout = findViewById(R.id.scroll_view_search);
    mSwipeRefreshLayout.setColorSchemeResources(
            android.R.color.holo_blue_bright,
            android.R.color.holo_green_light,
            android.R.color.holo_orange_light,
            android.R.color.holo_red_light);
    mAdapter = new PostViewAdapter(mListener, "search");
    mRecyclerView.setAdapter(mAdapter);

    mTAGS = getSelectedTags();
    initRefreshListener();
    initScrollListener();

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_search);
    toolbar.setSubtitle(mTAGS);

    mSwipeRefreshLayout.setRefreshing(true);
    new PullPost(0, mPAGE).execute();

    mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
    new AnalyticsUtils().getAnalytics(TAG, mTAGS, "search" ,mFirebaseAnalytics);
}
 
开发者ID:fiepi,项目名称:moebooru-android,代码行数:31,代码来源:PostSearchActivity.java

示例5: intialize

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
public static synchronized void intialize(Context context) {
    sAppContext = context;
    mFirebaseAnalytics = FirebaseAnalytics.getInstance(context);

    setProperty("DeviceType", Utils.getDeviceType(context));
    setProperty("Rooted", Boolean.toString(Utils.isRooted()));
}
 
开发者ID:gigabytedevelopers,项目名称:FireFiles,代码行数:8,代码来源:AnalyticsManager.java

示例6: send_achievement

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
public void send_achievement(final String id) {
	Bundle bundle = new Bundle();
	bundle.putString(FirebaseAnalytics.Param.ACHIEVEMENT_ID, id);

	mFirebaseAnalytics = FirebaseAnalytics.getInstance(activity);
	mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.UNLOCK_ACHIEVEMENT, bundle);

	Utils.d("Sending:AchievementUnlocked: " + id);
}
 
开发者ID:FrogSquare,项目名称:GodotFireBase,代码行数:10,代码来源:Analytics.java

示例7: onCreate

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
    mInAppPurchaseHelper = new InAppPurchaseHelper(this);
    mInAppPurchaseHelper.onCreate();
}
 
开发者ID:tranleduy2000,项目名称:text_converter,代码行数:8,代码来源:InAppPurchaseActivity.java

示例8: send_score

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
public void send_score(final String character, final int level, final int score) {
	Bundle bundle = new Bundle();
	bundle.putString(FirebaseAnalytics.Param.CHARACTER, character);
	bundle.putInt(FirebaseAnalytics.Param.LEVEL, level);
	bundle.putInt(FirebaseAnalytics.Param.SCORE, score);

	mFirebaseAnalytics = FirebaseAnalytics.getInstance(activity);
	mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.POST_SCORE, bundle);

	Utils.d("Sending:Level:Score: {" + character + "|" + level + "|" + score + "}");
}
 
开发者ID:FrogSquare,项目名称:GodotFireBase,代码行数:12,代码来源:Analytics.java

示例9: send_content

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
public void send_content(final String content_type, final String item_id) {
	Bundle bundle = new Bundle();
	bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, content_type);
	bundle.putString(FirebaseAnalytics.Param.ITEM_ID, item_id);

	mFirebaseAnalytics = FirebaseAnalytics.getInstance(activity);
	mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);

	Utils.d("Sending:Content:Item: {" + content_type + "|" + item_id + "}");
}
 
开发者ID:FrogSquare,项目名称:GodotFireBase,代码行数:11,代码来源:Analytics.java

示例10: spend_currency

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
public void spend_currency(final String item_name, final String currency_name, final int value) {
	Bundle bundle = new Bundle();
	bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, item_name);
	bundle.putString(FirebaseAnalytics.Param.VIRTUAL_CURRENCY_NAME, currency_name);
	bundle.putInt(FirebaseAnalytics.Param.VALUE, value);

	mFirebaseAnalytics = FirebaseAnalytics.getInstance(activity);
	mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SPEND_VIRTUAL_CURRENCY, bundle);

	Utils.d(
	"Sending:Currency:Spend: {" + item_name + "|" + currency_name + "|" + value + "}");
}
 
开发者ID:FrogSquare,项目名称:GodotFireBase,代码行数:13,代码来源:Analytics.java

示例11: trackBuy

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
void trackBuy(String crypto, String base) {
    FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(context);

    Bundle bundle = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, preferences.getCryptoCurrency());
    bundle.putString(FirebaseAnalytics.Param.VALUE, crypto);

    Bundle bundle2 = new Bundle();
    bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, preferences.getBaseCurrency());
    bundle.putString(FirebaseAnalytics.Param.VALUE, base);

    firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SPEND_VIRTUAL_CURRENCY, bundle);
    firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SPEND_VIRTUAL_CURRENCY, bundle2);
}
 
开发者ID:aomega08,项目名称:Keep-HODLing,代码行数:15,代码来源:BuyEvent.java

示例12: onResume

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
@Override
public void onResume() {
    super.onResume();
    FirebaseAnalytics analytics = FirebaseAnalytics.getInstance(getContext());
    analytics.setCurrentScreen(getActivity(), getClass().getSimpleName(), "Bookmark Screen");

}
 
开发者ID:mangoblogger,项目名称:MangoBloggerAndroidApp,代码行数:8,代码来源:BookmarkedFragment.java

示例13: onCreate

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_auth);
    ButterKnife.bind(this);
    firebaseAnalytics=FirebaseAnalytics.getInstance(this);
    SharedPreferences sharedPreferences= PreferenceManager.getDefaultSharedPreferences(this);
    String jsonToken= sharedPreferences.getString(Constants.EXTRA_TOKEN,null);
    if(!TextUtils.isEmpty(jsonToken)){
        Bundle bundle=new Bundle();
        bundle.putString(FirebaseAnalytics.Param.ITEM_ID,jsonToken);
        bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE,"access token json");
        firebaseAnalytics.logEvent(FirebaseAnalytics.Event.LOGIN,bundle);
        Token token=BundleUtils.convertFromJsonString(jsonToken,new TypeToken<Token>(){}.getType());
        if(token!=null){
            welcome(token);
            return;
        }
    }
    findViewById(R.id.log_in)
            .animate()
            .scaleX(1)
            .scaleY(1)
            .setStartDelay(300)
            .setDuration(300)
            .start();
}
 
开发者ID:vpaliyX,项目名称:Melophile,代码行数:28,代码来源:AuthActivity.java

示例14: onCreate

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);

    TextView textViewInstant = (TextView) findViewById(R.id.instant_status_text);
    String status = "";

    // Determine the current app context, either installed or instant, then
    // set the corresponding user property for Google Analytics.
    if (InstantApps.isInstantApp(this)) {
        status = getString(R.string.status_instant);
    } else {
        status = getString(R.string.status_installed);
    }

    mFirebaseAnalytics.setUserProperty(getString(R.string.analytics_user_prop),
            status);

    // Set a TextWatcher to make sure that the user doesn't attempt to
    // submit when a EditText is empty.
    TextWatcher enableButtonOnTextChanged = setEnableButtonOnTextChange();

    mTxtbxOrderNumber = (EditText) findViewById(R.id.txtbx_order_number);
    mTxtbxOrderNumber.addTextChangedListener(enableButtonOnTextChanged);

    mTxtbxOrderAmount = (EditText) findViewById(R.id.txtbx_order_amount);
    mTxtbxOrderAmount.addTextChangedListener(enableButtonOnTextChanged);

    mTxtbxCurrency= (EditText) findViewById(R.id.txtbx_currency);
    mTxtbxCurrency.addTextChangedListener(enableButtonOnTextChanged);

    // Add button click handler to raise e-commerce purchase event.
    Button btnSendECommerceEvent = (Button)findViewById(R.id.btn_send_ecommerce_event);
    btnSendECommerceEvent.setEnabled(false);
    btnSendECommerceEvent.setOnClickListener(mOnClickListener);

    textViewInstant.setText(String.format(getString(R.string.lbl_status_text),
            status));
}
 
开发者ID:googlesamples,项目名称:android-instant-apps,代码行数:42,代码来源:MainActivity.java

示例15: onCreate

import com.google.firebase.analytics.FirebaseAnalytics; //导入方法依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_auth);
    mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);

    mAuth = FirebaseAuth.getInstance();
    mAuthListener = new FirebaseAuth.AuthStateListener() {
        @Override
        public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
            FirebaseUser user = firebaseAuth.getCurrentUser();
            if (user != null) {
                // User is signed in
                Log.d(TAG, "onAuthStateChanged:signed_in:" + user.getUid());
                startActivity(new Intent(AuthActivity.this, HomeActivity.class));
            } else {
                // User is signed out
                Log.d(TAG, "onAuthStateChanged:signed_out");
            }
        }
    };

    mGoogleSignIn = (SignInButton)findViewById(R.id.google_sign_in);
    TextView buttonText = (TextView) mGoogleSignIn.getChildAt(0);
    buttonText.setText(R.string.login_google);
    mGoogleSignIn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            signIn();
        }
    });
    GoogleSignInOptions googleSignInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestIdToken(getString(R.string.default_web_client_id))
            .requestEmail()
            .build();
    mGoogleApiClient = new GoogleApiClient.Builder(getApplicationContext())
            .enableAutoManage(this, new GoogleApiClient.OnConnectionFailedListener() {
                @Override
                public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
                    Toast.makeText(AuthActivity.this, "Coneccao Falhou",Toast.LENGTH_SHORT).show();
                }
            })
            .addApi(Auth.GOOGLE_SIGN_IN_API, googleSignInOptions)
            .build();

    callbackManager = CallbackManager.Factory.create();

    loginButton = (LoginButton) findViewById(R.id.loginButton);
    loginButton.setReadPermissions(Arrays.asList("email"));
    loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult loginResult) {
            handleFacebookAccessToken(loginResult.getAccessToken());
        }

        @Override
        public void onCancel() {
            Toast.makeText(getApplicationContext(), R.string.cancel_login, Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onError(FacebookException error) {
            Toast.makeText(getApplicationContext(), R.string.error_login, Toast.LENGTH_SHORT).show();
        }
    });
}
 
开发者ID:braulio94,项目名称:Quadro,代码行数:67,代码来源:AuthActivity.java


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