Giter Site home page Giter Site logo

huabandemo's Introduction

MD版的花瓣网App

介绍

  • 作为一个花瓣网用户实在受不了Android版的崩溃而且已经一年多没有更新。工作之余网络抓包和反编译,要自己写一个App,因为毕竟是别人的项目也不指望能上架,就直接开源放到github上,如果侵权请联系我及时删除。
  • 源代码放在GitHub:项目地址
  • 下面介绍目前的工作内容

更新记录

UI

Main Drawer

Image User

架构

这个项目在写在很久之前,当时MVP架构网络上各种分析描述,但是感觉都是各说各的。不确定项目是否采用MVP架构就先动手写代码,随时准备重构项目。就在不久前Google发布Android Architecture Blueprints [beta],终于感觉这事有点靠谱了,我现在已经在动手重构项目了。 分析博文在这里:MVP架构-官方MVP项目和MVP-RxJava项目架构对比分析解读

目前的架构:

  • 基本**是采用模板方法模式,父类控制代码结构,子类实现,部分具有相同功能的再提供父类实现。 例如BaseSwipeViewPagerActivity是所有具有上拉刷新SwipeRefreshLayout和左右滑动ViewPager的子Activity类的父类。 BaseRecyclerHeadFragment是所有具有能够添加头尾View的RecyclerView的父类Fragment,内部主要实现向下滑动自动加载数据。

  • 每个Activity负责逻辑控制,其中会包含都会有一至多个Fragment负责UI显示,尽可能的不在Activity有网络操作。

技术点

由于是个人项目所以全部采用目前最新的和最热门技术。

RxJava

很多基本的逻辑使用RxJava/RxAndroid来实现异步响应,简化了很多异步回调的代码。比如欢迎界面的实现,详解点这里RxAndroid项目实践-使用RxJava响应式编码实现知乎日报的欢迎界面

Retrofit

网络模块使用Retrofit,搭配RxJava实在是爽。 同时还很简洁的实现了Https的网络访问。功能强大。Retrofit整体框架主要采用代理模式,使得简化我们的网络调用操作,真正的内部还是采用OkHttp,这就导致实现下载上传进度监听会有点麻烦。目前也已经实现不会有内存泄露,具体参考看DownloadService.java后台服务单线程图片下载实现。

Fresco

图片加载框架使用的是Fresco,同样的功能强大,但是使用复杂。我包装了一个类ImageLoadFresco,采用生成器模式,配置很多的默认实现,同时能够实现复杂操作,具体代码和介绍Fresco的封装和使用说明以及获取缓存中的Bitmap对象

其他

其他方面,每个功能模块都会提供工具类或者包装类,分化代码使得相同功能代码能够重用,减少代码量。

huabandemo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

huabandemo's Issues

Release APK

谢谢Licola :)

请问可以在github的releases里打包align过的非debug的apk吗?

反编译源代码,关于Base64.mClientInto

我反编译了最新版本的花瓣,看了下源码,但是没有找到他的APP KEY和App Secret,请问您是咋得到的?我水平太水了,源代码里面应该是有这两个的,源代码的getToken也是需要该参数,但是我始终没有找到?请问您在哪里找到的

抓包和反编译工具

你好,我对Android的抓包和反编译很感兴趣。能透露下你使用的工具么?

android studio 2.2 gradle编译不通过 app运行报错,出现混淆异常

Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(com.squareup.haha.guava.base.Joiner$1) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is not an inner class.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(com.squareup.haha.guava.collect.Iterables$2) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is not an inner class.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(com.squareup.haha.guava.collect.Iterables$3) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is not an inner class.

application不应再用单例模式

这个app很不错。不过每次启动app,系统都会初始化一个唯一的application,在四大组件使用getapplication()就可以获得的了,用了单例反而重复实例化

导入项目报错

出现
Error:(1, 0) Cause: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0

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.