How can we get current user settings like phone ringtone & ring volume, Current wallpaper, vibration, etc setting programmatically?
I want to store them & set them back whenever user wants to.....
I am new to kotlin.
You can use below code for your purpose.
For getting ringtone:
val defaultRingtoneUri = RingtoneManager.getActualDefaultRingtoneUri(getActivity().getApplicationContext(), RingtoneManager.TYPE_RINGTONE)
val defaultRingtone = RingtoneManager.getRingtone(getActivity(), defaultRingtoneUri)
For getting ringtone volume:
val am = getSystemService(AUDIO_SERVICE) as AudioManager
val volume_level = am.getStreamVolume(AudioManager.STREAM_MUSIC)
For getting current wallpaper:
val wallpaperManager = WallpaperManager.getInstance(this) as WallpaperManager
val wallpaperDrawable: Drawable = wallpaperManager.getDrawable()
For Ringtone you can use RingtoneManager and get the default ringtone with RingtoneManager.getActualDefaultRingtoneUri(Context context, int type)
For Volume you can use AudioManager.
AudioManager.getStreamVolume(AudioManager.STREAM_RING)
For Wallpaper you can user WallpaperManager.
WallpaperManager.getDrawable() -> //Retrieve the current system wallpaper.
If you need any other information please try to use stackoverflow search function or simply google search.
Good luck!