Database changed  from activity to normal java class