Java Code Examples for android.net.Uri#getQueryParameters()

The following examples show how to use android.net.Uri#getQueryParameters() . 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: SearchActivityBundle.java    From Hentoid with Apache License 2.0 6 votes vote down vote up
public static List<Attribute> parseSearchUri(Uri uri) {
    List<Attribute> result = new ArrayList<>();

    if (uri != null)
        for (String typeStr : uri.getQueryParameterNames()) {
            AttributeType type = AttributeType.searchByName(typeStr);
            if (type != null)
                for (String attrStr : uri.getQueryParameters(typeStr)) {
                    String[] attrParams = attrStr.split(";");
                    if (2 == attrParams.length) {
                        result.add(new Attribute(type, attrParams[1]).setId(Long.parseLong(attrParams[0])));
                    }
                }
        }

    return result;
}
 
Example 2
Source File: DecodeFormatManager.java    From QrScan with Apache License 2.0 5 votes vote down vote up
static Vector<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
  List<String> formats = inputUri.getQueryParameters(Intents.Scan.SCAN_FORMATS);
  if (formats != null && formats.size() == 1 && formats.get(0) != null){
    formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
  }
  return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 3
Source File: DecodeFormatManager.java    From vinci with Apache License 2.0 5 votes vote down vote up
static Vector<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
    List<String> formats = inputUri.getQueryParameters(Intents.Scan.SCAN_FORMATS);
    if (formats != null && formats.size() == 1 && formats.get(0) != null) {
        formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
    }
    return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 4
Source File: DecodeFormatManager.java    From QrModule with Apache License 2.0 5 votes vote down vote up
static Vector<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
    List<String> formats = inputUri.getQueryParameters(Intents.Scan.SCAN_FORMATS);
    if (formats != null && formats.size() == 1 && formats.get(0) != null) {
        formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
    }
    return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 5
Source File: DecodeFormatManager.java    From MaterialHome with Apache License 2.0 5 votes vote down vote up
static Vector<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
  List<String> formats = inputUri.getQueryParameters(Intents.Scan.SCAN_FORMATS);
  if (formats != null && formats.size() == 1 && formats.get(0) != null){
    formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
  }
  return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 6
Source File: DecodeFormatManager.java    From KSYMediaPlayer_Android with Apache License 2.0 5 votes vote down vote up
static Vector<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
  List<String> formats = inputUri.getQueryParameters(Intents.Scan.SCAN_FORMATS);
  if (formats != null && formats.size() == 1 && formats.get(0) != null){
    formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
  }
  return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 7
Source File: DecodeFormatManager.java    From LLApp with Apache License 2.0 5 votes vote down vote up
static Vector<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
  List<String> formats = inputUri.getQueryParameters(Intents.Scan.SCAN_FORMATS);
  if (formats != null && formats.size() == 1 && formats.get(0) != null){
    formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
  }
  return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 8
Source File: DecodeFormatManager.java    From mobile-manager-tool with MIT License 5 votes vote down vote up
static Vector<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
  List<String> formats = inputUri.getQueryParameters(Intents.Scan.SCAN_FORMATS);
  if (formats != null && formats.size() == 1 && formats.get(0) != null){
    formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
  }
  return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 9
Source File: DecodeFormatManager.java    From zxing with MIT License 5 votes vote down vote up
public static Set<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
    List<String> formats = inputUri.getQueryParameters(Intents.Scan.FORMATS);
    if (formats != null && formats.size() == 1 && formats.get(0) != null) {
        formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
    }
    return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 10
Source File: DecodeFormatManager.java    From android-apps with MIT License 5 votes vote down vote up
static Collection<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
  List<String> formats = inputUri.getQueryParameters(Intents.Scan.FORMATS);
  if (formats != null && formats.size() == 1 && formats.get(0) != null){
    formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
  }
  return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 11
Source File: UriUtil.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
/**
 * Removes query parameter from an Uri, if present.
 *
 * @param uri The uri.
 * @param queryParameterName The name of the query parameter.
 * @return The uri without the query parameter.
 */
public static Uri removeQueryParameter(Uri uri, String queryParameterName) {
  Uri.Builder builder = uri.buildUpon();
  builder.clearQuery();
  for (String key : uri.getQueryParameterNames()) {
    if (!key.equals(queryParameterName)) {
      for (String value : uri.getQueryParameters(key)) {
        builder.appendQueryParameter(key, value);
      }
    }
  }
  return builder.build();
}
 
Example 12
Source File: DecodeFormatManager.java    From reacteu-app with MIT License 5 votes vote down vote up
static Collection<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
  List<String> formats = inputUri.getQueryParameters(Intents.Scan.FORMATS);
  if (formats != null && formats.size() == 1 && formats.get(0) != null){
    formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
  }
  return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 13
Source File: DecodeFormatManager.java    From ScanZxing with Apache License 2.0 5 votes vote down vote up
public static Set<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
  List<String> formats = inputUri.getQueryParameters(Intents.Scan.FORMATS);
  if (formats != null && formats.size() == 1 && formats.get(0) != null){
    formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
  }
  return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 14
Source File: UriUtil.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes query parameter from an Uri, if present.
 *
 * @param uri The uri.
 * @param queryParameterName The name of the query parameter.
 * @return The uri without the query parameter.
 */
public static Uri removeQueryParameter(Uri uri, String queryParameterName) {
  Uri.Builder builder = uri.buildUpon();
  builder.clearQuery();
  for (String key : uri.getQueryParameterNames()) {
    if (!key.equals(queryParameterName)) {
      for (String value : uri.getQueryParameters(key)) {
        builder.appendQueryParameter(key, value);
      }
    }
  }
  return builder.build();
}
 
Example 15
Source File: DecodeFormatManager.java    From FoodOrdering with Apache License 2.0 5 votes vote down vote up
public static Set<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
  List<String> formats = inputUri.getQueryParameters(Intents.Scan.FORMATS);
  if (formats != null && formats.size() == 1 && formats.get(0) != null){
    formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
  }
  return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 16
Source File: DecodeFormatManager.java    From QrCodeDemo4 with MIT License 5 votes vote down vote up
static Vector<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
  List<String> formats = inputUri.getQueryParameters(Intents.Scan.SCAN_FORMATS);
  if (formats != null && formats.size() == 1 && formats.get(0) != null){
    formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
  }
  return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 17
Source File: DecodeFormatManager.java    From DoraemonKit with Apache License 2.0 5 votes vote down vote up
static Vector<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
    List<String> formats = inputUri.getQueryParameters(Intents.Scan.SCAN_FORMATS);
    if (formats != null && formats.size() == 1 && formats.get(0) != null) {
        formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
    }
    return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 18
Source File: UriUtil.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes query parameter from an Uri, if present.
 *
 * @param uri The uri.
 * @param queryParameterName The name of the query parameter.
 * @return The uri without the query parameter.
 */
public static Uri removeQueryParameter(Uri uri, String queryParameterName) {
  Uri.Builder builder = uri.buildUpon();
  builder.clearQuery();
  for (String key : uri.getQueryParameterNames()) {
    if (!key.equals(queryParameterName)) {
      for (String value : uri.getQueryParameters(key)) {
        builder.appendQueryParameter(key, value);
      }
    }
  }
  return builder.build();
}
 
Example 19
Source File: DecodeFormatManager.java    From BarcodeScanner with Apache License 2.0 5 votes vote down vote up
static Collection<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
	List<String> formats = inputUri
			.getQueryParameters(Intents.Scan.FORMATS);
	if (formats != null && formats.size() == 1 && formats.get(0) != null) {
		formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
	}
	return parseDecodeFormats(formats,
			inputUri.getQueryParameter(Intents.Scan.MODE));
}
 
Example 20
Source File: DecodeFormatManager.java    From QrCodeLib with MIT License 5 votes vote down vote up
static Vector<BarcodeFormat> parseDecodeFormats(Uri inputUri) {
    List<String> formats = inputUri.getQueryParameters(Intents.Scan.SCAN_FORMATS);
    if (formats != null && formats.size() == 1 && formats.get(0) != null) {
        formats = Arrays.asList(COMMA_PATTERN.split(formats.get(0)));
    }
    return parseDecodeFormats(formats, inputUri.getQueryParameter(Intents.Scan.MODE));
}