You can use the code now with Android Studio but you will need to copy the files into an existing Android Studio project.
--
You received this message because you are subscribed to the Google Groups "android-midi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-midi...@googlegroups.com.
To post to this group, send email to androi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-midi/642acf52-0e45-4f48-a8c7-755aff79f610%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-midi/CAKChtka9DacjQtSekifgeKLYJWsKimZwSX2fB-Kg8jqDfoDxFQ%40mail.gmail.com.
Is there a way (or an app) where I can connect the BLE-Midi device without writing that code myself so I can test?
I grabbed the android-midisuite example and did manage to get MidiBtlePairing to build (in Android Studio), but had to correct a few things.First in MainActivity.java at the onActivityResult override:final BluetoothDevice fBluetoothDevice = (BluetoothDevice)data.getExtra("device") doesn't compile as 'getExtra' doesn't exist.Did you mean to use data.getParcelableExtra("device")?
Once I made that change, it compiled and ran, but hitting the Scan Bluetooth button on a Nexus 9 device yielded a crash:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.setTitle(int)' on a null object reference
Am I overlooking something, perhaps I have issues with my setup, or is there an issue with the sample code before I start debugging it?
I also looked at the MIDI Scope code (yours and developer.android.com sample), but it won't connect a BLE peripheral.
https://developer.android.com/reference/android/media/midi/ states that "MIDI devices can be connected to Android using Bluetooth LE.
Before using the device, the app must scan for available BTLE devices and then allow the user to connect. An example program will be provided so look for it on the Android developer website."
Oops, yes. getExtra() is deprecated and hidden. it does the same as getParcelableExtra(). Thanks for catching that.