question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
fkirccommented, 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 https://github.com/ionic-team/capacitor/pull/3553).

4reactions
jcesarmobilecommented, Feb 15, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capacitor Android Plugin Guide
Capacitor Android Plugin Guide. Building Capacitor plugins for Android involves writing Java or Kotlin to interface with Android SDKs.
Read more >
Writing a native Ionic plugin for Capacitor in less than 30 ...
Learn to access native code from your cross-platform Ionic app by creating a native plugin with Capacitor.
Read more >
Building Cross-Platform Apps with Capacitor | Ionic Article
Build cross-platform apps from a shared codebase using Ionic Capacitor and develop applications that work seamlessly across iOS and Android.
Read more >
Ionic Capacitor Tutorial - Getting Started with Capacitor
With Ionic Capacitor, adding native functionality to our apps can be easily done using a simple Plugin API for Java on Android, ...
Read more >
Building Web Native Apps with Capacitor 3 - YouTube
Build for native with the web development skills you already have. Capacitor is Ionic's native runtime that makes it easy to build web...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found