当前位置: 首页 > 软件库 > 手机/移动开发 > >

kotlin-android-template

授权协议 MIT License
开发语言 Java
所属分类 手机/移动开发
软件类型 开源软件
地区 不详
投 递 者 柴意智
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

kotlin-android-template ��

Pre Merge Checks

A simple Github template that lets you create an Android/Kotlin project and be up and running in a few seconds.

This template is focused on delivering a project with static analysis and continuous integration already in place.

How to use ��

Just click on button to create a new repo starting from this template.

Once created don't forget to update the:

Features ��

  • 100% Kotlin-only template.
  • 3 Sample modules (Android app, Android library, Kotlin library).
  • Sample Espresso, Instrumentation & JUnit tests.
  • 100% Gradle Kotlin DSL setup.
  • CI Setup with GitHub Actions.
  • Publish to Maven Central with Github Actions.
  • Dependency versions managed via buildSrc.
  • Kotlin Static Analysis via ktlint and detekt.
  • Issues Template (bug report + feature request).
  • Pull Request Template.

Gradle Setup ��

This template is using Gradle Kotlin DSL as well as the Plugin DSL to setup the build.

Dependencies are centralized inside the Dependencies.kt file in the buildSrc folder. This provides convenient auto-completion when writing your gradle files.

Static Analysis ��

This template is using ktlint with the ktlint-gradle plugin to format your code. To reformat all the source code as well as the buildscript you can run the ktlintFormat gradle task.

This template is also using detekt to analyze the source code, with the configuration that is stored in the detekt.yml file (the file has been generated with the detektGenerateConfig task).

CI ⚙️

This template is using GitHub Actions as CI. You don't need to setup any external service and you should have a running CI once you start using this template.

There are currently the following workflows available:

Publishing ��

The template is setup to be ready to publish a library/artifact on a Maven Repository.

For every module you want to publish you simply have to add the publish plugin:

plugins {
    publish
}

To Maven Central

In order to use this template to publish on Maven Central, you need to configure some secrets on your repository:

Secret name Value
ORG_GRADLE_PROJECT_NEXUS_USERNAME The username you use to access Sonatype's services (such as Nexus and Jira)
ORG_GRADLE_PROJECT_NEXUS_PASSWORD The password you use to access Sonatype's services (such as Nexus and Jira)
ORG_GRADLE_PROJECT_SIGNING_KEY The GPG Private key to sign your artifacts. You can obtain it with gpg --armor --export-secret-keys <your@email.here> or you can create one key online on pgpkeygen.com. The key starts with a -----BEGIN PGP PRIVATE KEY BLOCK-----.
ORG_GRADLE_PROJECT_SIGNING_PWD The passphrase to unlock your private key (you picked it when creating the key).

The template already sets up Dokka for project documentation and attaches -sources.jar to your publications.

Once set up, the following workflows will take care of publishing:

  • Publish Snapshot - To publish -SNAPSHOT versions to Sonatype. The workflow is setup to run either manually (with workflow_dispatch) or on every merge.
  • Publish Release - Will publish a new release version of the libraries to Maven Central on tag pushes. You can trigger the workflow also manually if needed.

To Jitpack

If you're using JitPack, you don't need any further configuration and you can just configure the repo on JitPack.

You probably want to disable the [Publish Snapshot] and Publish Release workflows (delete the files), as Jitpack will take care of that for you.

Contributing ��

Feel free to open a issue or submit a pull request for any bugs/improvements.

  • 1.生明周期 onCreate->onStart->onResume->onPause->onStop->onDestroy 注意:当启动dialog或者dialog样式的activity的时候,之前的activity走onPause不会走onStop方法 2.启动模式 standard 被启动不管是否存在栈空间重新创建实例 singleTop 被启动只有当处于栈顶才会被重用,其他时候会创建实例

  • 0.Hello  //定义一个函数,返回值为"OK" fun task0():String{     return "OK" } //函数题就是一个简单的语句,可以去掉大括号 fun task0():String = "OK" //返回类型自推导 fun task0() = "OK" 1.Java to Kotlin Convert //AndroidStudio使用code->Convert J

  • android NDK 如何使用 JNI 与 Java&Kotlin 语言交互? http://web.archive.org/web/20120626135526/http://java.sun.com/docs/books/jni/html/jniTOC.html 主要三种情况 自带 JNIEnv 上下文,例如这种参数声明 extern "C" JNIEXPORT void JNICALLn

  • 如果你已经使用过Android Studio和Gradle,那么这一章会比较简单。我不会给出很多细节和截图,因为用户界面和细节可能会一直变化。 我们的应用是由一个简单的天气app组成,正如所使用的Google's Beginners Course in Udacity。我们可能会关注不同的事情,但是app的想法都是一样的,你会发现在一个典型的app里面会包括很多不同的东西。如果你的Android开

 相关资料
  • 另一个Kotlin团队研发的可以让开发更简单的插件是Kotlin Android Extensions。当前仅仅包括了view的绑定。这个插件自动创建了很多的属性来让我们直接访问XML中的view。这种方式不需要你在开始使用之前明确地从布局中去找到这些views。 这些属性的名字就是来自对应view的id,所以我们取id的时候要十分小心,因为它们将会是我们类中非常重要的一部分。这些属性的类型也是来

  • Android - Clean Architecture - Kotlin The purpose of this repo is to follow up Clean Architecture principles by bringing them to Android. It is worth saying that the idea is to take advantage of the K

  • 如果你还记得,现在项目已经准备好去使用Kotlin Android Extensions。当我们创建这个项目,我们就已经在build.gradle中增加了这个依赖: buldscript{ repositories { jcenter() } dependencies { classpath "org.jetbrains.kotlin:kot

  • 如何在我的中的每个项目中使用? 我的xml:

  • This repository holds 2 projects: Sample Giphy App is a test Project that displays paginated trending GIFs from Giphy and also contains search functionality. This small project is a good starting poin

  • Awesome Android Kotlin Apps �� A curated list of awesome android kotlin apps by open-source contributors. Awesome Android Kotlin Apps aims to be the starting point for developers to find an Android ap