Code Monkey home page Code Monkey logo

androidnetstruct's Introduction

AndroidNetStruct

关于Android网络交互的框架封装
1、在进行网络请求中主要有get\post请求两种方式,这里基于Java的原始API:UrlConnection进行封装
2、在Android中进行耗时的网络请求需要使用线程,这里将线程与UrlConnection的访问封装在一起,使异步访问的方式 完成请求操作
3、针对原始的Handler进行封装,使用异步的思路,借助Java的回调进行完善
4、对于接口请求的Json串根据具体业务进行分析,可以使用缓存Json串的思路进行,在一定情况下减少对服务器接口的访 问压力,并能提高一定的APP速度
5、配合另一套图片缓存LRU,可以实现Json资源、图片资源的缓存,在一定条件下减少访问次数以及提高客户端运行速度
6、对于进行访问过程中的一些参数配置,可以使用配置文件的形式进行,不在代码中进行具体参数的设
而是通过配置文件进行读取,完成Get、Post请求参数的拼接
7、每次进行接口访问的过程中就不需要每次创建一个RequestVo对象,而是在类中直接获取配置文件中配
置好的参数,对应的一个接口一个配置文件,进行接口访问的时候,
大致步骤变为:a、创建一个该接口对应的配置文件、b、在对应Activity中调用网络访问的方法、c、获取数据并进行展示
8、关于Android进行多线程下载的操作,提高下载效率
9、对于开发过程中异常问题的处理以及归纳,构建异常收集以及异常展示
10、添加XML的接收以及访问的API,同时适用于Json解析以及XML解析

androidnetstruct's People

Contributors

dreamruner avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.