Play Ringtones, Generate Tones, and Get Device Info In #Delphi XE8 Firemonkey On Android

Developer Erik Salaj from Winsoft has released three examples of interfacing with the Android SDK with Delphi XE8 Firemonkey. Winsoft also has a utility called JavaImport which can create Object Pascal interface files for the Android SDK. Obviously the examples are only for Android and not IOS, OSX, or Windows as they use the JNI. The first example allows you to play ring tones on your Android device using TJRingtoneManager. It plays the current ringtone, the current notification sound, and the current alarm sound with the Androidapi.JNI.Media unit. The second example uses the TJToneGenerator object from Android to allow you create various sounds when different buttons are pressed. The example tones are TONE_PROP_BEEP, TONE_PROP_BEEP2, TONE_PROP_ACK, TONE_PROP_NACK, TONE_PROP_PROMPT, TONE_DTMF_0, TONE_DTMF_1, and TONE_DTMF_2. The last example uses TJTelephonyManager, TJBuild_VERSION, and TJBuild to give you access to a whole bunch of info about the current device. Some examples are the device OS version, device serial number, CPU type, manufacturer, device model, device ID, sim operator, voice mail number, and a whole host of other device information. These examples should also work in Appmethod.