From 43d91a8a2d4ed489743d1252cc231fdf1485cc35 Mon Sep 17 00:00:00 2001 From: Alexander Doerflinger Date: Mon, 7 Aug 2017 17:14:26 +0200 Subject: [PATCH] Added Constants for database access. Added a Contants class which contains all global database keys and some other global information. --- .idea/misc.xml | 2 +- app/build.gradle | 4 +- .../mariokartcircuitselector/Constants.java | 155 ++++++++++++++++++ 3 files changed, 158 insertions(+), 3 deletions(-) create mode 100644 app/src/main/java/com/de/aldo_apps/aldo/mariokartcircuitselector/Constants.java diff --git a/.idea/misc.xml b/.idea/misc.xml index 406ac20..738edfe 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -56,7 +56,7 @@ - + diff --git a/app/build.gradle b/app/build.gradle index 4f16298..5349f75 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "com.de.aldo_apps.aldo.mariokartcircuitselector" minSdkVersion 16 targetSdkVersion 25 - versionCode 1 - versionName "1.0" + versionCode 2 + versionName "0.2" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/com/de/aldo_apps/aldo/mariokartcircuitselector/Constants.java b/app/src/main/java/com/de/aldo_apps/aldo/mariokartcircuitselector/Constants.java new file mode 100644 index 0000000..438dba4 --- /dev/null +++ b/app/src/main/java/com/de/aldo_apps/aldo/mariokartcircuitselector/Constants.java @@ -0,0 +1,155 @@ +package com.de.aldo_apps.aldo.mariokartcircuitselector; + +/** + * Created by aldo7224 on 07.08.17. + */ + +public class Constants { + + /** + * As SQLite does not have a native boolean value, we use integers to represent true and false. + * This is the value for a true statement. + */ + public final static Integer TRUE = 1; + + /** + * As SQLite does not have a native boolean value, we use integers to represent true and false. + * This is the value for a false statement. + */ + public final static Integer FALSE = 0; + + /** + * The Name of the complete database. + */ + public static final String DATABASE_NAME = "MarioKart.db"; + + /** + * The name of the table containing all information according accessories. + */ + public static final String TABLE_ACCESSORY = "accessory"; + + /** + * The name of the table containing all information according characters. + */ + public static final String TABLE_CHARACTER = "character"; + + /** + * The name of the table containing all information according games. + */ + public static final String TABLE_GAME = "game"; + + /** + * The name of the table containing all information according karts. + */ + public static final String TABLE_KART = "kart"; + + /** + * The name of the table containing all information according rulesets. + */ + public static final String TABLE_RULESET = "ruleset"; + + /** + * The name of the table containing all information according tracks. + */ + public static final String TABLE_TRACK = "track"; + + /** + * The name of the table containing all information according wheels. + */ + public static final String TABLE_WHEELS = "wheels"; + + /** + * The global KEY for the _id field in the database. + */ + public static final String KEY_ID = "_id"; + + /** + * The global KEY for the name field in the database. + */ + public static final String KEY_NAME = "name"; + + /** + * The global KEY for the game field in the database. + */ + public static final String KEY_GAME = "game"; + + /** + * The global KEY for the available field in the database. + */ + public static final String KEY_AVAILABLE = "available"; + + /** + * The global KEY for the weight field in the database. + */ + public static final String KEY_WEIGHT = "weight"; + + /** + * The global KEY for the cover uri field in the database. + */ + public static final String KEY_COVER_URI = "cover_uri"; + + /** + * The global KEY for the wheels field in the database. + */ + public static final String KEY_WHEELS = "wheels"; + + /** + * The global KEY for the accessory field in the database. + */ + public static final String KEY_ACCESSORY = "accessory"; + + /** + * The global KEY for the dedicated driver field in the database. + */ + public static final String KEY_DEDICATED_DRIVER = "dedicated_driver"; + + /** + * The global KEY for the free for all field in the database. + */ + public static final String KEY_FREE_FOR_ALL = "free_for_all"; + + /** + * The global KEY for the mirror class field in the database. + */ + public static final String KEY_MIRROR_CLASS = "mirror_class"; + + /** + * The global KEY for the 50 ccm field in the database. + */ + public static final String KEY_50_CCM = "50_ccm"; + + /** + * The global KEY for the 100 ccm field in the database. + */ + public static final String KEY_100_CCM = "100_ccm"; + + /** + * The global KEY for the 150 ccm field in the database. + */ + public static final String KEY_150_CCM = "150_ccm"; + + /** + * The global KEY for the 200 ccm field in the database. + */ + public static final String KEY_200_CCM = "200_ccm"; + + /** + * The global KEY for the kart free for all field in the database. + */ + public static final String KEY_KART_FREE_FOR_ALL = "kart_free_for_all"; + + /** + * The global KEY for the bikes field in the database. + */ + public static final String KEY_BIKES = "bikes"; + + /** + * The global KEY for the package field in the database. + */ + public static final String KEY_PACKAGE = "package"; + + /** + * The global KEY for the number field in the database. + */ + public static final String KEY_NUMBER = "number"; +}