Android Services running in Unity


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";
	protected void onCreate(Bundle savedInstanceState) {

	public void startBTService(){
		Intent intent = new Intent(this, bluetoothLibrary.class);


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.


Check Communication between an Android App and Unity - Jean Meyblum - Game Programer

Unfortunately it looks like its not going to be that simple. You would have to build a plugin to communicate between unity and android.


or for a work around.

I also answered a similar question