android实现过程,Android:一个完整app开发流程
一.給出功能文檔
二.APP架構(gòu)選擇
可選MVP,MVVM
三.APP目錄結(jié)構(gòu)設(shè)置
本app基于mvp架構(gòu)。除了mvp架構(gòu)的文件。
還包含下面的文件夾:
ui (下面根據(jù)Activity劃分)
widget (自定義dialog等)
base (BaseActivity,BaseFragment)
四.劃分Activity與Fragment
有側(cè)滑欄,tab的一般用fragment
五.分辨率適配
設(shè)置sw-360dp,sw-480dp等不同的dimension目錄,根據(jù)百分比計(jì)算dp值。
image.png
六.三方庫使用
bindview使用butterknife,不同組件通信使用EventBus,定時(shí)使用RxJava,崩潰收集bugly
七.自定義view
按鈕樣式:
使用selector
按鈕背景色,包括顏色和圓角
android:shape="rectangle">
八.布局方式
使用ConstraintLayout,直接使用標(biāo)注的值來做,最簡(jiǎn)單,不要用百分比。使用layout_constraint,layout_margin完成所有布局。
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:paddingBottom="@dimen/dp_24_dp"
android:layout_height="wrap_content"
android:background="@drawable/base_bg_dialog1">
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/dp_24_dp"
android:layout_marginEnd="8dp"
android:text="@string/tip"
android:textSize="@dimen/sp_20_sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="@dimen/dp_24_dp"
android:layout_marginEnd="8dp"
android:layout_marginBottom="@dimen/dp_24_dp"
android:textSize="@dimen/sp_19_sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />
android:id="@+id/tv_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_24_dp"
android:layout_marginRight="@dimen/dp_60_dp"
android:padding="@dimen/dp_10_dp"
android:text="@string/cancel"
android:background="@drawable/bg_text_button2"
android:textSize="@dimen/sp_19_sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tv_sure"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_content" />
android:id="@+id/tv_sure"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_24_dp"
android:padding="@dimen/dp_10_dp"
android:text="@string/sure"
android:textSize="@dimen/sp_19_sp"
android:background="@drawable/bg_text_button2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/tv_cancel"
app:layout_constraintTop_toBottomOf="@+id/tv_content" />
在AndroidStudio直接肉眼布局,Android可以選擇不同的分辨率機(jī)器,水平或者垂直進(jìn)行預(yù)覽
肉眼布局法
九.編譯系統(tǒng)配置
配置sdk版本
配置abi
十.圖片配置
使用藍(lán)湖進(jìn)行圖片的協(xié)助。提供m,h,x,xx等不同分辨率的圖片
image.png
《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀總結(jié)
以上是生活随笔為你收集整理的android实现过程,Android:一个完整app开发流程的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c语言为正数无限大,无限大整数相加算法的
- 下一篇: 谷歌首提Android11,谷歌官方首次