How to perform wait until the page loads in Appium

In my project the records has to be downloaded from server which may take 3mins of time hence my test has to wait until that time or until the loader ends.

Can anyone help me in this how to perform the wait until the page loads action

how you identify manually when your page loaded?

We use a screen factory to identify the currently displayed screen. When waiting for a new screen to appear, we wait in a loop until the screen factory returns the expected one. Make certain your command_timeout is higher than the three minutes or else Appium will close the connection