Android Open Source - SSPIA Sspia Service






From Project

Back to project page SSPIA.

License

The source code is released under:

MIT License

If you think the Android project SSPIA 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.fiec.sspia.system;
//  w  w  w . j  a v  a  2  s . com
import com.fiec.sspia.db.SolarDb;
import com.fiec.sspia.main.SolarActivity;
import com.fiec.sspia.mclass.SSNotific;
import com.fiec.sspia.util.TempClass;

import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
import android.widget.Toast;

public class SspiaService extends Service{
  private NotificationManager nm;
  private TempClass temp;
  private int NOTI = 0;
  private SSNotific notification;
  private SolarDb db;
  
  public SspiaService() {
  }
  
  @Override
  public void onCreate() {    
    nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
    notification = new SSNotific(this.getApplicationContext(), nm, "default");
    db = new SolarDb(this);
  }
  
  @Override
  public int onStartCommand(Intent intent, int flags, int startId) {
    Log.i("gmaTag", "Recibiendo servicio en: "+startId+" : "+intent);  
    //runAlarm();
    show();
    return START_NOT_STICKY;
  }
  
  @Override
  public void onDestroy() {
    nm.cancel(NOTI);
    Toast.makeText(this, "SSPIA service stopped!", Toast.LENGTH_SHORT).show();
  }
  
  private final IRemoteService.Stub sbin = new IRemoteService.Stub() {    
    @Override
    public int getPid() throws RemoteException {
      return android.os.Process.myPid();
    }
  };
  
  @Override
  public IBinder onBind(Intent intent) {
    return sbin;
  }
  
  public class SBinder extends Binder{
    public SspiaService getService(){
      return SspiaService.this;
    }
  }
  
  private void show(){
    String[] aux;
    db.open();
    if(db.getIsCheck().equals("true")){
      aux = db.getUserTemp();
      temp = new TempClass(Double.parseDouble(aux[0]), Double.parseDouble(aux[1]));    
      notification.initialize(SolarActivity.class, temp);
      notification.start();
    }
    db.close();    
  }

}




Java Source Code List

com.fiec.sspia.buff.DefaultNoti.java
com.fiec.sspia.buff.PlanetClass.java
com.fiec.sspia.buff.PlanetSource.java
com.fiec.sspia.buff.Tag.java
com.fiec.sspia.db.Celestial.java
com.fiec.sspia.db.DBHelper.java
com.fiec.sspia.db.DbAuxClass.java
com.fiec.sspia.db.Planets.java
com.fiec.sspia.db.Satellites.java
com.fiec.sspia.db.SolarDb.java
com.fiec.sspia.main.InformationTab.java
com.fiec.sspia.main.SatellitesClass.java
com.fiec.sspia.main.SolarActivity.java
com.fiec.sspia.main.TabsPlanets.java
com.fiec.sspia.mclass.MainClass.java
com.fiec.sspia.mclass.MainFragment.java
com.fiec.sspia.mclass.SSNotific.java
com.fiec.sspia.mclass.SetttingsClass.java
com.fiec.sspia.mclass.SplashClass.java
com.fiec.sspia.system.BroadcastRec.java
com.fiec.sspia.system.SspiaService.java
com.fiec.sspia.system.StartingNotis.java
com.fiec.sspia.util.AbstrCd.java
com.fiec.sspia.util.CdClass.java
com.fiec.sspia.util.CustomInfoAdapter.java
com.fiec.sspia.util.CustomMenuAdapter.java
com.fiec.sspia.util.FillMenuAdapter.java
com.fiec.sspia.util.JSONParser.java
com.fiec.sspia.util.MainGridAdapterClass.java
com.fiec.sspia.util.MenuSettings.java
com.fiec.sspia.util.SSInterfaceNoti.java
com.fiec.sspia.util.SatelliteGridAdapterClass.java
com.fiec.sspia.util.TempClass.java
com.fiec.sspia.util.TransitionClass.java