当前位置: 首页>>代码示例>>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;未经允许,请勿转载。