com.google.android.gms.tagmanager.TagManager Java Examples

The following examples show how to use com.google.android.gms.tagmanager.TagManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MangoBlogger.java    From MangoBloggerAndroidApp with Mozilla Public License 2.0 5 votes vote down vote up
public TagManager getTagManager() {
    if (mTagManager == null) {
        // create the TagManager, save it in mTagManager
        mTagManager = TagManager.getInstance(this);
    }
    return mTagManager;
}
 
Example #2
Source File: ShadowsocksApplication.java    From ShadowsocksRR with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    app = this;
    // init toast utils
    ToastUtils.init(getApplicationContext());
    initVariable();

    if (!BuildConfig.DEBUG) {
        java.lang.System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "ERROR");
    }
    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
    checkChineseLocale(getResources().getConfiguration());
    TagManager tm = TagManager.getInstance(this);
    PendingResult<ContainerHolder> pending = tm.loadContainerPreferNonDefault("GTM-NT8WS8", R.raw.gtm_default_container);
    ResultCallback<ContainerHolder> callback = new ResultCallback<ContainerHolder>() {
        @Override
        public void onResult(@NonNull ContainerHolder holder) {
            if (!holder.getStatus().isSuccess()) {
                return;
            }
            containerHolder = holder;
            Container container = holder.getContainer();
            container.registerFunctionCallMacroCallback(SIG_FUNC, new Container.FunctionCallMacroCallback() {
                @Override
                public Object getValue(String functionName, Map<String, Object> parameters) {
                    if (SIG_FUNC.equals(functionName)) {
                        return Utils.getSignature(getApplicationContext());
                    } else {
                        return null;
                    }
                }
            });
        }
    };
    pending.setResultCallback(callback, 2, TimeUnit.SECONDS);
    JobManager.create(this).addJobCreator(new DonaldTrump());

    if (settings.getBoolean(Constants.Key.tfo, false) && TcpFastOpen.supported()) {
        mThreadPool.execute(new Runnable() {
            @Override
            public void run() {
                TcpFastOpen.enabled(settings.getBoolean(Constants.Key.tfo, false));
            }
        });
    }
}
 
Example #3
Source File: ShadowsocksApplication.java    From Maying with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    app = this;
    // init toast utils
    ToastUtils.init(getApplicationContext());
    initVariable();

    if (!BuildConfig.DEBUG) {
        java.lang.System.setProperty(LocalLog.LOCAL_LOG_LEVEL_PROPERTY, "ERROR");
    }
    AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
    checkChineseLocale(getResources().getConfiguration());
    TagManager tm = TagManager.getInstance(this);
    PendingResult<ContainerHolder> pending = tm.loadContainerPreferNonDefault("GTM-NT8WS8", R.raw.gtm_default_container);
    ResultCallback<ContainerHolder> callback = new ResultCallback<ContainerHolder>() {
        @Override
        public void onResult(@NonNull ContainerHolder holder) {
            if (!holder.getStatus().isSuccess()) {
                return;
            }
            containerHolder = holder;
            Container container = holder.getContainer();
            container.registerFunctionCallMacroCallback(SIG_FUNC, new Container.FunctionCallMacroCallback() {
                @Override
                public Object getValue(String functionName, Map<String, Object> parameters) {
                    if (SIG_FUNC.equals(functionName)) {
                        return Utils.getSignature(getApplicationContext());
                    } else {
                        return null;
                    }
                }
            });
        }
    };
    pending.setResultCallback(callback, 2, TimeUnit.SECONDS);
    JobManager.create(this).addJobCreator(new DonaldTrump());

    if (settings.getBoolean(Constants.Key.tfo, false) && TcpFastOpen.supported()) {
        mThreadPool.execute(new Runnable() {
            @Override
            public void run() {
                TcpFastOpen.enabled(settings.getBoolean(Constants.Key.tfo, false));
            }
        });
    }
}