|
1 /** |
|
2 BEEM is a videoconference application on the Android Platform. |
|
3 |
|
4 Copyright (C) 2009 by Frederic-Charles Barthelery, |
|
5 Jean-Manuel Da Silva, |
|
6 Nikita Kozlov, |
|
7 Philippe Lago, |
|
8 Jean Baptiste Vergely, |
|
9 Vincent Véronis. |
|
10 |
|
11 This file is part of BEEM. |
|
12 |
|
13 BEEM is free software: you can redistribute it and/or modify |
|
14 it under the terms of the GNU General Public License as published by |
|
15 the Free Software Foundation, either version 3 of the License, or |
|
16 (at your option) any later version. |
|
17 |
|
18 BEEM is distributed in the hope that it will be useful, |
|
19 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
21 GNU General Public License for more details. |
|
22 |
|
23 You should have received a copy of the GNU General Public License |
|
24 along with BEEM. If not, see <http://www.gnu.org/licenses/>. |
|
25 |
|
26 Please send bug reports with examples or suggestions to |
|
27 contact@beem-project.com or http://dev.beem-project.com/ |
|
28 |
|
29 Epitech, hereby disclaims all copyright interest in the program “Beem” |
|
30 written by Frederic-Charles Barthelery, |
|
31 Jean-Manuel Da Silva, |
|
32 Nikita Kozlov, |
|
33 Philippe Lago, |
|
34 Jean Baptiste Vergely, |
|
35 Vincent Veronis. |
|
36 |
|
37 Nicolas Sadirac, November 26, 2009 |
|
38 President of Epitech. |
|
39 |
|
40 Flavien Astraud, November 26, 2009 |
|
41 Head of the EIP Laboratory. |
|
42 |
|
43 */ |
1 package com.beem.project.beem.provider; |
44 package com.beem.project.beem.provider; |
2 |
45 |
3 import android.content.Context; |
46 import android.content.Context; |
4 import android.database.sqlite.SQLiteDatabase; |
47 import android.database.sqlite.SQLiteDatabase; |
5 import android.database.sqlite.SQLiteOpenHelper; |
48 import android.database.sqlite.SQLiteOpenHelper; |
6 import android.util.Log; |
49 import android.util.Log; |
7 |
50 |
|
51 // TODO: Auto-generated Javadoc |
8 /** |
52 /** |
9 * BeemDatabaseHelper class. |
53 * BeemDatabaseHelper class. |
10 * @author Jamu |
54 * @author Jamu |
11 */ |
55 */ |
12 public class BeemDatabaseHelper extends SQLiteOpenHelper { |
56 public class BeemDatabaseHelper extends SQLiteOpenHelper { |
29 this.mTag = tag; |
73 this.mTag = tag; |
30 this.mTableName = tableName; |
74 this.mTableName = tableName; |
31 this.mCreationQuery = creationQuery; |
75 this.mCreationQuery = creationQuery; |
32 } |
76 } |
33 |
77 |
|
78 /* (non-Javadoc) |
|
79 * @see android.database.sqlite.SQLiteOpenHelper#onCreate(android.database.sqlite.SQLiteDatabase) |
|
80 */ |
34 @Override |
81 @Override |
35 public void onCreate(SQLiteDatabase db) { |
82 public void onCreate(SQLiteDatabase db) { |
36 db.execSQL(this.mCreationQuery); |
83 db.execSQL(this.mCreationQuery); |
37 } |
84 } |
38 |
85 |
|
86 /* (non-Javadoc) |
|
87 * @see android.database.sqlite.SQLiteOpenHelper#onUpgrade(android.database.sqlite.SQLiteDatabase, int, int) |
|
88 */ |
39 @Override |
89 @Override |
40 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { |
90 public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { |
41 Log.w(this.mTag, "Upgrading database from version " + oldVersion + " to " + newVersion |
91 Log.w(this.mTag, "Upgrading database from version " + oldVersion + " to " + newVersion |
42 + ", which will destroy all old data"); |
92 + ", which will destroy all old data"); |
43 db.execSQL("DROP TABLE IF EXISTS " + this.mTableName + ";"); |
93 db.execSQL("DROP TABLE IF EXISTS " + this.mTableName + ";"); |