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


Java Mint类代码示例

本文整理汇总了Java中com.splunk.mint.Mint的典型用法代码示例。如果您正苦于以下问题:Java Mint类的具体用法?Java Mint怎么用?Java Mint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onCreate

import com.splunk.mint.Mint; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_profil);
    Mint.initAndStartSession(ProfilActivity.this, GYConfiguration.SPLUNK_ID);
    Toolbar toolbar = (Toolbar) findViewById(R.id.tool_bar_back);
    setSupportActionBar(toolbar);


    titles = new CharSequence[]{getString(R.string.profil_baslik_hakkinda),
            getString(R.string.profil_baslik_basari_belgeleri)};

    adapter = new ViewPagerAdapterProfil(getSupportFragmentManager(), titles, tabSayisi);

    pager = (ViewPager) findViewById(R.id.pagerProfil);
    pager.setAdapter(adapter);


    tabs = (SlidingTabLayout) findViewById(R.id.tabsBlog);
    tabs.setDistributeEvenly(true); // tablar?n d?zenlenebilir olmas?n? sa?lar
    tabs.setSelectedIndicatorColors(getResources().getColor(R.color.beyaz_renk));

    tabs.setViewPager(pager);
}
 
开发者ID:Turkcell,项目名称:GYAppAnd,代码行数:25,代码来源:ProfilActivity.java

示例2: apiRequestComplete

import com.splunk.mint.Mint; //导入依赖的package包/类
public void apiRequestComplete(Payload response) {

        //If the fragment has been detached, we don't process the result, as is not going to be shown
        // and could cause NullPointerExceptions
        if (super.getActivity() == null) return;

		if(response.isResult()){
			try {
				json = new JSONObject(response.getResultResponse());
				refreshPointsList();
			} catch (JSONException e) {
				Mint.logException(e);
				UIUtils.showAlert(super.getActivity(), R.string.loading, R.string.error_connection);
				e.printStackTrace();
			}
		} else {
            TextView tv = (TextView) getView().findViewById(R.id.fragment_points_title);
            tv.setVisibility(View.VISIBLE);
            tv.setText(R.string.error_connection_required);
		}
	}
 
开发者ID:iSchool-Zambia,项目名称:ischool-oppia-mobile,代码行数:22,代码来源:PointsFragment.java

示例3: onActivityCreated

import com.splunk.mint.Mint; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
	super.onActivityCreated(savedInstanceState);
	
	prefs = PreferenceManager.getDefaultSharedPreferences(super.getActivity());
	webView = (WebView) super.getActivity().findViewById(R.id.about_webview);
	String lang = prefs.getString(PrefsActivity.PREF_LANGUAGE, Locale.getDefault().getLanguage());
	String url = Storage.getLocalizedFilePath(super.getActivity(), lang, "about.html");

	int defaultFontSize = Integer.parseInt(prefs.getString(PrefsActivity.PREF_TEXT_SIZE, "16"));
	webView.getSettings().setDefaultFontSize(defaultFontSize);
	
	webView.loadUrl(url);
	
	TextView versionNo = (TextView) super.getActivity().findViewById(R.id.about_versionno);
	try {
		String no = super.getActivity().getPackageManager().getPackageInfo(super.getActivity().getPackageName(), 0).versionName;
		versionNo.setText(getString(R.string.version,no));
	} catch (NameNotFoundException e) {
		Mint.logException(e);
		e.printStackTrace();
	}
}
 
开发者ID:iSchool-Zambia,项目名称:ischool-oppia-mobile,代码行数:24,代码来源:AboutFragment.java

示例4: apiRequestComplete

import com.splunk.mint.Mint; //导入依赖的package包/类
public void apiRequestComplete(Payload response) {
       //If the fragment has been detached, we don't process the result, as is not going to be shown
       // and could cause NullPointerExceptions
       if (super.getActivity() == null) return;

	if(response.isResult()){
		try {
			json = new JSONObject(response.getResultResponse());
			Log.d(TAG,json.toString(4));
			refreshBadgesList();
		} catch (JSONException e) {
			Mint.logException(e);
			UIUtils.showAlert(super.getActivity(), R.string.loading, R.string.error_connection);
			e.printStackTrace();
		}
	} else {
		TextView tv = (TextView) this.getView().findViewById(R.id.fragment_badges_title);
		tv.setVisibility(View.VISIBLE);
		tv.setText(R.string.error_connection_required);
	} 		
}
 
开发者ID:iSchool-Zambia,项目名称:ischool-oppia-mobile,代码行数:22,代码来源:BadgesFragment.java

示例5: loginUser

import com.splunk.mint.Mint; //导入依赖的package包/类
public static void loginUser(Context ctx, User user){

        //To ensure that userPrefs get saved, we force the logout of the current user
        logoutCurrentUser(ctx);

        String username = user.getUsername();
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
        SharedPreferences.Editor editor = prefs.edit();
        editor.putString(PrefsActivity.PREF_USER_NAME, username);
        editor.putString(PrefsActivity.PREF_PHONE_NO, user.getPhoneNo());
        editor.putBoolean(PrefsActivity.PREF_SCORING_ENABLED, user.isScoringEnabled());
        editor.putBoolean(PrefsActivity.PREF_BADGING_ENABLED, user.isBadgingEnabled());

        loadUserPrefs(ctx, username, editor);
        Mint.setUserIdentifier(username);
        editor.apply();
    }
 
开发者ID:iSchool-Zambia,项目名称:ischool-oppia-mobile,代码行数:18,代码来源:SessionManager.java

示例6: onCreate

import com.splunk.mint.Mint; //导入依赖的package包/类
@Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       Mint.disableNetworkMonitoring();
       Mint.initAndStartSession(this, MobileLearning.MINT_API_KEY);
       setContentView(R.layout.start_up);

       if (MobileLearning.DEVICEADMIN_ENABLED){
           boolean isGooglePlayAvailable = GooglePlayUtils.checkPlayServices(this,
                   new GooglePlayUtils.DialogListener() {
                       @Override
                       public void onErrorDialogClosed() {
                           //If Google play is not available, we need to close the app
                           StartUpActivity.this.finish();
                       }
                   });
           if (!isGooglePlayAvailable) return;
       }

       tvProgress = (TextView) this.findViewById(R.id.start_up_progress);
       prefs = PreferenceManager.getDefaultSharedPreferences(this);
       String username = SessionManager.getUsername(this);
       Mint.setUserIdentifier( username.equals("") ? "anon" : username);
}
 
开发者ID:iSchool-Zambia,项目名称:ischool-oppia-mobile,代码行数:25,代码来源:StartUpActivity.java

示例7: apiRequestComplete

import com.splunk.mint.Mint; //导入依赖的package包/类
public void apiRequestComplete(Payload response) {
	// close dialog and process results
	pDialog.dismiss();

	if(response.isResult()){
		try {
			json = new JSONObject(response.getResultResponse());
			refreshTagList();
		} catch (JSONException e) {
			Mint.logException(e);
			e.printStackTrace();
			UIUtils.showAlert(this, R.string.loading, R.string.error_connection);
		}
	} else {
		UIUtils.showAlert(this, R.string.error, R.string.error_connection_required, new Callable<Boolean>() {
			public Boolean call() throws Exception {
				TagSelectActivity.this.finish();
				return true;
			}
		});
	}

}
 
开发者ID:iSchool-Zambia,项目名称:ischool-oppia-mobile,代码行数:24,代码来源:TagSelectActivity.java

示例8: apiRequestComplete

import com.splunk.mint.Mint; //导入依赖的package包/类
public void apiRequestComplete(Payload response) {
	progressDialog.dismiss();

	if(response.isResult()){
		try {
			json = new JSONObject(response.getResultResponse());
			refreshCourseList();
		} catch (JSONException e) {
			Mint.logException(e);
			e.printStackTrace();
			UIUtils.showAlert(this, R.string.loading, R.string.error_connection);
		}
	} else {
		UIUtils.showAlert(this, R.string.error, R.string.error_connection_required, new Callable<Boolean>() {
			public Boolean call() throws Exception {
               DownloadActivity.this.finish();
               return true;
			}
		});
	}
}
 
开发者ID:iSchool-Zambia,项目名称:ischool-oppia-mobile,代码行数:22,代码来源:DownloadActivity.java

示例9: initBilling

import com.splunk.mint.Mint; //导入依赖的package包/类
public void initBilling() {
    disposeBilling();

    String base64EncodedPublicKey = Build.GOOGLE_PLAY_PUBLIC_KEY;
    mHelper = new IabHelper(context, base64EncodedPublicKey);
    mHelper.enableDebugLogging(Build.DEBUG);
    mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
        public void onIabSetupFinished(IabResult result) {
            if (mHelper == null) {
                return;
            }
            if (!result.isSuccess()) {
                return;
            }

            try {
                mHelper.queryInventoryAsync(mGotInventoryListener);
            } catch (Exception e) {
                mHelper.dispose();
                e.printStackTrace();
                Mint.logException(e);
            }
        }
    });
}
 
开发者ID:kozaxinan,项目名称:OnePlus-One-Screen-Fix,代码行数:26,代码来源:InAppUtils.java

示例10: onIabPurchaseFinished

import com.splunk.mint.Mint; //导入依赖的package包/类
public void onIabPurchaseFinished(IabResult result, Purchase purchase) {
    if (mHelper == null) {
        return;
    }
    if (result.isFailure()) {
        complain("Error purchasing: " + result.getMessage());
        return;
    }

    if (!verifyDeveloperPayload(purchase)) {
        complain("Error purchasing. Authenticity verification failed.");
        return;
    }

    String sku = purchase.getSku();
    mInventorySet.add(sku);

    if (listener != null) {
        listener.onQueryFinished(mInventorySet);
    }

    Mint.logEvent("pro_user");

    initBilling();
}
 
开发者ID:kozaxinan,项目名称:OnePlus-One-Screen-Fix,代码行数:26,代码来源:InAppUtils.java

示例11: insertIntoDb

import com.splunk.mint.Mint; //导入依赖的package包/类
private void insertIntoDb(String table, String nullHack,
        ArrayList<ContentValues> contentValueCollection) {
    if (db == null) {
        return;
    }

    try {
        db.beginTransaction();
        for (ContentValues values : contentValueCollection) {
            insertIntoDb(table, nullHack, values);
        }
        db.setTransactionSuccessful();
        db.endTransaction();
    } catch (IllegalStateException e) {
        Mint.logException(e);
    }
}
 
开发者ID:mapzen,项目名称:open,代码行数:18,代码来源:RouteFragment.java

示例12: accept

import com.splunk.mint.Mint; //导入依赖的package包/类
/**
 * 
 */
public Bundle accept() {
	Util.hideKeyboard(editName);
	customProbe.setName(editName.getText().toString());
	customProbe.setDescription(editDescription.getText().toString());
	customProbe.setFooter(editFooter.getText().toString());
	customProbe.getProbeInfo().applyBePattern(editBe.getText().toString());
	customProbe.getProbeInfo().applyProbePattern(editAttrs.getText().toString());
	customProbe.setValue(Util.parseInteger(editValue.getText().toString()));
	customProbe.setProbeType((ProbeType) editProbeType.getSelectedItem());
	customProbe.setModificatorType((ModificatorType) editModType.getSelectedItem());
	customProbe.setIconUri(iconUri);

	if (Intent.ACTION_INSERT.equals(getActivity().getIntent().getAction())) {
		DsaTabApplication.getInstance().getHero().getHeroConfiguration().addCustomProbe(customProbe);
	}

       Mint.logEvent("Save CustomProbe", MintLogLevel.Info,"Name",customProbe.getName());

	Bundle data = new Bundle();
	// TODO fill data
	return data;
}
 
开发者ID:gandulf,项目名称:DsaTab,代码行数:26,代码来源:CustomProbeEditFragment.java

示例13: accept

import com.splunk.mint.Mint; //导入依赖的package包/类
public Bundle accept() {

		Bundle data = new Bundle();

		Bundle extra = getExtra();
		if (extra != null) {
			data.putSerializable(INTENT_ID, extra.getSerializable(INTENT_ID));
		}
		String name = etName.getText().toString();
		String comment = etComment.getText().toString();
		String rules = etRules.getText().toString();

		if (TextUtils.isEmpty(rules)) {
			etRules.setError(getString(R.string.mandatory));
			return null;
		}
		data.putString(INTENT_NAME, name);
		data.putString(INTENT_COMMENT, comment);
		data.putString(INTENT_RULES, rules);
		data.putBoolean(INTENT_ACTIVE, cbActive.isChecked());

        Mint.logEvent("Save Modificator", MintLogLevel.Info,"Name",name);

		return data;
	}
 
开发者ID:gandulf,项目名称:DsaTab,代码行数:26,代码来源:ModificatorEditFragment.java

示例14: onCreate

import com.splunk.mint.Mint; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // released:
    Mint.initAndStartSession(DogWord.this, "39338683");
    // testing:
    // Mint.initAndStartSession(this, "7de6e2e0");
    Mint.logEvent("Start");
    setContentView(R.layout.activity_bog_word);
    gridLayout = (CellGridLayout) findViewById(R.id.grid);
    displayArea = (TextView) findViewById(R.id.display);
    progressArea = (TextView) findViewById(R.id.progress);
    gridLayout.setCanvasView((CanvasView) findViewById(R.id.canvas));

    try {
        // load the dictionary
        // Our dictionary is WORDS trimmed down to words that occurred at least 500 times
        // in the Google Books corpus in 2008, plus more obscure words, proper names,
        // abbreviations removed by other means.
        if (dictionary == null) {
            dictionary = LetterTree.read(new DataInputStream(getResources().openRawResource(R.raw.words)));
        }
    } catch (IOException e) {
        throw new RuntimeException("failed to read dictionary");
    }
    wordFinder = new GridWordFinder(dictionary);
    if (savedInstanceState != null) {
        onRestoreGame(savedInstanceState);
    } else {
        onNewGame();
    }
}
 
开发者ID:msokolov,项目名称:DogWord,代码行数:33,代码来源:DogWord.java

示例15: logoutCurrentUser

import com.splunk.mint.Mint; //导入依赖的package包/类
public static void logoutCurrentUser(Context ctx){
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
    SharedPreferences.Editor editor = prefs.edit();
    String username = getUsernameFromPrefs(prefs);

    //If there was a logged in user, we save her Preferences in the DB
    if (!username.equals("")){
        saveUserPrefs(ctx, username, prefs);
    }

    //Logout the user (unregister from Preferences)
    editor.putString(PrefsActivity.PREF_USER_NAME, "");
    Mint.setUserIdentifier("anon");
    editor.apply();
}
 
开发者ID:iSchool-Zambia,项目名称:ischool-oppia-mobile,代码行数:16,代码来源:SessionManager.java


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