Added internet connection check , implemented PreferenceActivity