• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Plastix/Kotlin-Android-Boilerplate: Kotlin Android boilerplate project with MVVM ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Plastix/Kotlin-Android-Boilerplate

开源软件地址(OpenSource Url):

https://github.com/Plastix/Kotlin-Android-Boilerplate

开源编程语言(OpenSource Language):

Kotlin 98.9%

开源软件介绍(OpenSource Introduction):

Kotlin-Android-Boilerplate CircleCI

An MVVM Boilerplate Android project written in Kotlin. This sample application fetches the top starred Kotlin repositories from Github and displays them. Inspired by @hitherejoe's Android-Boilerplate project.

Note: This project was developed before Google's introduction of Android Architecture Components at I/O 2017. I strongly encourage that you read their application architecture guide.

Screenshots

Libraries

Testing Libraries

Requirements

To compile and run the project you'll need:

Building

To build, install and run a debug version, run this from the root of the project:

./gradlew assembleDebug

Testing

To run unit tests on your machine:

./gradlew test

To run instrumentation tests on connected devices:

./gradlew connectedAndroidTest

Release Builds

A release build needs to be signed with an Android Keystore. The easiest way to generate a keystore is to open Android Studio and go to Build -> Generate Signed Apk -> Create New... After that you need to create a signing.properties file in the root directory and add the following info to it:

STORE_FILE=/path/to/your.keystore
STORE_PASSWORD=yourkeystorepass
KEY_ALIAS=projectkeyalias
KEY_PASSWORD=keyaliaspassword

Running ./gradlew assembleRelease will then build and sign a release version of the app.

FAQ

Why Kotlin?

In a nutshell, Kotlin throws all the bad parts of Java out the window and brings lots of great features from Java 8 and functional programming (Yet still compiling to Java 6 bytecode). Kotlin brings much needed language features to Android which is stuck on Java 6.

What is with all the interfaces?

By default Kotlin classes are closed (final). This makes them hard to mock unless you use a tool like Powermock. I'd rather just mock interfaces with Mockito than go through the hassle of using Powermock.

Update: Mockito 2.0 Supports mocking static and final out of the box. Thus, it removes the need for all of these interfaces.

How do I use this project?

This is a boilerplate project aimed to help bootstrap new Kotlin applications. Feel free to fork this application or use this project generator. Don't forget to change the following things for your application:

  • Application ID (Gradle)
  • Application Name (String resource)
  • Package names

Attributions




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap