• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LocaleManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.zxing.client.android.LocaleManager的典型用法代码示例。如果您正苦于以下问题:Java LocaleManager类的具体用法?Java LocaleManager怎么用?Java LocaleManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LocaleManager类属于com.google.zxing.client.android包,在下文中一共展示了LocaleManager类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onItemClick

import com.google.zxing.client.android.LocaleManager; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
  if (position < 1) {
    // Clicked header, ignore it
    return;
  }
  int itemOffset = position - 1;
  if (itemOffset >= items.size()) {
    return;
  }
  String pageId = items.get(itemOffset).getPageId();
  String query = SearchBookContentsResult.getQuery();
  if (LocaleManager.isBookSearchUrl(activity.getISBN()) && !pageId.isEmpty()) {
    String uri = activity.getISBN();
    int equals = uri.indexOf('=');
    String volumeId = uri.substring(equals + 1);
    String readBookURI = "http://books.google." +
        LocaleManager.getBookSearchCountryTLD(activity) +
        "/books?id=" + volumeId + "&pg=" + pageId + "&vq=" + query;
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(readBookURI));
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);                    
    activity.startActivity(intent);
  }
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:25,代码来源:BrowseBookListener.java


示例2: doInBackground

import com.google.zxing.client.android.LocaleManager; //导入依赖的package包/类
@Override
protected JSONObject doInBackground(String... args) {
  try {
    // These return a JSON result which describes if and where the query was found. This API may
    // break or disappear at any time in the future. Since this is an API call rather than a
    // website, we don't use LocaleManager to change the TLD.
    String theQuery = args[0];
    String theIsbn = args[1];
    String uri;
    if (LocaleManager.isBookSearchUrl(theIsbn)) {
      int equals = theIsbn.indexOf('=');
      String volumeId = theIsbn.substring(equals + 1);
      uri = "http://www.google.com/books?id=" + volumeId + "&jscmd=SearchWithinVolume2&q=" + theQuery;
    } else {
      uri = "http://www.google.com/books?vid=isbn" + theIsbn + "&jscmd=SearchWithinVolume2&q=" + theQuery;
    }
    CharSequence content = HttpHelper.downloadViaHttp(uri, HttpHelper.ContentType.JSON);
    return new JSONObject(content.toString());
  } catch (IOException ioe) {
    Log.w(TAG, "Error accessing book search", ioe);
    return null;
  } catch (JSONException je) {
    Log.w(TAG, "Error accessing book search", je);
    return null;
  }
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:27,代码来源:SearchBookContentsActivity.java


示例3: retrieveSupplementalInfo

import com.google.zxing.client.android.LocaleManager; //导入依赖的package包/类
@Override
void retrieveSupplementalInfo() throws IOException {

  String encodedProductID = URLEncoder.encode(productID, "UTF-8");
  String uri = "https://www.google." + LocaleManager.getProductSearchCountryTLD(context)
          + "/m/products?ie=utf8&oe=utf8&scoring=p&source=zxing&q=" + encodedProductID;
  CharSequence content = HttpHelper.downloadViaHttp(uri, HttpHelper.ContentType.HTML);

  for (Pattern p : PRODUCT_NAME_PRICE_PATTERNS) {
    Matcher matcher = p.matcher(content);
    if (matcher.find()) {
      append(productID,
             source,
             new String[] { unescapeHTML(matcher.group(1)), unescapeHTML(matcher.group(2)) },
             uri);
      break;
    }
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:20,代码来源:ProductResultInfoRetriever.java


示例4: onItemClick

import com.google.zxing.client.android.LocaleManager; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
	if (position < 1) {
		// Clicked header, ignore it
		return;
	}
	int itemOffset = position - 1;
	if (itemOffset >= items.size()) {
		return;
	}
	String pageId = items.get(itemOffset).getPageId();
	String query = SearchBookContentsResult.getQuery();
	if (LocaleManager.isBookSearchUrl(activity.getISBN()) && !pageId.isEmpty()) {
		String uri = activity.getISBN();
		int equals = uri.indexOf('=');
		String volumeId = uri.substring(equals + 1);
		String readBookURI = "http://books.google." + LocaleManager.getBookSearchCountryTLD(activity) + "/books?id="
				+ volumeId + "&pg=" + pageId + "&vq=" + query;
		Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(readBookURI));
		intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
		activity.startActivity(intent);
	}
}
 
开发者ID:xiong-it,项目名称:PortraitZXing,代码行数:24,代码来源:BrowseBookListener.java


示例5: retrieveSupplementalInfo

import com.google.zxing.client.android.LocaleManager; //导入依赖的package包/类
@Override
void retrieveSupplementalInfo() throws IOException {

	String encodedProductID = URLEncoder.encode(productID, "UTF-8");
	String uri = "https://www.google." + LocaleManager.getProductSearchCountryTLD(context)
			+ "/m/products?ie=utf8&oe=utf8&scoring=p&source=zxing&q=" + encodedProductID;
	CharSequence content = HttpHelper.downloadViaHttp(uri, HttpHelper.ContentType.HTML);

	for (Pattern p : PRODUCT_NAME_PRICE_PATTERNS) {
		Matcher matcher = p.matcher(content);
		if (matcher.find()) {
			append(productID, source,
					new String[] { unescapeHTML(matcher.group(1)), unescapeHTML(matcher.group(2)) }, uri);
			break;
		}
	}
}
 
开发者ID:xiong-it,项目名称:PortraitZXing,代码行数:18,代码来源:ProductResultInfoRetriever.java


示例6: onItemClick

import com.google.zxing.client.android.LocaleManager; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
  if (position < 1) {
    // Clicked header, ignore it
    return;
  }
  int itemOffset = position - 1;
  if (itemOffset >= items.size()) {
    return;
  }
  String pageId = items.get(itemOffset).getPageId();
  String query = SearchBookContentsResult.getQuery();
  if (LocaleManager.isBookSearchUrl(activity.getISBN()) && pageId.length() > 0) {
    String uri = activity.getISBN();
    int equals = uri.indexOf('=');
    String volumeId = uri.substring(equals + 1);
    String readBookURI = "http://books.google." +
        LocaleManager.getBookSearchCountryTLD(activity) +
        "/books?id=" + volumeId + "&pg=" + pageId + "&vq=" + query;
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(readBookURI));
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);                    
    activity.startActivity(intent);
  }
}
 
开发者ID:atomsheep,项目名称:sres-app,代码行数:25,代码来源:BrowseBookListener.java


示例7: retrieveSupplementalInfo

import com.google.zxing.client.android.LocaleManager; //导入依赖的package包/类
@Override
void retrieveSupplementalInfo() throws IOException {

  String encodedProductID = URLEncoder.encode(productID, "UTF-8");
  String uri = "http://www.google." + LocaleManager.getProductSearchCountryTLD(context)
          + "/m/products?ie=utf8&oe=utf8&scoring=p&source=zxing&q=" + encodedProductID;
  CharSequence content = HttpHelper.downloadViaHttp(uri, HttpHelper.ContentType.HTML);

  for (Pattern p : PRODUCT_NAME_PRICE_PATTERNS) {
    Matcher matcher = p.matcher(content);
    if (matcher.find()) {
      append(productID,
             source,
             new String[] { unescapeHTML(matcher.group(1)), unescapeHTML(matcher.group(2)) },
             uri);
      break;
    }
  }
}
 
开发者ID:atomsheep,项目名称:sres-app,代码行数:20,代码来源:ProductResultInfoRetriever.java


示例8: onItemClick

import com.google.zxing.client.android.LocaleManager; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
    if (position < 1) {
        // Clicked header, ignore it
        return;
    }
    int itemOffset = position - 1;
    if (itemOffset >= items.size()) {
        return;
    }
    String pageId = items.get(itemOffset).getPageId();
    String query = SearchBookContentsResult.getQuery();
    if (LocaleManager.isBookSearchUrl(activity.getISBN()) && pageId.length() > 0) {
        String uri = activity.getISBN();
        int equals = uri.indexOf('=');
        String volumeId = uri.substring(equals + 1);
        String readBookURI = "http://books.google." +
                LocaleManager.getBookSearchCountryTLD(activity) +
                "/books?id=" + volumeId + "&pg=" + pageId + "&vq=" + query;
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(readBookURI));
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
        activity.startActivity(intent);
    }
}
 
开发者ID:yakovenkodenis,项目名称:Discounty,代码行数:25,代码来源:BrowseBookListener.java


示例9: doInBackground

import com.google.zxing.client.android.LocaleManager; //导入依赖的package包/类
@Override
protected JSONObject doInBackground(String... args) {
    try {
        // These return a JSON result which describes if and where the query was found. This API may
        // break or disappear at any time in the future. Since this is an API call rather than a
        // website, we don't use LocaleManager to change the TLD.
        String theQuery = args[0];
        String theIsbn = args[1];
        String uri;
        if (LocaleManager.isBookSearchUrl(theIsbn)) {
            int equals = theIsbn.indexOf('=');
            String volumeId = theIsbn.substring(equals + 1);
            uri = "http://www.google.com/books?id=" + volumeId + "&jscmd=SearchWithinVolume2&q=" + theQuery;
        } else {
            uri = "http://www.google.com/books?vid=isbn" + theIsbn + "&jscmd=SearchWithinVolume2&q=" + theQuery;
        }
        CharSequence content = HttpHelper.downloadViaHttp(uri, HttpHelper.ContentType.JSON);
        return new JSONObject(content.toString());
    } catch (IOException ioe) {
        Log.w(TAG, "Error accessing book search", ioe);
        return null;
    } catch (JSONException je) {
        Log.w(TAG, "Error accessing book search", je);
        return null;
    }
}
 
开发者ID:yakovenkodenis,项目名称:Discounty,代码行数:27,代码来源:SearchBookContentsActivity.java


示例10: retrieveSupplementalInfo

import com.google.zxing.client.android.LocaleManager; //导入依赖的package包/类
@Override
void retrieveSupplementalInfo() throws IOException {

    String encodedProductID = URLEncoder.encode(productID, "UTF-8");
    String uri = "http://www.google." + LocaleManager.getProductSearchCountryTLD(context)
            + "/m/products?ie=utf8&oe=utf8&scoring=p&source=zxing&q=" + encodedProductID;
    CharSequence content = HttpHelper.downloadViaHttp(uri, HttpHelper.ContentType.HTML);

    for (Pattern p : PRODUCT_NAME_PRICE_PATTERNS) {
        Matcher matcher = p.matcher(content);
        if (matcher.find()) {
            append(productID,
                    source,
                    new String[]{unescapeHTML(matcher.group(1)), unescapeHTML(matcher.group(2))},
                    uri);
            break;
        }
    }
}
 
开发者ID:yakovenkodenis,项目名称:Discounty,代码行数:20,代码来源:ProductResultInfoRetriever.java



注:本文中的com.google.zxing.client.android.LocaleManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Aggregator类代码示例发布时间:2022-05-21
下一篇:
Java SimpleStrategy类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap