android-studiokotlinimportimport-libraries

use intellij kotlin kt file in android studio


I have written a program using intellij and want to import the code into android studio but i can't find any tutorials that have this specifically.

I am only able to find using kotlin in andoid studio or convert from kotlin to java.

I know it will be easy and that I am not looking in the right places but could really do with a pointer, I have been trying to do it all day lol im starting to loose the will!

Thanks


Solution

  • Not sure if I understood your question correctly, but if you have a bunch of code files and wanna import your code into Android Studio, the easiest way is to just create a new Android Studio Kotlin project, copy your code files from your IntelliJ project to your new Android Studio project, then adjust the code for Android.

    If you do it inside the programs instead of in the file explorer, it will even adjust the package names for you. Here's what I mean exactly by inside the programs:
    IntelliJ
    Android Studio