Java tutorial
//package com.java2s; import android.app.ActivityManager; import android.content.Context; public class Main { private static Context context; public static boolean isServerRunning(Class server) { if (server == null) { return false; } ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); // am.getRunningServiceControlPanel() return false; } }