I believe both mean the same, as the UI thread is the “main” thread of your
app, spawned by the system when your app starts and the only one allowed to
do rendering.
I would suggest that you modify SDLActivity.java with the functionality you
need, resp. a derived class of it (I think the README suggests to simply
derive from SDLActivity.java and do your modifications there). In the end
that would be a good idea anyway, because your app needs to have a dedicated
package identifier (you can’t have tons of different “org.libsdl.app”
It may be a lot easier for you to do the BT LE stuff completely in Java, and
only export the relevant results to native C/C++. You cannot reuse any of
the Android specifics on other platforms, so there’s no downside to not
doing it in C/C++.
Regards,
Daniel
---------- P?vodn? zpr?va ----------
Od: ancientcc
Komu: SDL
Datum: 20. 4. 2016 1:55:35
P?edm?t: [SDL] (android)How to Switch to Run in “SDLThread”
"
In Bluetooth Low Energy(BLE) subsystem, if scaned one pheripheral, system
will call app-provied fucntion onLeScan. This function run in system defined
thread, for example “Binder_2”. Based on security and other reasons, Android
recommends to switch to UI thread. Below is example. ?~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Override
public void onLeScan(final BluetoothDevice device, int rssi, byte[]
scanRecord) {
??? mActivity.runOnUiThread(new Runnable() {
??? @Override
??? public void run() {
??? mLeDeviceListAdapter.addDevice(device);
??? mLeDeviceListAdapter.notifyDataSetChanged();
??? }
??? });
}
?
In SDL framework, the better way is to switch to the thread named
"SDLThread". What am I to do?
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org"