解决方案 »

  1.   

    可以设置广播注册,
    网络启动时 自动启动service
    手机启动时自动启动service如果完全不给其他工具杀掉,禁止杀进程,那恐怕要去写JNI注册到底层系统Service了。不知道可能实现。
      

  2.   

    一般service被强制杀掉都会重启的貌似
      

  3.   

    除非你注册成系统服务  在init.r可以实现  当然  这就需要编译真个系统了你可以设置被杀死后重启服务  这个稍微流氓一点  作为第三方不被杀显然不可能
      

  4.   

    用电源管理锁定service,应该是可以实现的,但是要处理好释放电源锁的问题,要不然耗电非常厉害
      

  5.   

    1.如果是系统程序 可以配置android:persistent =true
    2.非系统的可以在绑定的时候这样
    Notification notification = new Notification();  
    notification.flags = Notification.FLAG_ONGOING_EVENT;  
    notification.flags |= Notification.FLAG_NO_CLEAR;  
    notification.flags |= Notification.FLAG_FOREGROUND_SERVICE;  
    service.startForeground(1, notification);