Is it possible to get the above values in java (not for android, but for laptop, pc, etc.), and if so, how?
1 answer
// get current volume
AudioManager am = (AudioManager) getSystemService(AUDIO_SERVICE); int volume_level= am.getStreamVolume(AudioManager.STREAM_MUSIC); // brightness
int curBrightnessValue = android.provider.Settings.System.getInt(getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS); - I apologize for the inaccuracy regarding the platform, fixed the question, perhaps for a pc / laptop there is an opportunity to count? - Nikita Kragel
- @Nikita Kragel, check next time right away. About the PC - I do not know - Flippy
- @NikitaKragel, As far as I know, for a PC without libraries - no way. Sound: Audio.setMasterOutputVolume (0.5f); using the library github.com/Kunagi/ilarkesto/blob/master/src/main/java/ilarkesto/… Brightness (for Windows, and you need Powershell): stackoverflow.com/questions/15880547/… - kit
|