package com.key.coolkeyboard.data;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import com.key.coolkeyboard.CoolKeyboardSkin;


@Database(entities = {Otherdata.class}, version = CoolKeyboardSkin.DB_Version, exportSchema = false)
public abstract class MydataBase extends RoomDatabase {
    public abstract MyDAO myDAO();

    private static MydataBase INSTANCE;

    public static MydataBase getInstance() {
        if (INSTANCE == null) {
            synchronized (MydataBase.class) {
                INSTANCE = Room.databaseBuilder(CoolKeyboardSkin.getContext(), MydataBase.class, CoolKeyboardSkin.DB_Name).build();
            }
        }
        return INSTANCE;
    }
//    public static MydataBase getInstance() {
//        if (INSTANCE == null) {
//            synchronized (MydataBase.class) {
//                if (INSTANCE == null) {
//                    INSTANCE = Room.databaseBuilder(CoolKeyboardSkin.getContext(), MydataBase.class, CoolKeyboardSkin.DB_Name).build();
//                }
//            }
//        }
//        return INSTANCE;
//    }


}
