Hello,
I currently have an Android Bluetooth service that I have made run in the background to constantly receive serial data from my computer or arduino. This Bluetooth connection will be replaced by a sensor later.
So far, the service is working in Android, but I’m not sure how to start a Service within Unity. I have created some Unity Android plugins before, but those methods are only calling static classes.
Heres the java method that I am currently using to create my Bluetooth service:
public class MainActivity extends Activity {
private static String TAG = "MainActivity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
startBTService()
}
public void startBTService(){
Intent intent = new Intent(this, bluetoothLibrary.class);
startService(intent);
}
}
Now, in the Unity3D side, I’m not sure how to go about calling non-static void functions.
Any help with my problem would be great.
Thanks