Change MainActivity to DBAdater.

Change MainActivity to DBAdapter so that DB access
can be used by other components than the activities
which is inherited MainActivity.