kotlin guide

Discover kotlin guide, include the articles, news, trends, analysis and practical advice about kotlin guide on alibabacloud.com

Kotlin (2) makes App development easier. kotlinapp

Kotlin (2) makes App development easier. kotlinapp The previous article introduced how to build the Kotlin development environment. However, this development environment is still based on Android Studio, and Java is used for coding on Android Studio, why should we create a special Kotlin? What are the advantages of this Kotli

The Reified type of Kotlin: how to use this type (KAD 14) in the function, kotlinreified

startActivity, We need to specify the target class in the form of parameters. In Kotlin, we can simplify this operation by adding a type and passing it to the function: 1 inline fun Now, it is so easy to guide an Activity: 1 startActivity FindView type conversion Some Android Developers use Java to return the object type through the variable assignment result in a wildcard mode. In Java, you can gener

Simplifying code with Kotlin

since Google in the IO conference to designate Kotlin as the first level of Android language, Kotlin's popularity is brush brushes up, so, let us look at Kotlin what is the advantage, Google why to use it as the first language of Android? 1.100% compatible Java This is the most important point, because Kotlin is also running on the JVM, and even compiled byteco

Developing Android Applications with Kotlin (I): Introduction

About Kotlin, there have been some articles on the web, including Antonio Leiva's blog translation. However, I would like to follow them, translate them, to exercise their English translation. Experts find the problem, please timely "shoot bricks."Original title: Kotlin for Android (I): Introduction (http://antonioleiva.com/kotlin-for-android-introduction/) Origi

What Android Developers should know about Kotlin

What Android Developers should know about KotlinAndroid Developers face a dilemma in terms of language restrictions. As we all know, the current Android development only supports Java 6 (the language itself has been improved since Java 7). Therefore, we can only use one old language for development every day, this greatly reduces our productivity and forces us to write a lot of samples and vulnerable code. However, such code is hard to read and maintain. Fortunately, Android programs run on java

Create your first Android project with Kotlin (KAD 01)

Original title: Create Your first Android project using Kotlin (KAD 01)Antonio LeivaTime: Nov 21, 2016Original link: http://antonioleiva.com/create-first-android-project-kotlin/The original author begins the first lesson of the Kotlin series: Create the first Android project with Kotlin.Today, I started a group of 30 papers (KAD) on the

How does a Lambda expression work in Kotlin: setOnClickListener conversion (KAD 18), 180

view.setOnClickListener { v -> toast("Hello") } This constitutes a code block. In this way, we can define our own model language DSL. A typical example is the Kotlin reference page. Their Component DSL creates HTML through code. If you do not need Lambda parameters, you can delete the left part of the function. If you only have one parameter, this is correct. You can delete a view without using view (v: 1 view.setOnClickListener { toast("Hello")

How to Use Mockito2 mock final class (KAD 23) and kotlinmockito2 on Kotlin

: Int) {2 3 fun doSomething() {4 }5 } Let's take a look at the mock attribute values: 1 @Test fun testClosedClass() {2 val c = Mockito.mock(ClosedClass::class.java)3 `when`(c.prop).thenReturn(3)4 5 val prop = c.prop6 assertEquals(3, prop)7 } I want it to return 3. Then, I check that the value is correct. You can also check whether the property has been called: 1 verify(c).prop Conclusion As you can see, all restrictions are removed in the latest version of the m

Use Kotlin to develop Android applications (II): Create a new project, kotlinandroid

Use Kotlin to develop Android applications (II): Create a new project, kotlinandroid This is the second article about Kotlin. If you discover any problems, please continue to "shoot bricks ". Original article title: Kotlin for Android (II): Create a new project Link: http://antonioleiva.com/kotlin-android-create-proje

Google Android Studio Kotlin

Google Android Studio Kotlin Development environment ConfigurationGoogle's recent developer conference announced that Kotlin become the first language of Android development, that is, the official Android language development, it can be seen that Google Kotlin attention, this article describes the Android Kotlin Develo

Use Kotlin to create the first Android Project (KAD 01) and kotlinandroid

Use Kotlin to create the first Android Project (KAD 01) and kotlinandroid Original article title: Create your first Android project using Kotlin (KAD 01) By Antonio Leiva Time: Nov 21,201 6 Link: http://antonioleiva.com/create-first-android-project-kotlin/ First course of the Kotlin series: Use

Spring Boot and Kotlin use the Redis database configuration method, kotlinredis

Spring Boot and Kotlin use the Redis database configuration method, kotlinredis In addition to providing excellent automation support for common relational databases, Spring Boot also provides automated configuration support for many NoSQL databases, including Redis, MongoDB, Elasticsearch, solr and Cassandra. Use Redis Redis is an open-source log-type and Key-Value database that is written in ansi c and supports Network, memory-based, and persistent.

Use Anko and Kotlin to implement the dialog box and warning prompt (KAD 24) on Android and ankokotlin

title("Alert")3 positiveButton("Cool") { toast("Yess!!!") }4 negativeButton("Never Ever") { }5 neutralButton("I'll think about it")6 }.show() Of course, you can even customize the view through Anko plus: 1 alert { 2 title("Alert") 3 positiveButton("Cool") { toast("Yess!!!") } 4 customView { 5 linearLayout { 6 textView("I'm a text") 7 button("I'm a button") 8 padding = dip(16) 9 }10 }11 }.show() Progress

Attribute delegation of Kotlin: Android assignment (KAD 15) and kotlinandroid without context

. Conclusion Attribute delegation will help you make attributes more powerful, simpler, and reusable. Here we only see the standard attributes of the Kotlin library, and you can create your own attributes. For example, in this book, I have implemented the storage and retrieval of data from SharedPreference. If you want to learn more about the content and are fluent enough to create your own Android app, I suggest you get this free

Run background tasks with Kotlin Anko in Android (KAD 09)

activity dies (isfinishing returns True). In this way, we avoid asynctask errors or any other callback functions that do not notice the activity life cycle.ConclusionAs you can see, Anko provides a common set of programs that simplify our work when we write Android apps. There are many other things, such as the creation of a conversation or the maintenance of a database, which I can read in the next article.But if you really want to take the risk of creating an app with

Examples of mutual calls between kotlin and Java, and examples of kotlinjava

Examples of mutual calls between kotlin and Java, and examples of kotlinjava Preface Interoperability means that Kotlin can call interfaces of other programming languages. As long as they open interfaces, Kotlin can call their member attributes and member methods, which are incomparable to other programming languages. At the same time, you can call the API interf

It's awesome! Say goodbye to Java. To develop a full client using Kotlin.

Must be written in front: it takes only a few days to move from Java to Kotlin!This is the last article of Kotlin developing the Android series tutorial. The previous several introduced the basic syntax of Kotlin, and the differences with Java and so on. In this article, we will use the previous knowledge point to develop a Gank.io work Camp app from scratch (tha

New upgrade Kotlin system Getting started and advanced

1th. Course Introduction (Java basis required)This chapter focuses on what is Kotlin, course scheduling, and the configuration of the development environment. 2nd Chapter Data type (difficulty factor: ☆)This chapter mainly explains the basic morphology of Kotlin, and starts with the type system to introduce the types and related characteristics of Kotlin. (Knowle

Developing Android with Kotlin

View all my open source projects "open Source Labs"Welcome to increase my QQ group: "201055521", this blog client source code download "Please click"SummaryI first stated that I had not used Kotlin for a very long time, and I almost wrote these articles at the same time as I was studying. I did not try any other alternative language. Like go and Scala. So if you're really thinking about a different development language, I suggest you search for other

Kotlin operator overload: add standard operations to any class (KAD 17), kotlinkad

Kotlin operator overload: add standard operations to any class (KAD 17), kotlinkad By Antonio Leiva Time: Mar 21,201 7 Link: https://antonioleiva.com/operator-overload-kotlin/ Like other languages, some operators have been predefined in Kotlin to perform certain operations. The most typical examples are addition (+), subtraction (-), multiplication (*), Divisi

Total Pages: 15 1 .... 3 4 5 6 7 .... 15 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.