Android Studio3.2.1 Kotlin 以及 Dagger2 的使用配置

1、project 的gradle 文件中:

  • 添加google()仓库,有的时候国内无法请求数据,可以使用阿里云的国内镜像仓库 
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
  • dependencies 中添加kotlin 的plugin
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  • 版本设置,在buildscript中设置如下
ext{
    ext.kotlin_version = '1.2.71'
    ext.dragger_version ='2.15'
    ext.supportLibVersion = '28.0.0'
}

2、项目module 的gradle文件中:

  • 添加头部plugin
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'   //这个是为了使用第三方插件,在依赖中用kapt方法添加
  • 添加依赖中 compile 用implementation 代替,annotationProcessor 用kapt 代替(这个必须有 apply plugin: 'kotlin-kapt')
//kotlin 依赖添加
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
//dagger2依赖添加
implementation "com.google.dagger:dagger:$dragger_version"
kapt "com.google.dagger:dagger-compiler:$dragger_version"

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Android Studio 3.2 Development Essentials – Kotlin Edition 版本: Developing Android 9 Apps Using Android Studio 3.2, Kotlin and Android Jetpack By 作者: Neil Smyth ISBN-10 书号: 0960010939 ISBN-13 书号: 9780960010936 出版日期: 2018-12-06 pages 页数: (1037) Assuming you already have some programming experience, are ready to download Android Studio and the Android SDK, have access to a Windows, Mac or Linux system and ideas for some apps to develop, you are ready to get started. 1. Introduction 2. Setting up an Android Studio Development Environment 3. Creating an Example Android App in Android Studio 4reating an sngdroid vurtual bevice tsvb in Android tudlo 6. ATouroftheAndroid studio user terface 7. Testing Android Studio Apps on a Physical Android Device 8. The Basicsofthe Android Studio Code Editor 10. The Anatomy of an Android Application 11. An Introduction to Kotlin 12. Kotin Data Types, VariablesandNullablty 1A katHnHwCaLCd 15. An Overview of Kotin Functions andLambdas 16. The Basics of Object Oriented Programming in Kotlin 18. Understanding Android Application and Activity Lifecycles 19. Handling Android Activity state Changes 20. Android Activity State Changes by Example SJOOVImgOgheStoung nenEian Anurou agtuy. 23. AGuide to the Android Studio Layout Editor Tool 24.A Guide to the Android ConstraintLayout 26. Wartinowith constaimtLayout chansand Ratiosin AndroidStudi. Z7. An Android Studio Layout Edtor ConstraintLayout Tutorial 28. ManualXML Layout Designin Android Studio 42-Managing constraintsysing constraint sets 31. AGuide to using Instant Run in Android Studio 32. An Overview and Example of Android Event Handling AnMCCCCcMaTMCLEOLDY CDaCorc. 35. Implementing Custom Gesture and Pinch Recognition on Android 36. An Introduction to Android Fragments 37. Using Fragmentsin Android Studio-An Example 39. An Android letpack viewModel Tutorial 40. An Android Jetpack LiveData Tutorial 41. An Overview of Android Jetpack Data binding 43. Working with Android Lifecycle-Aware Components 44. An Android JetpackLifecycle Awareness Tutorial 45. An Overview of the Navigation Architecture Component 47. CreatingandManaaing overflow Menus. on Android 48. Animating User Interfaceswith the Android Transitions Framework 49. An Android Transition Tutorial using beginDelayedTransition sI wWatinawthbthe Fbatino A-tionBaittan andsnactbar 52. Creating a Tabbed Interface using the TabLayout Component 53. Working with the ReyclerView and CardViewWidgets A ANAOCTOLLIHECYCIETYISNODCOrCYew ItOrial 56. Working with the AppBar and Collapsing Toolbar Layouts 57. Implementing an Android Navigation Drawer 2 AnAndrOid StUWIO MaSteruOetalFlow Iutorial 60. Android Explicit Intents-A Worked Example 61. AndroidlmplicitIntents-A Worked Example O4AngTOIO brOadCast Intents and broaacast ihecewers 64. AnOverview of Android Startedand Bound Services 65. Implementing an Android Started Service -A WorkedExample bC. Ancdroidtocalbound Services -A WorkedExample 68. An Android Notificatons Tutorial 69. An Android Direct Reply Notification Tutorial . AnhTrcdwto. to AntowMtutiindewpi . cbom ritoal Z. AnoenwewofAndrad solteoatdbases L 73. The Android Room Persistence Library 74. An Android Tablelayoutand TableRow Tutorial 76. Acesing Cloud Storage using the Android Storage Acces Framework 7. An Android Storage Aces Framework Example 78. Implementing VideoPlaybackon Androidusing the VideoViewand Mediacontroller Clases 80. An AndroidPicture in-Picture Titorial 81. Video Recording and Image Capture on Android using Camera lntents 82. Making Runtime Permision Requestsin Andraid 6. Ancdtonubuctirfecordingoandthaybackwinghediarbyerangdhecdatecorder 85. Printingwith the Android Printing Framework 86. An Android HTML and Web Content Printing Example RAC-CC. CCACGCLXCCH-CIN9 89. An Android Studio App Links Tutorial 90. An Introduction to AndroidInstantApps 2. AMbspwtngwn Andfoasudoporectornstants. Apps 93. AGuicde tothe Android studioProfler 94. An Android Biometric Authentication Tutorial 5. Creating, TestinganduploacinganAncroidAppBunde

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值