forked from wallforfry/Macao
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f898d17
commit 9873e26
Showing
6 changed files
with
202 additions
and
37 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
app/src/main/java/fr/esiee/bde/macao/Calendar/CalendarEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package fr.esiee.bde.macao.Calendar; | ||
|
||
/** | ||
* Created by Wallerand on 06/06/2017. | ||
*/ | ||
|
||
public class CalendarEvent { | ||
private int id; | ||
private String title, startString,endString, name; | ||
|
||
public CalendarEvent(){ | ||
|
||
} | ||
|
||
public CalendarEvent(int id, String title, String startString, String endString, String name){ | ||
this.id = id; | ||
this.title = title; | ||
this.startString = startString; | ||
this.endString = endString; | ||
this.name = name; | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
public void setTitle(String title) { | ||
this.title = title; | ||
} | ||
|
||
public String getStartString() { | ||
return startString; | ||
} | ||
|
||
public void setStartString(String startString) { | ||
this.startString = startString; | ||
} | ||
|
||
public String getEndString() { | ||
return endString; | ||
} | ||
|
||
public void setEndString(String endString) { | ||
this.endString = endString; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package fr.esiee.bde.macao; | ||
|
||
/** | ||
* Created by Wallerand on 06/06/2017. | ||
*/ | ||
|
||
import android.content.Context; | ||
import android.database.sqlite.SQLiteDatabase; | ||
import android.database.sqlite.SQLiteOpenHelper; | ||
|
||
import fr.esiee.bde.macao.Calendar.CalendarEvent; | ||
|
||
import static nl.qbusict.cupboard.CupboardFactory.cupboard; | ||
|
||
public class DataBaseHelper extends SQLiteOpenHelper { | ||
|
||
private static final String DATABASE_NAME = "Macao.db"; | ||
private static final int DATABASE_VERSION = 1; | ||
|
||
public DataBaseHelper(Context context) { | ||
super(context, DATABASE_NAME, null, DATABASE_VERSION); | ||
} | ||
|
||
static { | ||
// register our models | ||
cupboard().register(CalendarEvent.class); | ||
} | ||
|
||
@Override | ||
public void onCreate(SQLiteDatabase db) { | ||
// this will ensure that all tables are created | ||
cupboard().withDatabase(db).createTables(); | ||
// add indexes and other database tweaks in this method if you want | ||
|
||
} | ||
|
||
@Override | ||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { | ||
// this will upgrade tables, adding columns and new tables. | ||
// Note that existing columns will not be converted | ||
cupboard().withDatabase(db).upgradeTables(); | ||
// do migration work if you have an alteration to make to your schema here | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters