Android Open Source - Netball Record






From Project

Back to project page Netball.

License

The source code is released under:

GNU General Public License

If you think the Android project Netball 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.prisch.model;
/* w  w  w  . j  a va2 s .  c om*/
import android.database.sqlite.SQLiteDatabase;

public class Record {

    // ===== Convenience Methods =====

    public static String prefixTable(String column) {
        return TABLE + "." + column;
    }

    // ===== Database Scaffolding =====

    public static void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_SCRIPT);
    }

    public static void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL(DROP_SCRIPT);
        onCreate(db);
    }

    // ===== Constants =====

    public static final String ID = "_id";
    public static final String DATE = "date";
    public static final String TEAM_ID = "team_id";
    public static final String ACTION = "action";

    public static final String TABLE = "record";
    public static final String TABLE_JOIN_TEAM_JOIN_PLAYER = String.format("%s LEFT OUTER JOIN %s", TABLE, TeamMember.TABLE)
                                                             + String.format(" ON (%s = %s)", prefixTable(TEAM_ID), TeamMember.prefixTable(TeamMember.ID))
                                                             + String.format(" LEFT OUTER JOIN %s", Player.TABLE)
                                                             + String.format(" ON (%s = %s)", TeamMember.prefixTable(TeamMember.PLAYER_ID), Player.prefixTable(Player.ID));

    private static final String CREATE_SCRIPT = "CREATE TABLE " + TABLE + " ("
                                                + ID        + " INTEGER PRIMARY KEY AUTOINCREMENT, "
                                                + DATE      + " INTEGER NOT NULL,"
                                                + TEAM_ID   + " INTEGER NOT NULL,"
                                                + ACTION    + " TEXT NOT NULL);";
    private static final String DROP_SCRIPT = "DROP TABLE " + TABLE;
}




Java Source Code List

com.prisch.activities.ActionsActivity.java
com.prisch.activities.BaseTeamActivity.java
com.prisch.activities.DashboardActivity.java
com.prisch.activities.GameStatsActivity.java
com.prisch.activities.GamesActivity.java
com.prisch.activities.PlayersActivity.java
com.prisch.activities.PositionsActivity.java
com.prisch.activities.SubstitutionActivity.java
com.prisch.activities.TeamActivity.java
com.prisch.content.DatabaseHelper.java
com.prisch.content.NetballContentProvider.java
com.prisch.controls.ActionButton.java
com.prisch.fragments.PositionStatsFragment.java
com.prisch.loaders.GameStatsLoader.java
com.prisch.model.Action.java
com.prisch.model.GameStats.java
com.prisch.model.Game.java
com.prisch.model.OpponentAction.java
com.prisch.model.OpponentRecord.java
com.prisch.model.PlayerStats.java
com.prisch.model.Player.java
com.prisch.model.Position.java
com.prisch.model.Record.java
com.prisch.model.TeamMember.java
com.prisch.repositories.GameRepository.java
com.prisch.repositories.OpponentRecordRepository.java
com.prisch.repositories.PlayerRepository.java
com.prisch.repositories.RecordRepository.java
com.prisch.repositories.StatsRepository.java
com.prisch.repositories.TeamMemberRepository.java
com.prisch.util.DateUtils.java
com.prisch.views.GameAdapter.java
com.prisch.views.GameStatsAdapter.java
com.prisch.views.PlayerStatsAdapter.java
com.prisch.views.PlayerStatsListItem.java
com.prisch.views.TeamAdapter.java