Java Code Examples for com.google.zxing.client.result.SMSParsedResult#getNumbers()

The following examples show how to use com.google.zxing.client.result.SMSParsedResult#getNumbers() . 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: SMSResultHandler.java    From ZXing-Standalone-library with Apache License 2.0 5 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  String number = smsResult.getNumbers()[0];
  switch (index) {
    case 0:
      // Don't know of a way yet to express a SENDTO intent with multiple recipients
      sendSMS(number, smsResult.getBody());
      break;
    case 1:
      sendMMS(number, smsResult.getSubject(), smsResult.getBody());
      break;
  }
}
 
Example 2
Source File: SMSResultHandler.java    From ZXing-Standalone-library with Apache License 2.0 5 votes vote down vote up
@Override
public CharSequence getDisplayContents() {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  String[] rawNumbers = smsResult.getNumbers();
  String[] formattedNumbers = new String[rawNumbers.length];
  for (int i = 0; i < rawNumbers.length; i++) {
    formattedNumbers[i] = PhoneNumberUtils.formatNumber(rawNumbers[i]);
  }
  StringBuilder contents = new StringBuilder(50);
  ParsedResult.maybeAppend(formattedNumbers, contents);
  ParsedResult.maybeAppend(smsResult.getSubject(), contents);
  ParsedResult.maybeAppend(smsResult.getBody(), contents);
  return contents.toString();
}
 
Example 3
Source File: SMSResultHandler.java    From analyzer-of-android-for-Apache-Weex with Apache License 2.0 5 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  String number = smsResult.getNumbers()[0];
  switch (index) {
    case 0:
      // Don't know of a way yet to express a SENDTO intent with multiple recipients
      sendSMS(number, smsResult.getBody());
      break;
    case 1:
      sendMMS(number, smsResult.getSubject(), smsResult.getBody());
      break;
  }
}
 
Example 4
Source File: SMSResultHandler.java    From analyzer-of-android-for-Apache-Weex with Apache License 2.0 5 votes vote down vote up
@Override
public CharSequence getDisplayContents() {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  String[] rawNumbers = smsResult.getNumbers();
  String[] formattedNumbers = new String[rawNumbers.length];
  for (int i = 0; i < rawNumbers.length; i++) {
    formattedNumbers[i] = PhoneNumberUtils.formatNumber(rawNumbers[i]);
  }
  StringBuilder contents = new StringBuilder(50);
  ParsedResult.maybeAppend(formattedNumbers, contents);
  ParsedResult.maybeAppend(smsResult.getSubject(), contents);
  ParsedResult.maybeAppend(smsResult.getBody(), contents);
  return contents.toString();
}
 
Example 5
Source File: SMSResultHandler.java    From weex with Apache License 2.0 5 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  String number = smsResult.getNumbers()[0];
  switch (index) {
    case 0:
      // Don't know of a way yet to express a SENDTO intent with multiple recipients
      sendSMS(number, smsResult.getBody());
      break;
    case 1:
      sendMMS(number, smsResult.getSubject(), smsResult.getBody());
      break;
  }
}
 
Example 6
Source File: SMSResultHandler.java    From weex with Apache License 2.0 5 votes vote down vote up
@Override
public CharSequence getDisplayContents() {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  String[] rawNumbers = smsResult.getNumbers();
  String[] formattedNumbers = new String[rawNumbers.length];
  for (int i = 0; i < rawNumbers.length; i++) {
    formattedNumbers[i] = PhoneNumberUtils.formatNumber(rawNumbers[i]);
  }
  StringBuilder contents = new StringBuilder(50);
  ParsedResult.maybeAppend(formattedNumbers, contents);
  ParsedResult.maybeAppend(smsResult.getSubject(), contents);
  ParsedResult.maybeAppend(smsResult.getBody(), contents);
  return contents.toString();
}
 
Example 7
Source File: SMSResultHandler.java    From Study_Android_Demo with Apache License 2.0 5 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  String number = smsResult.getNumbers()[0];
  switch (index) {
    case 0:
      // Don't know of a way yet to express a SENDTO intent with multiple recipients
      sendSMS(number, smsResult.getBody());
      break;
    case 1:
      sendMMS(number, smsResult.getSubject(), smsResult.getBody());
      break;
  }
}
 
Example 8
Source File: SMSResultHandler.java    From Study_Android_Demo with Apache License 2.0 5 votes vote down vote up
@Override
public CharSequence getDisplayContents() {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  String[] rawNumbers = smsResult.getNumbers();
  String[] formattedNumbers = new String[rawNumbers.length];
  for (int i = 0; i < rawNumbers.length; i++) {
    formattedNumbers[i] = PhoneNumberUtils.formatNumber(rawNumbers[i]);
  }
  StringBuilder contents = new StringBuilder(50);
  ParsedResult.maybeAppend(formattedNumbers, contents);
  ParsedResult.maybeAppend(smsResult.getSubject(), contents);
  ParsedResult.maybeAppend(smsResult.getBody(), contents);
  return contents.toString();
}
 
Example 9
Source File: SMSResultHandler.java    From barcodescanner-lib-aar with MIT License 5 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  String number = smsResult.getNumbers()[0];
  switch (index) {
    case 0:
      // Don't know of a way yet to express a SENDTO intent with multiple recipients
      sendSMS(number, smsResult.getBody());
      break;
    case 1:
      sendMMS(number, smsResult.getSubject(), smsResult.getBody());
      break;
  }
}
 
Example 10
Source File: SMSResultHandler.java    From barcodescanner-lib-aar with MIT License 5 votes vote down vote up
@Override
public CharSequence getDisplayContents() {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  String[] rawNumbers = smsResult.getNumbers();
  String[] formattedNumbers = new String[rawNumbers.length];
  for (int i = 0; i < rawNumbers.length; i++) {
    formattedNumbers[i] = PhoneNumberUtils.formatNumber(rawNumbers[i]);
  }
  StringBuilder contents = new StringBuilder(50);
  ParsedResult.maybeAppend(formattedNumbers, contents);
  ParsedResult.maybeAppend(smsResult.getSubject(), contents);
  ParsedResult.maybeAppend(smsResult.getBody(), contents);
  return contents.toString();
}
 
Example 11
Source File: SMSResultHandler.java    From reacteu-app with MIT License 5 votes vote down vote up
@Override
public CharSequence getDisplayContents() {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  StringBuilder contents = new StringBuilder(50);
  String[] rawNumbers = smsResult.getNumbers();
  String[] formattedNumbers = new String[rawNumbers.length];
  for (int i = 0; i < rawNumbers.length; i++) {
    formattedNumbers[i] = PhoneNumberUtils.formatNumber(rawNumbers[i]);
  }
  ParsedResult.maybeAppend(formattedNumbers, contents);
  ParsedResult.maybeAppend(smsResult.getSubject(), contents);
  ParsedResult.maybeAppend(smsResult.getBody(), contents);
  return contents.toString();
}
 
Example 12
Source File: SMSResultHandler.java    From android-apps with MIT License 5 votes vote down vote up
@Override
public CharSequence getDisplayContents() {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  StringBuilder contents = new StringBuilder(50);
  String[] rawNumbers = smsResult.getNumbers();
  String[] formattedNumbers = new String[rawNumbers.length];
  for (int i = 0; i < rawNumbers.length; i++) {
    formattedNumbers[i] = PhoneNumberUtils.formatNumber(rawNumbers[i]);
  }
  ParsedResult.maybeAppend(formattedNumbers, contents);
  ParsedResult.maybeAppend(smsResult.getSubject(), contents);
  ParsedResult.maybeAppend(smsResult.getBody(), contents);
  return contents.toString();
}
 
Example 13
Source File: SMSResultHandler.java    From barterli_android with Apache License 2.0 5 votes vote down vote up
@Override
public CharSequence getDisplayContents() {
    SMSParsedResult smsResult = (SMSParsedResult) getResult();
    StringBuilder contents = new StringBuilder(50);
    String[] rawNumbers = smsResult.getNumbers();
    String[] formattedNumbers = new String[rawNumbers.length];
    for (int i = 0; i < rawNumbers.length; i++) {
        formattedNumbers[i] = PhoneNumberUtils.formatNumber(rawNumbers[i]);
    }
    ParsedResult.maybeAppend(formattedNumbers, contents);
    ParsedResult.maybeAppend(smsResult.getSubject(), contents);
    ParsedResult.maybeAppend(smsResult.getBody(), contents);
    return contents.toString();
}
 
Example 14
Source File: SMSResultHandler.java    From android-quick-response-code with Apache License 2.0 5 votes vote down vote up
@Override
public CharSequence getDisplayContents() {
    SMSParsedResult smsResult = (SMSParsedResult) getResult();
    StringBuilder contents = new StringBuilder(50);
    String[] rawNumbers = smsResult.getNumbers();
    String[] formattedNumbers = new String[rawNumbers.length];
    for (int i = 0; i < rawNumbers.length; i++) {
        formattedNumbers[i] = PhoneNumberUtils.formatNumber(rawNumbers[i]);
    }
    ParsedResult.maybeAppend(formattedNumbers, contents);
    ParsedResult.maybeAppend(smsResult.getSubject(), contents);
    ParsedResult.maybeAppend(smsResult.getBody(), contents);
    return contents.toString();
}
 
Example 15
Source File: SMSResultHandler.java    From zxingfragmentlib with Apache License 2.0 5 votes vote down vote up
@Override
public void handleButtonPress(int index) {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  String number = smsResult.getNumbers()[0];
  switch (index) {
    case 0:
      // Don't know of a way yet to express a SENDTO intent with multiple recipients
      sendSMS(number, smsResult.getBody());
      break;
    case 1:
      sendMMS(number, smsResult.getSubject(), smsResult.getBody());
      break;
  }
}
 
Example 16
Source File: SMSResultHandler.java    From zxingfragmentlib with Apache License 2.0 5 votes vote down vote up
@Override
public CharSequence getDisplayContents() {
  SMSParsedResult smsResult = (SMSParsedResult) getResult();
  String[] rawNumbers = smsResult.getNumbers();
  String[] formattedNumbers = new String[rawNumbers.length];
  for (int i = 0; i < rawNumbers.length; i++) {
    formattedNumbers[i] = PhoneNumberUtils.formatNumber(rawNumbers[i]);
  }
  StringBuilder contents = new StringBuilder(50);
  ParsedResult.maybeAppend(formattedNumbers, contents);
  ParsedResult.maybeAppend(smsResult.getSubject(), contents);
  ParsedResult.maybeAppend(smsResult.getBody(), contents);
  return contents.toString();
}