实现天猫查看物流功能

Android程序员面试宝典

自定义控件

联网

工具

数据库

源码分析相关面试题

Activity相关面试题

Service相关面试题

与XMPP相关面试题

与性能优化相关面试题

与登录相关面试题

与开发相关面试题

与人事相关面试题

《实现天猫查看物流功能》
《实现天猫查看物流功能》
《实现天猫查看物流功能》

  • 欢迎关注微信公众号

微信公众号名称:Android干货程序员

《实现天猫查看物流功能》

需要用到开源项目地址:

总的开源项目集合地址:

服务器地址:

 String url = "http://v.juhe.cn/exp/index?key=" + "申请的key"
                + "&com=" + name + "&no=" + number;

核心代码:

String name = mEtName.getText().toString();
        String number = mEtNumber.getText().toString();
        String url = "exp/index?key=" + "29ae0a17faffc5a64d8384f7ccc88ef3"
                + "&com=" + name + "&no=" + number;
        Request request = ItheimaHttp.newGetRequest(url);//apiUrl格式:"xxx/xxxxx"
        Call call = ItheimaHttp.send(request, new HttpResponseListener<Courier>() {
            @Override
            public void onResponse(Courier bean, Headers headers) {
                Collections.reverse(bean.result.list);
                adapter = new BaseRecyclerAdapter(mRecyclerView
                        , MyRecyclerViewHolder.class
                        , R.layout.layout_courier_item
                        , bean.result.list);
            }

        });

  • 快递公司编号对照表

{
  "resultcode": "200",
  "reason": "查询支持的快递公司成功",
  "result": [
    {
      "com": "顺丰",
      "no": "sf"
    },
    {
      "com": "申通",
      "no": "sto"
    },
    {
      "com": "圆通",
      "no": "yt"
    },
    {
      "com": "韵达",
      "no": "yd"
    },
    {
      "com": "天天",
      "no": "tt"
    },
    {
      "com": "EMS",
      "no": "ems"
    },
    {
      "com": "中通",
      "no": "zto"
    },
    {
      "com": "汇通",
      "no": "ht"
    },
    {
      "com": "全峰",
      "no": "qf"
    },
    {
      "com": "德邦",
      "no": "db"
    },
    {
      "com": "自动匹配",
      "no": "auto"
    },
    {
      "com": "国通",
      "no": "gt"
    },
    {
      "com": "如风达",
      "no": "rfd"
    },
    {
      "com": "京东快递",
      "no": "jd"
    },
    {
      "com": "宅急送",
      "no": "zjs"
    },
    {
      "com": "EMS国际",
      "no": "emsg"
    },
    {
      "com": "Fedex国际",
      "no": "fedex"
    },
    {
      "com": "邮政国内(挂号信)",
      "no": "yzgn"
    },
    {
      "com": "UPS国际快递",
      "no": "ups"
    },
    {
      "com": "中铁快运",
      "no": "ztky"
    }
  ],
  "error_code": 0
}
    原文作者:马伟奇
    原文地址: https://www.jianshu.com/p/00e6a71a2cdd
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞