Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. package com.bacheles.fmi.uni.ballhop;
  2. import android.content.Context;
  3. import android.database.sqlite.SQLiteDatabase;
  4. import android.database.sqlite.SQLiteOpenHelper;
  5.  
  6. /**
  7. * Created by fmi on 20.1.2018 г..
  8. */
  9. public class DatebaseHelper extends SQLiteOpenHelper{
  10.  
  11. public static final String DB_NAME = "hopBase.sqlite";
  12. public static final int DB_VERSION = 1;
  13.  
  14. public static final String USER_ID = "_id";
  15. public static final String USER_USERNAME = "username";
  16. public static final String USER_PASSWORD = "password";
  17. public static final String USER_EMAIL = "email";
  18. public static final String USER_GENDER = "gender";
  19. public static final String USER_AVATAR = "avatar";
  20.  
  21. public static final String CREATE_TABLE_USER = "CREATE TABLE user ('" + USER_ID + "' INTEGER PRIMARY KEY AUTOINCREMENT," +
  22. "'" + USER_USERNAME + "' TEXT NOT NULL UNIQUE," +
  23. "'" + USER_PASSWORD + "' TEXT NOT NULL," +
  24. "'" + USER_EMAIL + "' TEXT NOT NULL UNIQUE," +
  25. "'" + USER_GENDER + "' TEXT," +
  26. "'" + USER_AVATAR + "' TEXT DEFAULT 'noimage.png')";
  27.  
  28. public DatebaseHelper(Context context) {
  29. super(context, DB_NAME, null, DB_VERSION);
  30. }
  31.  
  32. @Override
  33. public void onCreate(SQLiteDatabase sqLiteDatabase) {
  34.  
  35. }
  36.  
  37. @Override
  38. public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
  39.  
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement