Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jakim API migration #82

Merged
merged 23 commits into from Sep 22, 2021
Merged

Jakim API migration #82

merged 23 commits into from Sep 22, 2021

Conversation

iqfareez
Copy link
Member

Yes, again. For the sake of long-term reliability

@iqfareez iqfareez linked an issue Sep 15, 2021 that may be closed by this pull request
@iqfareez
Copy link
Member Author

iqfareez commented Sep 17, 2021

Work in progress 🚧

image

(Updating location database)

@iqfareez
Copy link
Member Author

Work in progress 🚧

image

(Updating location database)

Xjadi

@iqfareez
Copy link
Member Author

iqfareez commented Sep 20, 2021

Currently changing how location are stored in device. Previously I save the index, egg 0 for JHR01, 49 for SGR01 and so on. This time, I want to save the actual location code, eg: JHR01, JHR02 etc. As I said, it is a long-term migration, just in case JAKIM will add a new zone, it didn't take much to implement it.

Comment on lines 151 to 161
DateTime.fromMillisecondsSinceEpoch(dayTime.times![0]);
DateTime syurukDateTime =
DateTime.fromMillisecondsSinceEpoch(dayTime[1] * 1000);
DateTime.fromMillisecondsSinceEpoch(dayTime.times![1]);
DateTime zuhrDateTime =
DateTime.fromMillisecondsSinceEpoch(dayTime[2] * 1000);
DateTime.fromMillisecondsSinceEpoch(dayTime.times![2]);
DateTime asarDateTime =
DateTime.fromMillisecondsSinceEpoch(dayTime[3] * 1000);
DateTime.fromMillisecondsSinceEpoch(dayTime.times![3]);
DateTime maghribDateTime =
DateTime.fromMillisecondsSinceEpoch(dayTime[4] * 1000);
DateTime.fromMillisecondsSinceEpoch(dayTime.times![4]);
DateTime isyakDateTime =
DateTime.fromMillisecondsSinceEpoch(dayTime[5] * 1000);
DateTime.fromMillisecondsSinceEpoch(dayTime.times![5]);
Copy link
Member Author

@iqfareez iqfareez Sep 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

X perasan part ni patut la notification salah2 haaaha

@iqfareez
Copy link
Member Author

Alhamdulillah, released update 2.2.2

I'll take more about this whole purpose for API migration here, later.

@iqfareez iqfareez merged commit 46a0d12 into master Sep 22, 2021
@iqfareez
Copy link
Member Author

iqfareez commented Sep 27, 2021

Reason behind this migration (to JAKIM API)

Perhaps useful to some people or even me myself in the future 😉

Let's start with the problems. For this app, I've been using 2-3 different APIs. There are always things that I like and things I don't. Common weaknesses in third-party APIs (Azanpro, WaktuSolatApp, and mpti906) that I found is that the prayer times is outdated from JAKIM prayer times. JAKIM always makes amendment and correction to their prayer times over time, and most third-party APIs that take some times (a month or more) to process those changes. The precision of prayer times is vital for a Muslim, and it makes me uncomfortable if this MPT app shows the wrong prayer times. The advantages of these third-party APIs (except WaktuSolatApp API) are having good documentation and reference.

So, that leaves us with JAKIM API, which we can guarantee is the most reliable source of truth for Malaysia prayer times. Yes, but the problem (or weakness) is their API is not public by default; I never saw the docs to use the API. People found those API by inspecting the network traffic in DevTools. So, there is a risk that JAKIM might change their endpoint without notice, and hence breaking the app (oh, I might just overthink this).

I have more to say here, but I don't know how to say hahaha. And sorry but I feel nobody will understand incl. myself in the future hahahaha

Oh, did I mention that JAKIM API also most of the time went down? They have excellent reliability on the database but are poor at managing server loads etc.

So, in conclusion, I chose JAKIM API because of its data reliability for a long run, inshallah, and to overcome the aforementioned problem, I made a backup API, which is just a 'clone' to the JAKIM API just in case their server went offline, this backup API will be used.

Edited 22/2/23:

mpt-backup-api is replaced by mpt-server

@iqfareez iqfareez deleted the jakim-api-migration branch September 13, 2022 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong syuruk (and dhuha) time in Kedah zone
1 participant