Surprisingly I didn’t find any app to record the pieces I play via MIDI (not to mention playback). Though I found a fistful of suitable apps, they still show some drawbacks. Most do not provide native Android 6 API support so I’m stuck to USB (heck, I wanted to get rid of the cables). And even via USB, the apps I tried (like the excellent Samsung Soundcamp) all force the incoming MIDI events to one channel. Unfortunately, my instrument sends events on 4 channels (2 keybeds, one pedalboard, channel 12 for controller data), so the recordings become rather useless.
And since I wanted to actually play the instrument rather than writing code, I do resist the temptation to write an app by myself. At least for the moment :) .