博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Building Android Apps 30条建议
阅读量:7050 次
发布时间:2019-06-28

本文共 2963 字,大约阅读时间需要 9 分钟。

Building Android Apps — 30 things that experience made me learn the hard way

There are two kinds of people — those who learn the hard way and those who learn by taking someone’s advice. Here are some of the things I’ve learned along the way that I want to share with you:


  1. Think twice before adding any third party library, it’s a really seriouscommitment;
  2. If the user can’t see it, !;
  3. Don’t use a database unless you really need to;
  4. Hitting the 65k method count mark is gonna happen fast, I mean really fast! And ;
  5.  is the best alternative to ;
  6.  is the best networking library there is;
  7. Shorten your code with ;
  8. Combine  for maximum awesomeness!;
  9. I use  and it’s great, but I don’t use it too much because the codebase would get really messy;
  10. ;
  11. Move everything off the application thread;
  12.  your views to help you optimize the layouts and layout hierarchies so you can identify redundant views that could perhaps be removed;
  13. If you’re using gradle, speed it up anyway you ;
  14. Do  of your builds to see what is taking the build time;
  15. Use a  architecture;
  16. ;
  17. Use  to make your app more modular and therefore easier to test;
  18. Listening to  will be great for you;
  19. ;
  20. Always use  input types;
  21. Use analytics to find usage patterns and isolate bugs;
  22. Stay on top of new  (use  to test them out faster);
  23. Your services should do what they need to do and die as quickly as possible;
  24. Use the  to suggest login usernames and email addresses;
  25. Use CI (Continuous Integration) to build and distribute your beta and production .apk’s;
  26. Don’t run your own CI server, maintaining the server is time consuming because of disk space/security issues/updating the server to protect from SSL attacks, etc. Use circleci, travis or shippable, they’re cheap and it’s one less thing to worry about;
  27. If a library is massive and you are only using a small subset of its functions you should find an alternative smaller option (rely on for instance);
  28. Don’t use more modules than you actually need. If that modules are not constantly modified, it’s important to have into consideration that the time needed to compile them from scratch (CI builds are a good example), or even to check if the previous individual module build is up-to-date, can be up to almost 4x greater than to simply load that dependency as a binary .jar/.aar.
  29. Start ;
  30. Make library abstraction classes, it’ll be way easier to switch to a new library if you only need to switch in one place (e.g.AppLogger.d(“message”) can contain Log.d(TAG, message) and later realise that  is a better option);
  31. Monitor connectivity and type of connection (more data updates while on wifi?);
  32. Monitor power source and battery (more data updates while charging?Suspend updates when battery is low?);
  33. A user interface is like a joke. If you have to explain it, it’s not that good;
  34. .

If you have any questions drop me a tweet @!

 

form:https://medium.com/@cesarmcferreira/building-android-apps-30-things-that-experience-made-me-learn-the-hard-way-313680430bf9#.iz9oy4ekc

转载地址:http://qqcol.baihongyu.com/

你可能感兴趣的文章
JAVA入门到精通-第52讲-面试题讲评
查看>>
05-spark streaming & kafka
查看>>
python杂记
查看>>
cd 简化命令
查看>>
LeetCode--205--同构字符串
查看>>
python-ConfigParser模块【读写配置文件】
查看>>
wireshark使用方法总结
查看>>
Window Server 2008 R2 TFS2010 安装前的准备
查看>>
20141123
查看>>
translucent 属性
查看>>
android listView嵌套gridview的使用心得
查看>>
[ES7] Descorator: evaluated & call order
查看>>
安卓动态调试七种武器之离别钩 – Hooking(上)
查看>>
从P6 EPPM 8 R3 到P6 EPPM 16 R1 有哪些改变?
查看>>
Android Studio2.0 教程从入门到精通Windows版 - 安装篇
查看>>
Linux 系统磁盘满处理方法
查看>>
Java HashMap Demo
查看>>
yaml官方介绍
查看>>
three.js模型
查看>>
网络流24题 餐巾计划问题
查看>>