What is regarded as best practice to handle database connections? (I overlooked the constructor and onUpgrade method inside the DatabaseHelper class) These are merely two ways I located on the internet, possibly you've got a better method of handling? I would like to hear.

Option 1

public class DatabaseManager {

private SQLiteDatabase mDb;

public DatabaseManager(Context context) {

   DatabaseHelper helper = new DatabaseHelper(context);
   helper.getWritableDatabase();
}

// ... methods that use mDb

private class DatabaseHelper extends SQLiteOpenHelper {

   @Override
   public void onCreate(SQLiteDatabase db) {

      mDb = db;
      //create database
   }

   @Override
   public void onOpen(SQLiteDatabase db) {

      mDb = db;
   }
}

Option 2

public class DatabaseManager {

private DatabaseHelper mDbHelper;

public DatabaseManager(Context context) {

   mDbHelper = new DatabaseHelper(context);
}

// ... methods that fetch the db

private void sampleMethod() {
   SQLiteDatabase db = mDbHelper.getWritableDatabase();
   //do stuff with database
   mDbHelper.close();
}

private static class DatabaseHelper extends SQLiteOpenHelper {

   @Override
   public void onCreate(SQLiteDatabase db) {

      //create database
   }
}

Also, could it be required to call close() each time you used the database within option 2? For using option 1, I suppose you have to call close() once the app's onDestroy is known as?

I did previously be worried about all of this but lately I began using ORMLite. It's a very light ORM with Android libraries and helps you save worrying relating to this type of stuff.

I'd state that this might soon become best practice because it removes lots of repeated code when confronted with databases. It's also being up-to-date regularly and also the maintainer responds to queries very rapidly.