Android Open Source - SSPIA Db Aux Class






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.db;
//w  w w . j  a v  a 2  s. c  o m
import com.fiec.ssapp.R;

import android.app.Activity;

public class DbAuxClass {
  
  private Planets[] planets;
  private Satellites[] satellites;
  private SolarDb db;
  private Activity act;
  
  private String[] pname;
  private String[] pinfo;
  private String[] exinfo;
  private int[] pimg;
  private int satcount;
  private int pid;

  public DbAuxClass(Activity act, SolarDb db) {
    this.db = db;
    this.act = act;  
  }
  
  public boolean setPlanets(){
    //CARGAR NOMBRES E IMAGENES DE LOS PLANETAS, ????ESTO DEBERIA HACERSE POR BASE DE DATOS!!!!
    this.pname = act.getResources().getStringArray(R.array.theplanets);
        this.pimg = act.getResources().getIntArray(R.array.theimages);
        
        int cant = this.pname.length;
      
      this.planets = new Planets[cant];
        
        for(int i=0; i<cant; i++){
          this.pid = db.getIdbyPname(pname[i]);
          //CARGAR CANTIDAD DE SATELITES DEL PLANETA
            this.satcount = db.getSatellitesByPlanetId(this.pid).length;
            
            //CARGAR INFO DEL PLANETA
            this.pinfo = db.getDetails(this.pid);
            
          this.planets[i] = new Planets(this.pname[i], this.pinfo, this.pid, this.satcount, this.pimg[i]);
          this.planets[i].setDb(db);
        }       
        
    return true;
  }
  
  public boolean setSatellites(){
    //CARGAR NOMBRES E IMAGENES DE LOS SATELLITES, ????ESTO DEBERIA HACERSE POR BASE DE DATOS!!!!
    this.pname = act.getResources().getStringArray(R.array.satellites);
        this.pimg = act.getResources().getIntArray(R.array.satellitesimg);
    this.exinfo = act.getResources().getStringArray(R.array.z_xinfo);
        
        int cant = this.pname.length;
        int aux;
      
      this.satellites = new Satellites[cant];
        
        for(int i=0; i<cant; i++){
          this.pid = db.getSatellitesIdByName(pname[i]);       
            
            //CARGAR INFO DEL PLANETA
          aux = db.getSatDetailId(this.pid);
        this.pinfo = db.getSatDetails(aux);
            
          this.satellites[i] = new Satellites(this.pname[i], this.pinfo, this.pid, this.pimg[i], this.exinfo[i]);
          this.satellites[i].setDb(db);
        }       
        
    return true;
  }
  
  public Planets[] getPlanets(){
    return this.planets;
  }
  
  public Satellites[] getSatelites(){
    return this.satellites;
  }

}




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