A prayer times app can work entirely without the internet, because prayer times are worked out from the position of the sun, and the sun’s position for any place and date can be calculated on the phone itself. All the app needs is where you are, the date, your time zone and the calculation method you follow. With those four things in hand, the phone can produce Fajr, sunrise, Dhuhr, Asr, Maghrib and Isha for today and for every day ahead, with nothing sent anywhere and no connection required.
Our own app, Miqa, is built this way, and we describe how it works at the end.
Why an app should not need the internet for prayer times
Prayer times follow the movement of the sun across the sky, which repeats in a pattern that astronomers have described with great precision for centuries. The calculation is a matter of arithmetic, and a modern phone can carry it out in a fraction of a second, so there is no technical reason for a prayer times app to fetch anything from a server.
When an app does go online for prayer times, it usually needs to send something about you to get an answer, most often your location. Your location is sensitive information, since a record of where a person is at each prayer time reveals where they live and where they pray. An app that works it out on the phone has no need to share any of that.
There is a practical side as well. People need prayer times when travelling, in buildings with weak signal, in places where mobile data is expensive, and on days when the network is down. An app that depends on the internet can fail at exactly the moment it is needed, while an app that calculates on the phone keeps working wherever the phone goes.
How the times are worked out on the phone
The calculation begins with the date, which tells the app where the earth is on its yearly path around the sun and therefore how high the sun climbs in the sky that day. Your latitude and longitude tell it where you are standing on the earth, and your time zone lets it turn the result into the clock time you see on your screen.
From these, the app first finds solar noon, the moment the sun reaches its highest point, and Dhuhr begins just after it. Sunrise and sunset are found by working out when the top of the sun crosses the horizon, with a small allowance for the way the air bends light near the ground, and Maghrib is taken from sunset.
Fajr and Isha depend on twilight, the faint light in the sky before sunrise and after sunset. A calculation method sets how far below the horizon the sun should be for each of these, and some methods use a fixed length of time after Maghrib for Isha. Asr is found from the length of shadows, and here the schools of fiqh hold two views, which an app lets you choose between. We explain all of this in more detail in our article on prayer time calculation methods.
None of these steps needs anything from outside the phone. Once the app has your place and your method, it can work out a whole year of prayer times in advance, and it will give the same answer with or without a connection.
Finding your town without going online
The one thing an app cannot know by itself is where you are, and there are two ways to tell it that need no internet at all.
The first is to choose your town from a list stored inside the app. A list of towns with their latitude, longitude and time zone takes up very little space, so an app can carry tens of thousands of places on the phone and let you search them without a connection. This also suits anyone who would prefer that the app never asks for their location at all.
The second is to let the phone give an approximate position. An approximate position is enough for prayer times, since moving a short distance changes them by very little. What matters is what happens to that position afterwards, and an app that calculates on the phone can keep it there, use it for the arithmetic and send it nowhere.
What an app can do without an internet permission
On Android, an app has to declare the internet permission before it is allowed to open a connection to anywhere. An app that does not ask for that permission cannot send your location, your settings or anything else off the phone by itself, however it was written.
That makes the internet permission one of the clearest signs of how an app treats your information. You can see the permissions an app asks for on its store page and in your phone’s settings, and an app that leaves out the internet permission has made a promise that the phone itself enforces.
An app without that permission can still do a great deal. It can calculate prayer times, sound the adhan, show reminders and countdowns, and keep all your settings, because every one of those things happens on the phone. What it gives up is anything that really needs a server, and for a prayer times app very little falls into that group.
What you give up, and what you keep
Working offline does have costs. An offline app cannot update its list of towns or methods on its own, so changes arrive through normal app updates from the store. It cannot share your settings between devices through an account, because there is no account. If your masjid publishes its own timetable with small differences, the app cannot fetch that timetable for you, so you set the difference yourself with a minute adjustment.
What you keep is worth more to many people. Your location stays on your phone, there is no account to create or lose, there is nothing to track, and the times keep coming online or offline, at home, abroad or somewhere with no signal at all. For an app that you open five times a day, every day, that trade is one we think most people would choose.
How Miqa does it
Miqa is the prayer times app we built and released on Google Play. It works out every prayer time on the phone, from your location or from a city you choose, and more than 36,000 towns are available offline. You can pick from 14 calculation methods, choose Hanafi or Shafi’i Asr, and adjust any prayer by the minute so that it matches your local masjid. It counts down to the iqamah at your masjid and to sunrise after Fajr, it has a Ramadan countdown, and it can sound the adhan or an alarm with a reminder a few minutes before.
Miqa asks for no internet permission, which means it has no way of sending anything off your phone. It has no accounts, no adverts, no analytics and no tracking, your approximate location stays on the phone, and its settings are left out of cloud backup. It is also clear about what it is not, since it is not a Quran reader, a compass or a news feed. You can read how we handle information across our apps and this website on our privacy page.
When Miqa and your masjid disagree by a minute or two, the cause is usually one of the settings described in prayer time calculation methods, and a single minute adjustment for that prayer is normally all it takes to bring them together.