Skip to content

MainActivity

Fanni edited this page Feb 23, 2026 · 8 revisions

This is main game activity, most of the function of the game is located here for the gameplay wise


Functions

private void feedSet()

Set hunger bar images to reflect current hunger

private int FeedSeal()

Set hunger in Sealvar.setHunger()

private void applySavedLanguage()

Apply prefs.getString("app_language", "en") set language, Default: English

private void applySkin()

Set which character show up on screen, Default: Seal

private void TimeCheck()

Call the weather API if respones.isSucessful() it set background base on got data. onFailure it set predetermined background

private void ChangeBG()

Set background based on WeatherAPI data

private boolean SleepCheck()

Check time if (time >= 22 || time < 6) == true set character to sleep and send Sleep Notification

private void SetExtra()

Set data in SharedPreferences, "hunger","fishcount","base_step"

private void getLocation()

It get latitude and longitude of player location

private BroadcastReceiver stepReceiverPause = new BroadcastReceiver()

Broadcast receiver of StepService, more info in StepService.class


Permission Function

private boolean GeoPerm()

This check and if needed as use for LOCATION PREMISSION

private boolean StepPerm()

This check and if needed as use for PHYSICAL ACTIVITY PREMISSION

private boolean Notifperm()

This check and if needed as use for NOTIFICATION PREMISSION

Clone this wiki locally