FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
HistoryDB.java
1/*
2 Quick Connect History Database
3
4 Copyright 2013 Thincast Technologies GmbH, Author: Martin Fleisz
5
6 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
7 If a copy of the MPL was not distributed with this file, You can obtain one at
8 http://mozilla.org/MPL/2.0/.
9*/
10
11package com.freerdp.freerdpcore.services;
12
13import android.content.Context;
14import android.database.sqlite.SQLiteDatabase;
15import android.database.sqlite.SQLiteOpenHelper;
16
17public class HistoryDB extends SQLiteOpenHelper
18{
19
20 public static final String QUICK_CONNECT_TABLE_NAME = "quick_connect_history";
21 public static final String QUICK_CONNECT_TABLE_COL_ITEM = "item";
22 public static final String QUICK_CONNECT_TABLE_COL_TIMESTAMP = "timestamp";
23 private static final int DB_VERSION = 1;
24 private static final String DB_NAME = "history.db";
25
26 public HistoryDB(Context context)
27 {
28 super(context, DB_NAME, null, DB_VERSION);
29 }
30
31 @Override public void onCreate(SQLiteDatabase db)
32 {
33
34 String sqlQuickConnectHistory = "CREATE TABLE " + QUICK_CONNECT_TABLE_NAME + " (" +
35 QUICK_CONNECT_TABLE_COL_ITEM + " TEXT PRIMARY KEY, " +
36 QUICK_CONNECT_TABLE_COL_TIMESTAMP + " INTEGER"
37 + ");";
38
39 db.execSQL(sqlQuickConnectHistory);
40 }
41
42 @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
43 {
44 // TODO Auto-generated method stub
45 }
46}