當前位置: 首頁>>代碼示例>>Java>>正文


Java IntentIntegrator.shareText方法代碼示例

本文整理匯總了Java中com.google.zxing.integration.android.IntentIntegrator.shareText方法的典型用法代碼示例。如果您正苦於以下問題:Java IntentIntegrator.shareText方法的具體用法?Java IntentIntegrator.shareText怎麽用?Java IntentIntegrator.shareText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.zxing.integration.android.IntentIntegrator的用法示例。


在下文中一共展示了IntentIntegrator.shareText方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: showQRCode

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
private void showQRCode() {
    String mystring = new JSONObject(prefsMap).toString();
    Log.d(TAG, "Serialized: " + mystring);
    String compressedstring = JoH.compressString(mystring);
    Log.d(TAG, "Compressed: " + compressedstring);

    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.shareText(qrmarker + compressedstring);
}
 
開發者ID:NightscoutFoundation,項目名稱:xDrip,代碼行數:10,代碼來源:DisplayQRCode.java

示例2: shareConfigurationAsQR

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
/**
 * Start an intent to share the configuration as QR-Code via Barcode Scanner
 */
private void shareConfigurationAsQR()
{
	IntentIntegrator QRIntegrator = new IntentIntegrator(this);
	layoutContainer.syncStateFromLayoutToEnigma();
	String encoded_state = APP_ID+"/"+layoutContainer.getEnigma().getEncodedState().toString(16);
	Log.d(APP_ID, "Sharing configuration to QR: "+encoded_state);
	QRIntegrator.shareText(encoded_state);
}
 
開發者ID:vanitasvitae,項目名稱:EnigmAndroid,代碼行數:12,代碼來源:MainActivity.java

示例3: displayQRCode

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
private void displayQRCode ()
{
    
    try
    {
        if ( getCurrentChatSession() != null
                &&  getCurrentChatSession().getOtrChatSession() != null)
        {
            
        
            String localFingerprint = getCurrentChatSession().getOtrChatSession().getLocalFingerprint();
            
            if (localFingerprint != null)
             {
                IntentIntegrator.shareText(this, localFingerprint);
                return;
             }
            
        }
        
    }
    catch (RemoteException re)
    {}
    
    //did not work
    Toast.makeText(this, "Please start a secure conversation before scanning codes", Toast.LENGTH_LONG).show();
 }
 
開發者ID:prive,項目名稱:prive-android,代碼行數:28,代碼來源:NewChatActivity.java

示例4: generateSalt

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
private void generateSalt() {
    final IntentIntegrator qr = new IntentIntegrator(this);
    final SecureRandom sr = new SecureRandom();
    final byte[] salt = new byte[512];
    sr.nextBytes(salt);
    final String saltb64 = new String(Base64.encodeBase64(salt)).replaceAll("\\s", "");
    setSaltPref(saltb64);
    qr.addExtra(Intents.Encode.SHOW_CONTENTS, false);
    qr.shareText(saltb64);
}
 
開發者ID:pdudits,項目名稱:supergenpass-android,代碼行數:11,代碼來源:Preferences.java

示例5: generateSalt

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
private void generateSalt() {
    final IntentIntegrator qr = new IntentIntegrator(getActivity());
    final SecureRandom sr = new SecureRandom();
    final byte[] salt = new byte[SALT_SIZE_BYTES];
    sr.nextBytes(salt);
    final String saltb64 = PATTERN_WHITESPACE.matcher(new String(Base64.encodeBase64(salt)))
            .replaceAll("");
    ((Preferences) getFragmentManager().findFragmentById(R.id.preferences))
            .setSaltPref(saltb64);
    qr.addExtra("SHOW_CONTENTS", false);
    qr.shareText(saltb64);
}
 
開發者ID:xxv,項目名稱:SuperGenPass,代碼行數:13,代碼來源:Preferences.java

示例6: initiateDisplay

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
protected void initiateDisplay() {
  IntentIntegrator intentIntegrator = getIntentIntegrator();
  intentIntegrator.shareText(Base64.encodeBytes(getIdentityKeyToDisplay().serialize()));
}
 
開發者ID:redcracker,項目名稱:TextSecure,代碼行數:5,代碼來源:KeyScanningActivity.java

示例7: onOptionsItemSelected

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
			case android.R.id.home:
				return tabManager.onAndroidHome(item);
			case R.id.menu_login:
				Intent intent = new Intent(this, ConnectionAssistantActivity.class);
				lastTab = tabManager.getCurrentTab();
//				tabManager.switchToTab(RallyeTabManager.TAB_WAIT_FOR_MODEL);
				startActivityForResult(intent, ConnectionAssistantActivity.REQUEST_CODE);
				break;
			case R.id.menu_logout:
				new AlertDialog.Builder(this).setTitle(R.string.logout).setMessage(R.string.are_you_sure).setCancelable(true).setNegativeButton(android.R.string.cancel, null).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
					@Override
					public void onClick(DialogInterface dialog, int which) {
						server.logout();
					}
				}).create().show();
				server.tryLogout();
				break;
			case R.id.menu_upload_overview:
				intent = new Intent(this, UploadOverviewActivity.class);
				startActivity(intent);
				break;
			case R.id.menu_share_barcode:
				IntentIntegrator zx = new IntentIntegrator(this);
				ObjectMapper mapper = Serialization.getJsonInstance();
				try {
					zx.shareText(mapper.writeValueAsString(server.exportLogin()));
				} catch (JsonProcessingException e) {
					Log.e(THIS, "Could not serialize exported Login", e);
					Toast.makeText(this, R.string.export_barcode_error, Toast.LENGTH_SHORT).show();
				}
				break;
//			case R.id.menu_reconnect: //there is no more temporary offline, we cannot know if push messages will reach us
//				model.reconnect();
//				break;
			case R.id.menu_settings:
				intent = new Intent(this, SettingsActivity.class);
				startActivity(intent);
				break;
			default:
				return false;
		}
		return true;
	}
 
開發者ID:jakobwenzel,項目名稱:rallye-android-client,代碼行數:47,代碼來源:MainActivity.java


注:本文中的com.google.zxing.integration.android.IntentIntegrator.shareText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。