Skip to content
New issue

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

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

Already on GitHub? # to your account

[Android] Kotlin for app & plugin & capacitor codebase? #1227

Closed
NemoOudeis opened this issue Feb 15, 2019 · 11 comments
Closed

[Android] Kotlin for app & plugin & capacitor codebase? #1227

NemoOudeis opened this issue Feb 15, 2019 · 11 comments

Comments

@NemoOudeis
Copy link

Hi guys,

I've been browsing the capacitor source code and was wondering if you are open to modernizing & cleaning up the android codebase and plugin/app templates that are generated by npx @capacitor/cli plugin:generate, npx @capacitor/cli create and npx cap init.
I'm thinking: more recent Android gradle plugin, less unused boiler plate (that android studio project templates create, e.g. local jar dependencies, test dependencies on unused libraries, unused proguard files etc.), kotlin & androidx setup by default, app/plugin code generated in Kotlin.

If you are open to this I could contribute a pull request with what i have in mind and we can continue discussion based on that. If not - no hard feelings 😉

Cheers
Nemo

@jcesarmobile
Copy link
Member

Sure, we are open, but please, if you do it don’t do it all at once, better send small PRs that can be easily reviewed and tested as I don’t have experience with Kotlin

@untilbit
Copy link

@jcesarmobile You can request help from other mamber that have more experience working with Kotlin

@NemoOudeis
Copy link
Author

Yes I would definitely split up the work, we may need to discuss the changes based on small scope PRs. Will give it a shot next week 👍

@jcesarmobile
Copy link
Member

Closing as it was more a question about if we were open to the changes, and not a real issue.

@fkirc
Copy link
Contributor

fkirc commented Sep 14, 2020

Are you still planning to convert Capacitor-Android to Kotlin, or open to accept PRs?

This would be especially important for the embedded use case; because Kotlin is now the primary language for native Android apps.

@imhoffd
Copy link
Contributor

imhoffd commented Sep 14, 2020

My understanding is by using Kotlin in Capacitor Android, we'd be adding the Kotlin dependency to every app. I don't see this as something we want to attempt to figure out for Capacitor 3, but perhaps a later major version.

Can you elaborate on why it's important for embedded? Kotlin should interop with Java quite well.

@fkirc
Copy link
Contributor

fkirc commented Sep 14, 2020

I agree that this is a major change and therefore too late for Capacitor 3 (but I hope that Capacitor 4 is doable).

Kotlin interops well with Java, but the native Android community is moving towards "Kotlin first".
To keep up with the Android world, the question is not if, but when the move should be made.
It already starts with the template app: If the template app is written in Kotlin, then it is faster to get up to speed with a decent Android setup.

Moreover, if done right, Kotlin could improve the quality of the Android code (for example, preventing random NullpointerExceptions like #3553).

@IngAjVillalon
Copy link

Definitely, Kotlin is the future of Android,
It is also very similar to Typescript, so that it will be easier for Typescript programmers to code in Kotlin.
I join the motion to integrate CapacitorJS to Kotlin.

@riderx
Copy link

riderx commented Nov 12, 2021

any news on that ?

@Ryubal
Copy link

Ryubal commented Jan 28, 2022

It's 3 years later, any updates? Would love to see Kotlin, since it's being adopted a lot of devs by now, and it's an official Android language.

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 10, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 10, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants