Native MidiDeviceService?

72 views
Skip to first unread message

Fabrizio Benedetti

unread,
Jun 7, 2021, 3:08:17 PM6/7/21
to android-midi
Hi everyone. I am new to Android programming but I have been programming in C++ (and a little bit of Java) for the last 30 years.

I have just started a project in Android; I have succesfully implemented a skeleton MidiDeviceService in Kotlin. I plan to move the code to native C++ at some later stage but I can't understand if:

(1) can a MidiDeviceService be implemented in C++?

Also, a thing that puzzles me is:

(2) what thread am I running in, in my implementation of MidiDeviceService::onSend()?

I tried to open a socket in onCreate(), and I got the exception "NetworkOnMainThread"; I was expecting some threading issue in using networking from there, but I wasn't expecting the Service methods to be called from the UI thread - because "MainThread" means "the main UI thread of the activity", doesn't it?

Thanks in advance for all the help that will come from this group!

Ciao
Fabrizio

Reply all
Reply to author
Forward
0 new messages