Android Open Source - Torch Background Service






From Project

Back to project page Torch.

License

The source code is released under:

GNU General Public License

If you think the Android project Torch listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.aktarer.torch;
/*  w ww . j  a  v a2s .c  o m*/
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class BackgroundService extends Service {
  protected Server server = null;

  @Override
  public IBinder onBind(Intent intent) {
    return null;
  }

  @Override
  public void onCreate() {
    Log.i("BackgroundService", "Created");

    server = new Server(getApplicationContext());
    server.start();
  }

  @Override
  public int onStartCommand(Intent intent, int flags, int startId) {
    Log.i("BackgroundService", "StartCommanded");

    if (intent != null && intent.hasExtra("threadID") && intent.hasExtra("data")) {
      Log.i("BackgroundService", "Time to send blocked data.");
      
      server.update(intent.getLongExtra("threadID", -1), intent.getByteArrayExtra("data"));
    }

    return START_STICKY;
  }

}




Java Source Code List

com.aktarer.torch.BackgroundServiceStarter.java
com.aktarer.torch.BackgroundService.java
com.aktarer.torch.Main.java
com.aktarer.torch.ServerThread.java
com.aktarer.torch.Server.java
com.aktarer.torch.features.Base.java
com.aktarer.torch.features.Battery.java
com.aktarer.torch.features.Camcorder.java
com.aktarer.torch.features.Info.java
com.aktarer.torch.features.Listen.java
com.aktarer.torch.features.SnapshotTaker.java
com.aktarer.torch.features.Snapshot.java
com.aktarer.torch.util.SystemUiHiderBase.java
com.aktarer.torch.util.SystemUiHiderHoneycomb.java
com.aktarer.torch.util.SystemUiHider.java