Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write Kotlin version of code samples. #169

Closed
savekirk opened this issue May 24, 2016 · 8 comments
Closed

Write Kotlin version of code samples. #169

savekirk opened this issue May 24, 2016 · 8 comments

Comments

@savekirk
Copy link

Kotlin for Android App development is gaining some traction and some developers have started using it in production. Gradle also recently announced Gradle Script Kotlin.

It will be helpful to have Kotlin version of the code samples.

Some suggestions on how to go about it:

  • Write the Java and Kotlin codes side by side. e.g.

    Java
    Intent intent = new Intent(context, activity);
    Kotlin
    val intent = Intent(context, activity)

  • Create different page for the Kotlin stuff.

  • A different repo??

  • Or any other better suggestion

I am willing to contribute if this is possible.

@rpip
Copy link

rpip commented May 24, 2016

👍

@nesquena
Copy link
Member

Thanks for reaching out about this. I am not sure of the best way to go about this given how many guides there are and how noisy it would be to have two languages on the same page.

I would love to see (as a start), a separate Kotlin language guide primer page created on the wiki which compares the Java vs Kotlin way of coding common files and actions (i.e Activity, Fragment, Intent). For now, let's create that as a separate Kotlin page and we can expand later from there.

@savekirk
Copy link
Author

That is a fair concern about the notes getting noisy. So I will go ahead and create new Kotlin guide content and then add the link to it here for review.

@nesquena
Copy link
Member

Sounds good, thanks for putting together a first draft. I'm sure people will appreciate having a clear, concise Kotlin primer available. We can link to other helpful Kotlin resources as well.

@savekirk
Copy link
Author

Draft available now https://hackmd.io/s/H12nvIMQ

@nesquena
Copy link
Member

nesquena commented May 27, 2016

@savekirk You did an excellent job, the draft looks great. Here's the first published version. I've added this to the "Getting Started" section on the home page as well. Would love for others to take a look at continue to add / improve to the guide as well. We've announced the guide here. I've added some attribution to the guide indicating that you are the original author, thanks for putting that together.

I wish github wiki had a "native" way to create a "language toggle" in guides. We have this same issue with iOS (Swift vs Obj-c)

@rogerhu
Copy link
Member

rogerhu commented May 31, 2016

I do think the first place to start is actually documenting how to use Kotlin with Gradle given this announcement (http://www2.gradle.com/e/68052/blog-kotlin-meets-gradle-/72yb5y/171267988). It will hopefully be far easier for new people to learn how to use Kotlin than Groovy syntax.

@savekirk
Copy link
Author

Gradle buildscript with Kotlin is not yet ready for prime use. We might want to wait till they have stabilized it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants