Introduction:
I started writing this tutorial at the end of June, and after nearly five months, it is finally finished today. The main body of the entire tutorial consists of 148 articles in ten major chapters, covering everything from basic UI controls to the four major components, Intent, Fragment, event handling, data storage, network programming, drawing and animation, multimedia, system services, and more, all explained in detail! The code was all written in Android Studio, the entire text uses Markdown, the writing structure is clear, and it also analyzes some common problems encountered in actual development... Due to the limitations of my personal ability, although I tried my best, there may inevitably be some errors and omissions. I hope readers can be lenient and point them out; I would be extremely grateful! During the process of writing this tutorial, I have felt a lot. With this final section marking the completion, I want to get it all off my chest. Consider it a farewell, for now, to my blogging career...
Getting It All Off My Chest~
1. The Origin of This Tutorial
I remember it was an evening in May. I had just finished playing LoL with my roommates and was playing with my phone. Absentmindedly, I followed the W3C Bird's Nest official account on WeChat. After reading an article pushed by it, I felt it was somewhat interesting. So I went to Baidu and searched for "w3c Bird's Nest". I found a column called "Example". Most of the tutorials in it were basic Web tutorials, but I spotted a mobile-side tutorial with the words "Learn Android" - such a tutorial
, as someone working with Android, following the storyline, I would definitely click on that link immediately, and then something would happen... However, I didn't click... So the story ended there, haha... Of course, in the end, I did click, but during that time I just went downstairs with my roommate to have a bowl of sweet soup. Because it was a long time ago, I have forgotten the content of the tutorial, but I still remember that at the bottom of my cabinet there was a book "Android Crazy Lectures", the first programming book I bought in college. Haha, unfortunately after reading about 100 pages I gave up; it was basically a Chinese version of an API document. It was because of this book that the column "Pig's Android Beginner Road" came to be. At that time, with a try-things-out attitude, I added the WeChat of W3C's senior sister, and asked her if she needed someone to write an Android basic tutorial. Then I sent her the link to Pig's Beginner Road. The senior sister seemed very happy and then asked whether I would sell the copyright or something.Sell the copyright
? Wouldn't that mean I'd get paid?Free, yeah, that's right, not charging a single cent, on the condition that the tutorial would not be used for commercial purposes. The reason might be that I was influenced by FK's spirit of sharing, or maybe I really wanted to write an Android tutorial myself. Most big shots don't have time or look down on writing basic introductory tutorials, so let me, a nobody, write it! It would pave the way for future beginners, right?
Next, I used Baidu Mind Map to plan the content to be covered in the introductory series, learned the Markdown syntax, and then started. Initially, I didn't want to write it on coder-pig, after all, there were many abandoned tutorials on it. So I opened a small account and planned to write this new tutorial there, but the traffic was terrible. If you are a blogger and you see the stuff you spent a lot of time writing, yet nobody reads it, you'd definitely feel uncomfortable, right?... Later, I quietly moved it back to coder-pig, finished the first chapter, and also started publishing it on W3C Bird's Nest! From then on, I began the following type ofmonotonous and dull life:
Every day at work, whenever I had time, I would plan what knowledge points to write about today and what interesting examples to come up with. Then after getting off work at 5:30 PM, I would go eat, then come back and bury my head in writing. Basically, every night, I was the one who locked the door, and I usually left around 10:30. The latest I remember was one time I got so carried away that I didn't notice the time and wrote until 12:30. After finishing, I looked at the time and thought, "Damn! 12:30!!!" I was so startled that I quickly packed up my stuff and ran off. Because the park area seems to close the back door at 12:00. When I got there, I found the door closed, and my heart suddenly sank halfway. "Damn it, am I really going to sleep at the company tonight?"... But then I walked closer and saw that the door was actually half-closed, not locked, and finally I got back to the dormitory smoothly... On weekends, I generally had no plans and would go back to the company to write code. Occasionally, if the weather was good, I would play badminton with others, but most of the time I spent writing. In this way, I persisted for more than five months, and this tutorial is finally completed~
My mood right now is a little happy, a little excited, but more than anything, it's a sense of relief. Finally done~~~ Why relief? Don't worry, let me explain slowly...
2. Let Me Spill Some Details About Myself
No need to go to the group and ask God Pig where he works, how much his salary is, or whether he would take me as an apprentice. Let me spill some details about myself now! I am this year's fresh graduate (Class of 2015), from Beijing Institute of Technology, Zhuhai College (B.I.T. Zhuhai). I currently work at Southern Software Park, and I aman Android intern, and my monthly salary is only3K, and there are no five insurances and one housing fund payments at all! Yeah, you read that right, I ama 3K intern, maybe you think I'm joking, but this is the fact. Because of my willfulness during college, I still have two subjects that I haven't passed: Advanced Mathematics I and II, so I haven't gotten my graduation certificate yet... Disappointed, right? You thought the writer of this tutorial was some big shot, but it turns out he's just an intern? Haha~
Well, let me talk about my current Android skill level:
Mid-to-lower, or maybe not even mid-to-lower. I can independently complete small projects! But as for architecture and so on, it's a piece of crap; I never consider reusability, and it can be said to be garbage arbitrarily pieced together. Many emerging technologies, I've heard of them but haven't spent time researching them...
Then let me talk about mywork experience:
2015.2
At the school's spring job fair, I found my first internship. It was in Gongbei Cross-border Industrial Zone, an outsourcing company. It was more like a studio than a company; there were only 7 people in total, and later an HR even left. I stayed at this company for a bit over a month. What I gained was: I learned to read official API documentation instead of slogging through Li Gang's book; I learned to modify Hosts; I learned how to use Fragment; I wrote the UI for "Andy World" (Andy Lau Fan Club APP); and did all kinds of odd jobs. They had their own set of stuff, which was actually putting some commonly used functions into a JAR package, such as asynchronous image loading, dynamic calculation of image sizes, etc... If you needed a feature, you asked the person behind. That's right, there was no documentation... All the apps followed the same routine. Maybe all outsourcing companies are like this, caring only about results, not the process. In addition, the thing I couldn't stand most was testing: they called me and the art designer to just swipe around the screen, and as long as the app didn't crash, that was considered testing...
So, I left this company. At that time, my internship pay was 2.8k, and the regular salary was 3.2k!
2015.4
After that, I found another job over at Tsinghua Science Park. This was not an outsourcing company; they mainly did security systems and smart home products. The atmosphere was pretty good. There would occasionally be technical debates, and there were technical exchanges on Friday afternoons. They even set me up with a new computer and monitor. I felt that staying there would definitely be enjoyable! The first month was spent reading documents and looking at the projects I would take over. Life was going smoothly. But the good times didn't last long. The old employee who had been there for 3 years was leaving! He handed both of his projects to me, and I also had to start working on another new project. That wasn't a big deal; I could still barely handle it. But one of the two handed-down projects needed modifications, and a release version was required. I hadn't even had time to familiarize myself with the code... How could I manage it all? I couldn't do it alone, and I didn't want to waste time. When the deadline arrived, I wouldn't have finished anything, and that would drag others down too! I remember that the week before I wanted to resign was very depressing. By coincidence, it seems it was a Wednesday afternoon when I received a call from the HR of my current company. Then I had a phone interview with my current manager, who asked some basics about Android. We chatted quite happily. Then we arranged a time to meet, and I went over for the interview on Friday. After that, I talked about some current company conditions. My first impression was that the office environment was okay and the seats were relatively spacious. Then I told him that I hadn't gotten my graduation certificate yet and asked whether I could become a regular employee. Maybe he was in a good mood at the time and said it was fine, just talk to HR about it... However, I've been squatting here for half a year, still as an intern... Then on Monday, I submitted my resignation to the company and left the second company. In the one month at this company, I broadened my horizons and learned about things like NDK and video/audio codecs~ At that time, my probationary salary was 3.8k, and the regular salary was 4.2k!
2015.5
Um, after quitting the second company, I goofed off at school for a week and casually finished my graduation project. It was forced to be split into two apps: Sponge Watch and Let's Papapa. Looking at those two things I wrote now, I can't bear to look at them. Later I sold the project for 200 yuan... Then on Monday I came to my current company, taking over another project again. The Android master who was originally here was going to jump to Meizu. For the first time, I felt the aura of a true master. If he hadn't left and had stayed, how great would that be? Maybe I would have a completely different ending now, right? I transitioned from SVN to Git, from GUI to command line; I learned about annotations, RxJava, okhttp, GitHub, multi-channel packaging, and so on. After getting along happily for a week, the master left. Then it was just me reading the project on my own. It felt like arriving on a new continent; many things I had never seen before. I was hyped like this for nearly a month. Then the company hired another Android developer. At first I heard he had three years of work experience, and thought someone would take me to fly. But things turned out the opposite; I didn't feel a master's aura from him. Maybe he just spent three years in this industry. His skill was quite average. Compared with me, maybe he had more business experience. When I discussed Material Design with him, he had never even heard of it, didn't know Android Studio, let alone anything else. I remember asking him once how to customize a simple control. His answer was: find it online, modify it, and use it. What I wanted to ask was the implementation approach; the answer I got was: just know how to use it... Well, okay! With three years, of course the project was handed to him. The manager threw another project at me: a phone mounted on a drone to measure base station antenna angle and other information, then display it via WiFi on another phone on the ground. The phone's own data collection and data transmission were nothing; the hard part wasSerial communication(FTDI) stuff. The phone connects to a microcontroller through an OTG cable to send and receive commands. I wrestled with the API docs for a week and couldn't even write the simplest Demo - sent but not received... The same situation lasted another week. Well, the feeling of not being able to write anything really sucked. With no other choice, I had to decompile someone else's APK. I spent two days extracting the most critical parts of the code from that APK, turning more than 6,000 lines into just over 500 lines. Seeing the send/receive signal lights flashing on the microcontroller gave me a real sense of achievement! Unfortunately, the good times didn't last. The manager said to add real-time video playback. I was like... I had never worked on this stuff; how was I supposed to play with it? So I went to GitHub and found several open-source video live streaming projects. In the end, I still chose WifiCarema as the research project. Then I struggled with the h264 library compilation problem for almost two months, and still didn't solve it. In the end, the project was outsourced to people in Beijing. Well, my first project was castrated like that... Then I made a very simple little thing. And then up to now, I've been tracking and solving WebSocket issues. Our company's push notifications don't use a third party; instead, we built a push platform using Socket.IO. The reason we use Socket.IO is that one set works for all three platforms: iOS, Android, and the web. Then problems appeared such as missing messages or not receiving location updates. To this day, we haven't found the cause, and can't even reproduce the problem. We keep testing without issues, but once it gets into customers' hands, all kinds of problems occur... I'm still agonizing over this problem... I've been here for half a year, still an intern, internship salary 3K. I won't get my graduation certificate until at least next June, and probably won't be converted to full-time. Sigh...
Um, the above is my situation so far this year. A while ago, I went for an interview at Zhuimeng Network and talked with the interviewer about my current situation. He said he felt I had gone down an unorthodox path, and many things had gone off track. Then he told me that the year after graduation is very critical; once you've taken shape, it's hard to change later. Then we talked about some architecture stuff. Um, for the first time, I wanted to get into a company so badly, even if it was just a two-month internship. Well, unfortunately, I didn't get the offer. But I'm also very grateful to the great god Quan Qi for giving me a lesson. At least now I know what I should learn next. Then I interviewed at two more companies, but didn't feel much - they weren't the type I aspired to. Finally, I applied for a Meizu internship. Haha, I didn't even get an interview opportunity. It was the first time. I guess the HR didn't even see my resume...
The above is a description of my personal situation. I really aman intern dog with only 3K, so all you 10K big shots in the group, don't call this poor guy to send red envelopes during festivals...
3. Some Self-Study Tips and Resource Sharing
How to learn Android? This is probably the most commonly asked question by beginners. From the above, you already know how crap Piggy is, so the following are just my shallow views on self-learning. If you don't like it, feel free to criticise.
1) Reading Books
Recommended introductory books:
- 《First Line of CodeThis one goes without saying. Written by the great god Guo Lin, it's a must-have for getting started.
- 《Android HeroesThis one was written by Doctor (Xu Yisheng). Hehe, bought it on Double 11 and just received it today. Flipping through it, I feel the content is still fairly simple, suitable for those who have finished the first book or know a little Android.
Some friends may say there's also Li Gang's Android Crazy Handout... Well, buying it to look things up like a dictionary is fine, but I feel reading the above two books will get you started faster. Also, when reading First Line of Code, you can take it together with Piggy's basic introductory tutorial for even better results.
Recommended books for advancing:
These are also the books I plan to get next:
《Android Source Code Design Pattern Analysis and PracticeA masterpiece by He Honghui (Brother Simple) and Guan Aimin (Brother Ai). You can learn design patterns and also appreciate some of the design ideas contained in Android.
《Exploration of Android Development ArtBy Ren Yugang, it focuses on the systematization of Android knowledge and the analysis of system working mechanisms.
- 《In-Depth Analysis of Android 5.0 SystemAnalyzes the principles and concrete implementations of the main frameworks of the latest Android 5.0 system.
I haven't touched (nor bought) any of the above books yet; they are all widely praised. Recommend them here too.
2) Watching Videos
There are many Android video tutorials online. Here I'll share the Heima tutorial strongly recommended by Ji Shen:
Heima Phase 28 Android Complete Video Set, Unencrypted Full Version: Password: h7jz
Phase 52 Unencrypted Version: Password: zve8
Of course, the following video learning websites are also very good, so I recommend them too.
3) Reading Others' Technical Blogs
- CodeKK— Focused on open-source project source code analysis and sharing excellent open-source projects.
- Trinea— Performance optimization, source code analysis.
- Lao Luo's Android Journey— Android system source code analysis.
- Development Technology Frontline— Community website maintained by Mr.Simple, author of Android Source Code Design Pattern Analysis and Practice.
- Brother Ai— Guan Aimin, author of Android Source Code Design Pattern Analysis and Practice.
- Ren Yugang— Author of Exploration of Android Development Art, CSDN blog.
- Guo Lin— Author of First Line of Code, CSDN blog.
- Hong Yang— CSDN blog expert.
- Hu Kai— Focused on performance optimization.
- Zhang Mingyun— The road to learning Android.
- Drakeet— Developer of the Beike Word app.
- Xu Yisheng— Author of Android Heroes.
- Code Family— Famous blogger.
- Momo Budeyu— Famous blogger.
- Gao Jianwu— Focused on performance optimization, famous blogger on Jianshu.
- The Programmer Is Not an Ape— Famous blogger on Jianshu.
- Liao Huqiu (liaohuqiu_Qiubaiwan)— Taobao employee.
- hi Big Head Ghost hi— Has in-depth research on RxJava.
- Yangchun Noodles— Famous blogger on Jianshu.
- Xia Anming— CSDN blog expert.
- Lanting Fengyu— CSDN blog expert.
- Zhao Kaiqiang— CSDN blog expert.
- qinjuning— CSDN blog expert.
- Craftsman Like Water— CSDN blog expert.
- Zhang Xingye— CSDN blog expert.
- Coder-pig— CSDN blog expert, best introductory column.
- Keegan Xiaogang— Shared many articles about Android styles.
- Zheng Haibo— CSDN blogger, articles mostly related to custom controls.
- Wu Xiaolong— Shared many articles about AndroidDesignSupportLibrary.
- Full Speed Ahead— CSDN blog expert, mainly talks about practical skills and common problems encountered.
4) High-Quality Android Communities
- Stackoverflow— A well-known foreign Q&A community.
- V2ex— V2EX Android section.
- Android Development Technology Weekly— Long-term updates on the latest frontier information.
- Development Technology Frontline— Community website maintained by Mr.Simple, author of "Android Source Code Design Patterns"
- Days Spent on the Internet— A large base of third-party controls
- Open Source China —— OsChina
- 23code— Android classic open source code sharing
- App Developer— Sharing Android/iOS/Swift development and Internet content
- JavaApk.com— A gathering place for Android demos; some source code requires VIP purchase
- DevStore— Various demos and third-party services
5) Official Learning Websites/Wiki
6) Code/Project Downloads
Well, most of the time I would choose to look on GitHub. There are many open-source third-party projects. Be sure to Star the following:
Categorized Summary of Android Open Source Projects
Then I'll also share some code I bought on Taobao for over 50 yuan before:
5000 Sets of Android Source CodePassword: 6we63175 Sets of iOS Source CodePassword: 53v9
Most of the code above is duplicated, and most of it is based on Eclipse, but it covers a fairly wide range. You can take a look!
7) Ladder Tools
Well, if you don't want to keep editing your hosts file or don't want to set up a proxy to access blocked sites, but you still want to use Google, then you can use Lantern. Just search for "Lantern" and download it.
8) Some Other Ramblings:
Well, most of the above resources come from:Complete Collection of Android Learning Resource WebsitesPlease be sure to Star!!! Any new resources will be updated there in the future. Everyone is also welcome to share some of your own bookmarks. The above content was written by Ji Shen (base神), the top expert in Piggy's group, and of course also B Shen, Cao Shen, Jie Shen, etc. Here I am very grateful for their guidance and help all along.
I wonder if you saw the resources above and thought: collect, collect; buy, buy; download, download.
What I want to say is: if you collect something and never look at it, it's just a URL; if you download something and never look at it, it's just a pile of data; if you buy a book and never read it, it's just a stack of paper! Don't let yourself just look busy and hardworking. Who are you trying to impress? Only what you've actually learned is yours. I really like this quote:The reason the path of technology is the fairest and also the cruelest is: there are no shortcuts; it requires day-by-day accumulation and lasting passion for technology.I still remember the TEDx talk by Luo Zixiong, design director of Smartisan Technology, from a long time ago: "How to Become an Excellent Designer." He said this:Gladwell points out in his book "Outliers": "The genius in people's eyes is not extraordinary, but rather someone who has made continuous efforts. Ten thousand hours of practice is the necessary condition for anyone to go from ordinary to extraordinary." Ten thousand hours means that if you work 8 hours a day, 5 days a week, you need 5 years. You don't need to be a genius, you don't need an exceptional IQ, you don't need three heads and six arms, you don't need horns on your head. You only need persistent, unremitting effort and correct methods, and you will be able to take charge in the design field or in a profession.Although he was talking about design, many things are universal. Hehe, I mercilessly served a big bowl of chicken soup for the soul.To sum up self-study, it's simply: read more books, read blogs, do projects, read source code, and constantly summarize and reflect, so as to structure what you have learned!
4) Some Q&A
Below are some questions readers often ask; here is a unified reply:
1.Questions like, "I used to study XX" or "I'm not a programmer. I want to learn Android. Can I learn it well?"Answer: Some time ago, I saw on the Sina Weibo of Doctor (Xu Yisheng) that a 65-year-old man went to his company to ask him about Android Studio. Seeing this, do you still think the questions above are questions?
2.Questions like "XXX reports an error? What should I do?"Answer: This is the most frequent kind. In fact, many answers can be found on Baidu or Google. With so many people doing Android, is it possible that you're the only one who has encountered such a problem? Or ask on Stack Overflow, etc. First search for yourself and think, then ask others! Also, others have no obligation to answer you. Don't act as if it's a huge deal when others don't answer your question, and then turn hostile! Pay attention to the art of asking questions: organize your language, post logs, and the code at the error location, etc.
3.Wanting to add Piggy as a friend—why did I refuse?Answer: I don't know where you saw my QQ, and after reading what I wrote, you desperately wanted to add me as a friend. I want to ask: after adding me, then what? Is it more convenient to ask questions? At the beginning, I would add everyone who added me. They usually asked questions, and I would answer them patiently every time. Then they started to depend on me and came to me as soon as a problem appeared... One or two was fine, but gradually more and more people came. I spent basically all my time every day answering questions, and by the end of the day I had accomplished nothing... It's not that Piggy is aloof or looks down on beginners. I have my own things to do too, and I hope everyone can understand. If you have problems, you can ask in the group. The admins are very enthusiastic. Of course, the prerequisite is that your question shouldn't be something a simple Baidu search can answer... Don't be a freeloader!
4.The basic introductory tutorial is finished, so when will you start writing advanced tutorials?Answer: Feedback on the basic introductory tutorial was that it was well written, and it received a lot of praise and compliments. Thank you very much! As for the advanced tutorial, I had briefly conceived of it while writing the basic introduction. I used Baidu Brain Map to list an outline:

At that time, I planned to rest for a month after finishing the introductory series, then start writing the advanced series, about one topic per month. However, I may not continue writing the advanced part. You might be puzzled: why not? Let me honestly talk about some of my difficulties:
First isthe time spent writing tutorials. A simple tutorial takes me at least 2 hours, even though the content is relatively simple. For more complex ones, I might need 2 or 3 days! Writing a tutorial is different from writing notes: you need to describe clearly, write examples, post running results, etc. Notes only need to be understood by yourself, but a tutorial has to be understood by others...
Next ismy own slow progress. After finishing this basic tutorial, compared with myself before writing it, I haven't made any progress; I'm still at my previous level... Every time I go to an interview, I keep talking about those same shabby old projects. It's not interesting at all. I want to spend some time doing something. There are so many things I want to learn. For example, I started learning RxJava in May, and now it's everywhere, but I still only know the simplest usage.Lastlywriting tutorials doesn't bring me any income. As I said above, I'm an intern earning 3K. Writing this tutorial brings no income, and I even have to pay a few yuan each month to Qiniu, because the images are hosted on Qiniu's image hosting service. The damned crawler websites crawled my articles and reposted them without crediting the source, and then desperately downloaded my images... This is the download traffic from October to November!
I'm not a rich second generation. I remember I mentioned before that my father suffered from depression and couldn't work. My mother stayed in our hometown to take care of him, so there was no source of income. Fortunately, my father managed to get through it, and I no longer need to pay 20,000 yuan tuition every year. Although the monthly salary of 3K can sustain my life, as the eldest son, I have to shoulder the family's main burden! After all, I still have a younger brother and sister in college. If I could have my diploma, my current situation might be a bit better. Forget it, what's past is past. What matters more is the future! I would also like to spend every day freely researching new things and writing tutorials, but ideals are always beautiful, while reality is often cruel. I also need to live. Also, regarding the title of "Blog Expert", many friends like to use this to mock me. Actually, it's not of much use—you just receive a book if you publish more than 10 original posts per month, and most of them are old books from the C-coin mall...
5.What does Piggy plan to do next?Answer: Take a spontaneous trip, have fun for a month, and then wait for the Chinese New Year! Well, I'd love to, but unfortunately I have no money. In the coming days, I want to thoroughly understand the company's projects, fix bugs, learn some other things, write some small toys to play with, save money to buy a mechanical keyboard (ikbc G104), review advanced mathematics to prepare for the makeup exam in January, and so on. Then after the New Year, I might go to Shenzhen to look for opportunities. Maybe I'll occasionally update one or two articles, but don't expect too much. It's not that I'll never write the advanced series; I just won't write it for now. After I find a stable job and have some financial capacity, I'll start writing again.
Acknowledgments:
Well, okay, after all this rambling, I've finally spit out everything I had in my stomach.

Following the usual routine, I should say a bunch of things like "thanks to CCAV" and so on. Well! Thank you to FK, the webmaster of W3C Nest, for carefully formatting every article, and to Ji Shen, B Shen, Jie Shen, Cao Shen, etc. in Piggy's secret base for their technical support, as well as all the friends who have quietly supported Piggy. Here, I sincerely say thank you! Alright, that's all I want to say. Let this article commemorate my nearly two-year CSDN blogging career.
The End! Scatter flowers!~ It is both an end and a starting point.
to be continued...