The equivalent of UserDefaults in Android is SharedPreferences
To use SharedPreferences first you can get an object of SharedPreferences this way:
val sharedPreferences = getSharedPreferences(name:String!, mode: Int)
in case you are in an activity you can call the method directly since activity inherits from Context otherwise you need a context object to call getSharedPreferences. The name can be anything you'd like to call your preferences and for the mode you can find more here.
Next to save data in the sharedPreferences you call the method sharedPreferences.edit() which returns an Editor object, you put data in the editor and to save the changes you call commit() for example:
sharedPreferences.edit().putInt(key: String!, value: Int).commit()
as you can see we've put an integer to the editor and then we called commit().
To fetch the data we save is pretty simple we just call the corresponding get method to the type for example
sharedPreferences.getInt(key: String!, defaultValue: Int)