A self-learning Android experience summary

Original address: Please scan the WeChat public account of stormzhang after the article - AndroidDeveloper

1  written in front


This article is from the blog of a colleague of our company. It is worth mentioning that she majored in finance and her first job was accounting. Out of her love for programming, she resolutely taught herself Android and quit her job. For Android development work, I posted a job posting on the official account at the beginning of this year. She has been following us for a long time, so she decided to apply for Mint. I learned it by myself, so I understand the difficulty of self-learning, which I didn’t expect. Her programming skills are very solid and comprehensive. I think it is probably because of her extraordinary love for programming that she can progress so quickly.


Facts have proved that the level of people I see is quite good. She performed well during the trial period, and her colleagues around her also recognized it. Last week, she successfully turned positive. This is an article on her blog. There are no gorgeous words, but her self-study The experience is worth learning from many of you!




A brief introduction, non-computer major, began to contact programming in 2014, and learned some Android knowledge one after another. Then at the end of the year, I resigned and started to concentrate on learning Android development. At that time, I almost finished reading the "first line of code" and had a certain understanding of the basic knowledge of Android.


2 Self-study process


Since I am used to putting some demos I have done on github, I can just use this to review the process of self-study.


In fact, there are many tutorials for getting started with android, such as the "First Line of Code" I read (strongly recommended), the official tutorial (strongly recommended), and the video courses of the Geek Academy. However, I was actually very confused after I finished learning, what about the four major components? I can only knock the demo according to the example in the book, but I can't make anything practical.


Then I thought of making an App by myself. Now I think this is useful, but it is not an efficient method.


Because making an app is not an easy task, in addition to the code work, the design and function are all to be conceived, and these two tasks are very laborious.


So, I decided to start by imitating the UI of an App.


3  Douban Demo


What I did first was a demo that very roughly imitated the Douban UI.



GitHub address: https://github.com/KayWu/Douban

Demo details: http://kaywu.github.io/2015/04/03/DoubanDemo/


Although this demo is simple, it uses several very commonly used controls, such as ViewPager (a must at home), SwipeRefreshLayout (official pull-down refresh), PagerSlidingTabStrip (commonly used ViewPager Indicator). I also used the open source library for the first time in this demo, and experienced the coolness of the gradle library.


4  Simple Zhihu Daily


After the first demo is completed, I am very happy. But come to think of it, it's not much fun to slip around. There must be some network requests and so on, but I don't have an api. It happened that I found "Pure Zhihu Daily" at this time. It is an open source App, a wiki and an analysis of Zhihu Api. So I played with it first, and then I learned a lot of things, such as the package design of java files, the use of some custom drawables, such as layer-list, shape and so on.


After I finish learning, I have to use it, so I made my own Zhihu Daily.



GitHub address: https://github.com/KayWu/Zhihu


This App largely refers to Pure Zhihu Daily. For example, network requests are also encapsulated with asynctask, gson parsing, and universal-image-loader is used for image loading.


But they added some of their own things, such as the use of webview+css styles, and the realization of the collection function. The former is through google+stackoverflow, the latter is just a simple database application.


5  imitation pile of sugar UI


现在终于可以做出一个比较简易的App了,虽然是在大量借鉴的情况下,但起码又是一个大的进步。


接下来我又做了一个高仿堆糖UI的App,纯UI,没有网络交互。


堆糖首页


GitHub地址:https://github.com/KayWu/Duitang


这个阶段UI的仿照就比较细致了,而且随着UI复杂度的提升,可能会出现 Touch 事件冲突的现象。比如热门页那里,ViewPager 的左右滑动和下拉刷新是有冲突的,我采取的解决方法可以看 github 里面的介绍。瀑布流、actionbar透明度的变化,都是通过 google+stackoverflow 一步步解决的。


这个App是手工通过玩正版App一步步拷下来的,基本是看图写代码。大量的看、写、比、改,布局写法的熟练度迅速上升。
做下来之后,不是太过复杂的界面基本可以Hold住了。


6  上线App


接下来就跑到一家创业公司做App去了。独立开发的App已在各大市场上架。但是感觉做的一般,就不上图了。App包含了第三方分享,第三方登录,自动更新,这部分都是友盟的插件来实现的,没什么技术含量。


在这个App里我实现了网络的封装,可以通过发送请求,然后自动解析json,返回java对象。看起来好像很高大上的样子,其实就是使用了 Volley 库,实现里自己的 request ,并在 parseNetworkResponse 里使用 gson 对数据进行了处理而已。


7  经验总结


回顾结束,下面讲讲一些经验总结。


1. 从简单的东西做起,然后一步步加深

我刚开始的仿豆瓣其实非常的粗略,但是通过它熟悉了Viewpager,SwipeRefreshLayout,而这两项又在后面的项目中大量运用到。自己做的东西也从以前的只有UI,到加入网络请求,再到封装网络。


2. 如果没有具体的App的点子,从模仿开始

比如可以简单的模仿一个App的UI,或者学习一个简单的开源App,然后通过学习自己制作一个类似的,尝试增加一些小功能。


3. 遇到瓶颈的时候,不要想太多,只管努力就是了
虽然上面的经历回顾写的好像顺风顺水的样子,其实完全不是,经常几天都没有啥进展。
在那时候也会对自己有些怀疑,但是不要想太多,努力下去就是了。
因为编程需要积累,而积累的反馈是具有延迟性的,一点点的量变引起质变。
比较常见的情况是,可能好几天都没有啥突破,然后过了一段时间后,突然发现自己已经进步了不少。


4. 多想想有没有更好的实现方法
比如学会用asynctask来进行网路请求后,可以想想有没有更好的实现方式。这时就可以找下相关的网络库,比如volley, retrofit之类的进行学习。


5. 学会使用开源库
Android现在的开源库已经比较强大了,比如图片加载库有picasso,universal-image-loader,glide等等。
开源库的总结可以看看 https://github.com/Trinea/android-open-project ,整理的比较全面了。

程度上升了之后可以去看看 https://github.com/android-cn/android-open-project-analysis ,了解下开源库的实现原理。


6. 把英语练好,学会翻墙
大部分碰到的问题都可以通过 google+stackoverflow 解决。


WeChat does not support external links. You can click "Read the original text" to view it. If you think it is helpful, you may wish to forward it and support it. Press and hold the QR code to subscribe.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324312022&siteId=291194637
Recommended