An Android TV home screen built around the prayer day.
أفنون: شاشة رئيسية لتلفاز أندرويد، تدور حول يوم الصلاة: المواقيت والقبلة والأذان وإذاعة القرآن الكريم.
Arabic first (RTL) and English · Offline prayer times for 192 cities · 14 adhan voices · Qibla · 16 Quran radio stations and reciters
إِنَّ الصَّلَاةَ كَانَتْ عَلَى الْمُؤْمِنِينَ كِتَابًا مَّوْقُوتًا · النساء ١٠٣
Indeed, prayer has been decreed upon the believers at fixed times. (An-Nisa 4:103)
Afnon replaces the stock launcher on an Android TV with one quiet screen. The next prayer and a live countdown sit inside a mihrab arch. The day's six times run across the top, your favourite apps sit below, and the call to prayer comes to the TV by itself. Built and tested on a TCL 55P7K (Google TV, Android 12), driven only by the remote's D-pad.
Afnon started from cleanyourtv:
- Debloat. cleanyourtv's prompt cleared the TCL's ads and bloat, reversibly, with a backup and a restore script.
- Launcher. cleanyourtv's Apple TV-style home took over from the stock one.
- Design. A new direction, Mihrab, was designed around the prayer day: lapis and gold, with an arch for the next prayer.
- Build. Claude Code built it on the real TV over ADB, one screen at a time, checking each with a screenshot.
بدأ أفنون من مشروع cleanyourtv: تنظيف التلفاز من الإعلانات، ثم شاشة رئيسية بسيطة، ثم تصميم «محراب» حول يوم الصلاة، ثم بناؤه على التلفاز نفسه شاشةً شاشة.
- Prayer times, fully offline. Calculated on the TV with
adhan-java. It ships with 192 cities in 43 countries across
the Arab world, Asia, Europe, the Americas, Africa and Oceania, picked by region, then country, then city. Each
city starts on the method and Asr school its mosques use; you can still choose the calculation method (Egyptian,
Umm al-Qura, MWL, Karachi, Oman's Ministry of Awqaf and more), the Asr school (Shafi'i or Hanafi) and a Hijri date offset. Oman's cities start on the Ministry of
Awqaf's method, fitted to its published timetable so every
prayer is within a minute or two of it (see
Method.OMAN_AWQAF). The Hijri date and Ramadan mode always use the Umm al-Qura calendar, so where local moon sighting differs (the United States, for one) set the offset. - Qibla and room direction. The Qibla bearing from your city, and a one-time "which way does the TV face" setting, so the screen can say "Qibla is behind you".
- The adhan. 14 voices to choose from, plus a separate Fajr adhan. If the TV is muted or at zero, the volume comes up for the adhan and goes back afterwards.
- Reminders. A card on Home, or a banner over other apps, 5 to 30 minutes before each prayer. It can
also say «اقترب موعد صلاة …», and when a prayer's adhan is off, «حان الآن موعد صلاة …» as its time begins
(both lower whatever is playing for a moment instead of pausing it; see
tools/fetch-announce.shbelow). - Friday and Ramadan. Both modes switch themselves on from the date.
- Quran Radio. إذاعة القرآن الكريم from Cairo (98.2 FM) by default, streamed live. Settings → Radio
→ Station picks another:
- Quran radios: Nablus, Shabab FM Quran (Nablus), Qatar 1 and 2, Jordan.
- Ten reciters' 24/7 channels from mp3quran.net (Alafasy, Abdul Basit, Al-Minshawi, Al-Husary, Al-Muaiqly, Al-Ghamdi, Al-Sudais, Al-Dosari, Al-Qatami, Mohammad Rashad Al-Shareef).
- Live level bars, from the audio itself.
- It pauses for the adhan and resumes after.
- Screen off while listening, using TCL's own Audio Only mode: the panel goes dark and the recitation keeps playing.
- Remote buttons. An accessibility service maps the remote's app buttons, and its Settings, Input and All apps buttons, to Afnon. The stock home's background service can then be disabled.
- Arabic and English. RTL and LTR layouts. Language follows the TV or is set in Afnon. Digits are Arabic-Indic or Latin.
- Light on the TV. Plain Java and Views, with no AndroidX, Kotlin or Compose. No blur, no video, no shadows. It runs smoothly on a 1.8 GB TV.
Afnon has no accounts, no analytics and no ads. The radio is the only feature that uses the
internet, and it connects only to the chosen station's stream, one at a time: stream.radiojar.com (Cairo),
quran-radio.org (Nablus), streaming.zaytonatube.com (Shabab FM), live.kwikmotion.com (Qatar),
jrtv-live.ercdn.net (Jordan) or backup.qurango.net (the reciters). The list is in Radio.STATIONS. Afnon
makes no other network requests, and its network security config
allows plain HTTP for the Cairo stream only.
Your city and settings stay on the TV.
The web preview is a separate static site, not the app. It loads nothing from other sites except the station's stream when you press Play, and keeps your settings in your browser.
| Permission | Why |
|---|---|
INTERNET, WAKE_LOCK |
The radio stream, kept playing with the screen off |
RECORD_AUDIO |
Required by Android's Visualizer, to read Afnon's own player for the level bars. It does not use the microphone. |
WRITE_SECURE_SETTINGS |
Turns the TV's sleep timer off while the radio plays, and puts it back after. On TCL, also writes the remote button mappings (see TCL notes) |
ACCESS_FINE_LOCATION |
Android 9+ hides the Wi-Fi name without it; Home shows the name. Afnon never reads the TV's location |
| Accessibility service | Remote button mapping (see RemoteKeys.java) |
No computer needed. Install afnon-installer.apk
on an Android phone (8 or later) on the same Wi-Fi as the TV, open it and follow the screens:
- Prepare. How to turn on Developer options and USB debugging (or Wireless debugging) on the TV.
- Connect. TVs on the Wi-Fi appear by themselves (mDNS for classic debugging, Wireless debugging's random port and the pairing port, and a sweep for port 5555); or type the address, with or without a port. Then accept "Allow USB debugging?" on the TV, or type the six-digit pairing code it shows.
- Install. The latest
afnon.apkfrom this repo's releases (skipped when the TV already has it), then the steps intools/setup-steps.txtat that release's tag, the same filetools/install.shruns. - Make it yours. The city and prayer settings, the four favourites (with the TV's own app icons) and a
cleanup: ads, tracking and preloaded apps, turned off (never uninstalled) from
tools/clean-catalog.tsv, with an undo.
The installer keeps no copies of what can change: the APK, the setup steps and the cleanup list come from GitHub,
and the cities and apps from Afnon on the TV (SetupProvider), so a new Afnon release needs no new
installer. Source in installer/ (plain Java, an ADB client library and Conscrypt for TLS).
Download afnon.apk from the latest release, then:
export TV=192.168.1.50:5555
adb connect $TV
adb -s $TV install -r afnon.apk
adb -s $TV shell cmd package set-home-activity tv.afnon.home/.MainActivity
adb -s $TV shell settings put secure screensaver_components tv.afnon.home/.AfnonDream
adb -s $TV shell pm grant tv.afnon.home android.permission.RECORD_AUDIO
adb -s $TV shell pm grant tv.afnon.home android.permission.WRITE_SECURE_SETTINGS
adb -s $TV shell pm grant tv.afnon.home android.permission.ACCESS_FINE_LOCATIONThen turn on Afnon remote buttons in the TV's Settings → Accessibility. The APK includes the adhan recordings.
If Home still opens the stock launcher (stock Android TV and Google TV keep theirs ahead of any app), use the
phone installer or tools/install.sh: they turn the stock launcher off behind a safety switch that turns it back
on if Afnon doesn't come up, and the installer's cleanup can undo it.
You need a computer with adb, JDK 17, the Android SDK (platform 34), and the TV with Developer options → USB / Network debugging on.
git clone https://github.com/egyjs/afnon-android-tv-launcher.git
cd afnon-android-tv-launcher
export TV=192.168.1.50:5555 # your TV's address
adb connect $TV # accept the prompt on the TV
bash tools/install.sh # fetches the adhans, builds, installs, sets Afnon as homeinstall.sh runs tools/fetch-adhans.sh the first time. That script downloads the 14 recordings
from abodehq/Athan-MP3. They aren't in this repo because
that collection has no licence.
The spoken reminder and «حان الآن موعد صلاة …» are 12 short clips made on your machine: install.sh runs
tools/fetch-announce.sh the first time, which reads tools/announce-lines.txt with a Microsoft neural Arabic voice
through edge-tts (pip install edge-tts; VOICE= picks another) into
app/src/main/assets/announce/. They aren't in this repo; the release APK includes them. Without them
those two stay silent and everything else works.
Close network debugging when you're done. Port 5555 is plain text, and on some firmware any
device on your network can get a shell through it. Switch USB debugging and Network debugging off
in Developer options, revoke the USB debugging authorisations, reboot, and check that
nc -vz <tv-ip> 5555 fails.
| I want to… | Do this |
|---|---|
| Change favourites | All apps → hold OK on an app → Put in favourites instead of… |
| Change city, method, adhan voice, radio options | The remote's Settings button, or the gear on Home |
| Point a remote button at another app | Edit the table at the top of RemoteKeys.java, then bash tools/install.sh |
| Change colours or the star pattern | Tokens.java (the design tokens) and Ui.starLattice |
| Disable a stock app | bash tools/disable.sh <package> (reversible; logged to state/disabled.log) |
| Re-enable an app | bash tools/enable.sh <package>, or on the TV: Settings → Apps → See all apps → Show system apps → the app → Enable |
| Go back to stock | bash tools/restore.sh, then reboot. Re-enables everything in the log, restores home, screensaver and sleep timer, and uninstalls Afnon. |
adb shell am start -n tv.afnon.home/.MainActivity --es test friday # or ramadan, now (back to today)
adb shell am start -n tv.afnon.home/.MainActivity --es test reminder # Home's reminder card, spoken
adb shell am start -n tv.afnon.home/.MainActivity --es test call # the call screen, 8 s later
adb shell am start -n tv.afnon.home/.MainActivity --es test banner # the banner and its voice, 8 s later (open another app)
adb shell am start -n tv.afnon.home/.MainActivity --es test announce # «حان الآن موعد صلاة …», 8 s later
adb shell am start -n tv.afnon.home/.MainActivity --es test radio # radio on / off
adb shell am start -n tv.afnon.home/.MainActivity --es station nablus # pick a station (ids in Radio.STATIONS)
bash tools/shot.sh home # screenshot to state/shots/Some of this is TCL-specific. Each piece fails quietly on other brands:
- Audio Only (screen off while listening) asks TCL Settings to show its own countdown dialog
(
com.tcl.settings.SHOW_WINDOW,Type=AudioOnly). Elsewhere Afnon falls back to a black, dimmed screen. - TCL remotes send Settings as
KEYCODE_NOTIFICATIONand the browser key as code4159. - The remote buttons go through TCL's own button remapping (
TclKeys.java), so the accessibility service doesn't filter keys and holding Volume keeps changing it. Elsewhere the service filters keys itself. install.shgrants TCL'sAPP_AUTO_STARTso the remote buttons service survives a reboot.- Android's
screen_brightnesssetting does nothing on this TV, because TCL drives the backlight itself.
Tested on one Super General TV (CVTE board, Android 9). CVTE makes the boards in many budget TVs; Afnon detects them by their hotkey service and each piece is skipped elsewhere:
- The firmware answers the remote's buttons itself (from
/vendor/menu_config_xml/hotkey.xml), so the remote buttons service doesn't filter keys there (FirmwareKeys.java) and holding Volume keeps changing it. - The firmware leaves Source to the app in front, so Home opens CVTE's source menu
(
com.cvte.tv.globalui) itself. - Buttons wired to an app that can't be replaced (ESHARE opens EShare) can be pointed at another app with
the
redirectspreference, e.g.com.ecloud.eshare.server=com.droidlogic.miracast. Empty by default. - If Afnon guesses wrong about key filtering on some TV, the
key_filterpreference (on/off) forces it. install.shgrants location, which Android 9+ needs before Home can show the Wi-Fi name.
app/src/main/java/tv/afnon/home/
MainActivity Home: clock, prayer row, favourites, radio pill and card, focus map
PrayerDayActivity Today's prayers, Qibla dial, room direction
AllAppsActivity Every app; hold OK to arrange favourites
SettingsActivity On-TV settings (prayer, reminders, radio, display, network, device)
NowActivity The call to prayer
AfnonDream Screensaver
PrayerWatch Reminders, banner and the call, run inside the accessibility service
RemoteKeys Remote button mapping
TclKeys The same buttons through TCL's own remapping, so held keys still repeat
Radio, RadioBars Quran Radio player and its level bars
ScreenOffActivity Screen off while listening (TCL Audio Only, or a black fallback)
Announce The spoken reminder and «حان الآن موعد صلاة …»
PrayerDay, Prefs, Reminders, Adhans, Text, Tokens, Ui …
installer/ The phone app that installs and sets up Afnon over ADB (Finder, Adb, Tv, Setup, Personalise)
tools/setup-steps.txt What Afnon needs after install: one list for install.sh and the phone installer
tools/clean-catalog.tsv The cleanup list, built weekly from cleanyourtv by tools/gen-clean-catalog.py
tools/ install, restore, disable/enable, fetch-adhans, fetch-announce, screenshot
docs/screenshots/ the images above, all from the real TV
أفنون شاشة رئيسية لتلفاز أندرويد، تبدأ من يوم الصلاة. الصلاة القادمة والعدّ التنازلي في قلب محراب، ومواقيت اليوم الستة في الأعلى، وتطبيقاتك المفضلة تحتها. ويأتي الأذان إلى التلفاز وحده في وقته.
- مواقيت بلا إنترنت: تُحسب على التلفاز نفسه، مع ١٩٢ مدينة في ٤٣ دولة تُختار بالمنطقة ثم الدولة ثم المدينة، وعدة طرق حساب، والمذهب الشافعي أو الحنفي في العصر، وتعديل التاريخ الهجري. التاريخ الهجري ووضع رمضان يعتمدان دائمًا على تقويم أم القرى، فإن اختلفت رؤية الهلال المحلية (كما في الولايات المتحدة) فاضبط التعديل.
- القبلة واتجاه الغرفة: اتجاه القبلة من مدينتك، وإعداد لمرة واحدة لاتجاه التلفاز، فتقول لك الشاشة «القبلة خلفك».
- الأذان: ١٤ صوتًا وأذان خاص للفجر. إن كان الصوت مكتومًا يرتفع للأذان ثم يعود كما كان.
- التنبيهات: بطاقة على الرئيسية، أو شريط فوق التطبيقات الأخرى، قبل كل صلاة.
- الجمعة ورمضان: تتغير الشاشة وحدها؛ الجمعة مكان الظهر مع تذكير بسورة الكهف، والإفطار والسحور في رمضان.
- إذاعة القرآن الكريم: من القاهرة (٩٨٫٢ إف إم) افتراضيًا، بث مباشر، وأعمدة تتحرك مع صوت التلاوة نفسه. تتوقف للأذان ثم تُستأنف، ويمكن إطفاء الشاشة أثناء الاستماع لتوفير الكهرباء. ومن الإعدادات ← الإذاعة ← المحطة: إذاعات القرآن الكريم من نابلس وشباب إف إم وقطر والأردن، أو قناة أحد القرّاء العشرة على مدار الساعة.
- أزرار الريموت: أزرار التطبيقات والإعدادات والمدخلات تعمل مع أفنون.
- العربية أولًا: من اليمين إلى اليسار، مع الإنجليزية، والأرقام عربية أو لاتينية.
- بلا حسابات ولا إعلانات ولا تتبّع. الإذاعة وحدها تستخدم الإنترنت.
للتثبيت حمّل ملف afnon.apk من صفحة الإصدارات، أو ابنِه من المصدر كما في قسم Install أعلاه. وللعودة إلى الشاشة الأصلية شغّل tools/restore.sh ثم أعد تشغيل
التلفاز. وبعد الانتهاء أغلق «تصحيح الأخطاء عبر الشبكة» في خيارات المطوّرين.
- Prayer times: adhan-java (MIT) by Batoul Apps.
- Adhan recordings: abodehq/Athan-MP3. They are not in the
source;
fetch-adhans.shdownloads them, and the release APK includes them with this credit. If you hold the rights to a recording and want it removed, open an issue. - Radio: إذاعة القرآن الكريم, Cairo; Holy Quran Radio, Nablus; Shabab FM; Qatar's and Jordan's Quran radios; and mp3quran.net's reciter channels, each via its own public stream. Afnon is not affiliated with any of them.
- Fonts: Amiri, Alexandria and Marcellus, all under the SIL Open Font Licence. See THIRD_PARTY.md.
- Started from cleanyourtv. Built with Claude Code on the real TV, screenshot by screenshot.
Contributions are welcome; see CONTRIBUTING.md. Released under the MIT licence.










