Just want to know the moment database is created and checked for upgrade.
I dont call create database manualy and leave it to SQLiteOpenHelper. But I dont know, when and how clasees that extend SQLiteOpenHelper are called. Is it before Application onCreate() or after?
 
    
    - 4,459
- 5
- 45
- 95
- 
                    It's inside the DataBase Helper's `onCreate()` (which may also be called in `onUpgrade()`) – Phantômaxx Aug 27 '15 at 09:54
2 Answers
Databases for an application are created when you create them. Specifically when the application is installed it calls onCreate().
You can read more here: http://developer.android.com/training/basics/data-storage/databases.html
Read the documentation @ http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html#onCreate(android.database.sqlite.SQLiteDatabase)
Excerpt
public abstract void onCreate (SQLiteDatabase db)
Added in API level 1
Called when the database is created for the first time. This is where the creation of tables and the initial population of the tables should happen.
Parameters
db  The database.
 
    
    - 13,423
- 6
- 32
- 45
- 
                    I dont call create database manually. In that article, I dont see information when db is created by system. – Yarh Aug 27 '15 at 09:49
- 
                    A database has to be created by someone, WHAT database are you referring to? – JoxTraex Aug 27 '15 at 09:52
- 
                    I am using sqlite database and leave creation, upgrade etc. to `SQLiteOpenHelper` – Yarh Aug 27 '15 at 09:54
- 
                    Read the documentation. Also add logs to figure out how they are called. – JoxTraex Aug 27 '15 at 09:55
It's crated when you make call to SQLiteOpenHelper::getReadableDatabase or SQLiteOpenHelper::getWritableDatabase.
Just check the docs, it's there:
SQLiteOpenHelper::SQLiteOpenHelper(...)
Create a helper object to create, open, and/or manage a database. This method always returns very quickly. The database is not actually created or opened until one of getWritableDatabase() or getReadableDatabase() is called.
 
    
    - 9,852
- 1
- 35
- 37