本文整理汇总了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);
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例6: initiateDisplay
import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
protected void initiateDisplay() {
IntentIntegrator intentIntegrator = getIntentIntegrator();
intentIntegrator.shareText(Base64.encodeBytes(getIdentityKeyToDisplay().serialize()));
}
示例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;
}