Android Open Source - Space.Sprint High Score Database Helper






From Project

Back to project page Space.Sprint.

License

The source code is released under:

GNU General Public License

If you think the Android project Space.Sprint 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.obisapps.spacerun;
/* ww w. j  a  va 2 s . co  m*/
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class HighScoreDatabaseHelper extends SQLiteOpenHelper {

  private static final String DATABASE_CREATE = "create table highscores "
      + "(_id integer primary key autoincrement, "
      + "score int not null);";

  public HighScoreDatabaseHelper(Context context, String name,
        CursorFactory factory, int version) {
    
    super(context, name, factory, version);

  }  

  
  @Override
  public void onCreate(SQLiteDatabase database) {
    
    database.execSQL(DATABASE_CREATE);
    
  }
  
  @Override
  public void onUpgrade(SQLiteDatabase database, int oldVersion, int newVersion) {
    
    database.execSQL("DROP TABLE IF EXISTS highscores");
    database.execSQL(DATABASE_CREATE);
    
  }
  
}




Java Source Code List

com.obisapps.spacerun.GameActivity.java
com.obisapps.spacerun.GameEngine.java
com.obisapps.spacerun.GameView.java
com.obisapps.spacerun.HighScoreDBAdapter.java
com.obisapps.spacerun.HighScoreDatabaseHelper.java
com.obisapps.spacerun.LevelCharacter.java
com.obisapps.spacerun.PhysicsEngine.java
com.obisapps.spacerun.PickUpManager.java
com.obisapps.spacerun.PlayerCharacter.java
com.obisapps.spacerun.RenderThread.java
com.obisapps.spacerun.SoundManager.java
com.obisapps.spacerun.SpaceBackground.java
com.obisapps.spacerun.SpaceSprint.java