Android 開發小貼士
AndroidTips
A collections of tips in Android developing.
前言
我們在日常開發中,會遇到各種各樣的問題,或大或小。正是通過解決這些問題,使得我們的開發技能得到進步。養成記錄的好習慣,方便自己日后查看,也方便廣大開發者能找到自己遇到的問題的解決方案。
PS:持續更新中(last update date:2016-01-26 22:05)
目錄
一.模擬器
二.Android Studio
三.Gradle
四.Android四大組件
五.動畫
六.View
七.XML
八.Java
九.混淆
十.優化
十一.優秀開發資料
十二.值得關注的Android大牛
十三.Canvas
十四.學習方法總結
十五.Kotlin
正文
一.模擬器
1.genymotion模擬器如何鎖屏?
答:在模擬器的設置-->安全-->屏幕鎖定-->選擇除<無>以外的其他選項。 然后點擊模擬器的電源按鈕即可鎖屏(或在命令行中輸入
adb shell keyevent 26
原理和按電源鍵一樣,模擬電源鍵點擊事件)
參考鏈接:http://stackoverflow.com/questions/29292060/how-to-lock-genymotion
2.genymotion模擬器如何打開輸入法軟鍵盤?
答:在設置輸入法選項中,關閉物理鍵盤即可。
3.genymotion如何安裝谷歌服務?
二.Android Studio
1.Andorid Studio中有哪些好用的插件?
答:
1>.GsonFormat:用json數據一鍵生成JavaBeans
2>. ADB Idea:ctrl + Shift + A 查找中添加常用卸載安裝app的一些操作,無需命令行
3>.android-parcelable-intellij-plugin 快速實現parcelable序列化
4>.android-butterknife-zelezny ButterKnife生成器,快速生成View聲明代碼
5>.Android WiFi ADB 使用WiFi連接而不需要USB連接Android設備達到安裝、運行、調試應用的目的。
2.Android Studio提升效率的技巧文章
答:
http://www.developerphil.com/android-studio-tips-of-the-day-roundup-1/
http://www.developerphil.com/android-studio-tips-of-the-day-roundup-2/
http://www.developerphil.com/android-studio-tips-of-the-day-roundup-3/
http://www.developerphil.com/android-studio-tips-of-the-day-roundup-4/
http://www.developerphil.com/android-studio-tips-of-the-day-roundup-5/
http://www.developerphil.com/android-studio-tips-of-the-day-roundup-6/
3.更新Android Studio報如下錯誤如何解決?
Android Studio: Error:/android-studio/gradle/gradle-2.4/lib/plugins/gradle-diagnostics-2.4.jar (No such file or directory)
更新Android Studio后,Gradle的也得到了更新。cd到gradle文件夾下查看里面gradle文件夾的名字。例如gradle-2.8。然后在Android Studio中依次打開Module Settings->Project,將Gradle version改成和之前文件夾對應的版本。Rebuild項目就好了。
4.Android Studio的常用快捷鍵?
答:
1.快速生成get,set代碼(Command+N)
2.查找方法(Find Action)(Command+Shift+A)
5.Android Studio中開啟DDMS?
答:在Android中,依次點擊Tools->Android->Android Device Monitor
6.Android Studio與Gradle教程
答:
1.擁抱 Android Studio 之一:從 ADT 到 Android Studio
三.Gradle
1.Gradle有什么教程?
2.Gradle在編譯的時候報如下錯誤:Error:Timeout waiting to lock buildscript class cache for build file ,怎么解決?
答:
Windows:刪除C:\Users\Administrator.gradle\caches.這個文件夾
OS X:刪除~/.gradle/caches這個文件夾
3.什么是Gradle,為什么在Android Studio中引進Gradle?
答:
http://stackoverflow.com/questions/16754643/what-is-gradle-in-android-studio
四.Android四大組件
1.Activity
2.Service
3.ContentProvider
4.BroadcastReceriver
五.動畫
1.關于動畫有什么教程?
3.Android屬性動畫完全解析(上),初識屬性動畫的基本用法
4. Android屬性動畫完全解析(中),ValueAnimator和ObjectAnimator的高級用法
5.Android屬性動畫完全解析(下),Interpolator和ViewPropertyAnimator的用法
6.Using animations in Android application
7 .動畫系列 - 傳統View動畫與Property動畫基礎及比較
11 .Android 動畫基礎
12 .codepath_android_guides_animations
六.View
1.View是如何繪制的?
2.Android視圖狀態及重繪流程分析,帶你一步步深入了解View(一)
3.Android視圖狀態及重繪流程分析,帶你一步步深入了解View(二)
2.如何實現自定義View?
3.Creating custom and compound Views in Android - Tutorial
3.Android touch事件分發機制
1.Managing Touch Events in a ViewGroup
2.Android事件分發機制完全解析,帶你從源碼的角度徹底理解(上)
4.ImageView使用src和background設置圖片的區別?
七.XML
1.為什么在XML代碼中有tools命名空間? 代碼如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="0"/> </LinearLayout>
tools:text,其實就是給ADT用的,用于在design頁面能夠預覽到這個屬性的值,但是當實際上運行的時候是看不到這個值的。具體可查看Designtime Layout Attributes
八.Java
九.混淆
- Android混淆有什么資料教程?
答:
2.資源混淆有什么好的技術文章?
答:
十.優化
十一.優秀開發資料
1.如何尋找優秀開源庫?
答:
2.在線查看Android源碼的網站:
- 1.http://grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android/
- 2.https://github.com/android
3.在線書籍:
4.程序員的讀書清單
答:
十二.值得關注的Android大牛
CSDN
(PS:*表示Android系統研究)
微信公眾號
- 1.Google開發者(Google_Developers)
- 2.QQ空間終端開發團隊(qzonemobiledev)
- 3.手機淘寶技術團隊MTT(AlibabaMTT)
- 4.騰訊bugly(weixinBugly)
- 5.微信移動客戶端團隊(WeMobileDev)
- 6.好東西傳送門(awesomeport)
注:括號內為微信號
Google+
公司技術團隊
- 1.美團點評技術團隊
- 2.Glow 技術團隊博客
- 3.蘑菇街技術博客
- 4.騰訊bugly團隊
- 5.騰訊ISUX團隊
- 6.BigNerdRanch團隊(國外著名培訓機構)
- 7. IBM developerworks(Java)
Android開發技術資訊網站
- 1.干貨集中營gank.io
- 2.稀土掘金
- 3.Android Weekly
</ul> </blockquote>
十三.Canvas
1.Canvas相關的教程:
- 1.Canvas and Drawables(Android官方教程)
</ul> </blockquote>
十四.學習方法/路線總結
十五.Kotlin
參與維護
歡迎Pull Request和使用issue
LICENCE
MIT
關于我
網絡ID:JohnTsai
Android開發者,手機發燒友。