How-to articles, tricks, and solutions about KOTLIN

How can I generate random number in specific range in Android?

To generate a random number in a specific range in Android, you can use the nextInt method of the java.util.Random class.

How to launch an Activity from another Application in Android

To launch an activity from another application in Android, you can use an Intent with the FLAG_ACTIVITY_NEW_TASK flag set.

How to parse JSON in Kotlin?

To parse JSON in Kotlin, you can use the JSONObject class from the org.json package.

Unfortunately MyApp has stopped. How can I solve this?

If you are seeing the error "Unfortunately, MyApp has stopped," it means that your Android app has crashed. This can be caused by a number of factors, including:

What is the equivalent of Java static methods in Kotlin?

In Kotlin, you can use the companion object to define static methods and properties.