'How to implement daily sunset/sunrise times to android studio application

I am developing an android application. I have decided to develop an application that tells the user the daily times to pray for Muslims. But as I am new to android(and also programming in general) I don't know how to implement this. I have done some research myself and found that some web services provide JSON or XML files to fetch the data or there supposed to be Java Tools/Libs to use. I need help on putting this data into my program and i dont know if i have to change it everyday or will the time change everyday, if there are any experts out there who can break it down for me it would help me a lot.

thank you



Solution 1:[1]

You can use this API for sunrise and sunset timings of a particular lat long pair https://sunrise-sunset.org/api

You can use Date library in Android and fetch current date.

To get the latest information all the time, you can hit the Api upon activity Start.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sarada