<< Return to the general catalog
Take a look at Quickstart kotlin
programming, which doesn't involve Android
development at all. Now that it has nothing to do with it for the time being Android
, the first problem to be solved is how to run a piece of kotlin
code independently.
To get started Android Studio
, unfortunately, Android Studio
as a tool dedicated to developing Android
applications, only Android
projects can be created, and kotlin
projects cannot be created. But it doesn't matter, you can open a project at will , write a function Android
in it , and you can run the codekotlin
main()
kotlin
independently .
Here directly open the created HelloWorld
project, first find MainActivity
the location, as shown in the figure below - HelloWorld项目结构
:
Next MainActivity
create a file under the sibling package structure of LearnKotlin
. right click