A minimal, boxless home-screen widget for Android that shows a live clock and global weather β directly on your wallpaper, with no app-drawer icon and zero third-party dependencies.
π¬π§ English Β Β·Β πΉπ· TΓΌrkΓ§e
Glass Widget is a 5Γ2 Android home-screen widget that combines a large, elegant live clock with the current weather for your location. It is intentionally boxless β the text sits straight on your wallpaper (no card, no frame), in the spirit of the stock Android digital-clock widget.
- π Tap the clock β opens your Clock app
- π¦οΈ Tap the weather β opens your Weather app
- π No icon in the app drawer β it behaves like a pure background app; it only shows up in the widget picker and in Settings β Apps.
- π Global weather via Open-Meteo β works anywhere on Earth, no API key required.
- πͺΆ Zero third-party dependencies β 100% Android framework + Kotlin stdlib. The APK is only ~880 KB.
Optimized for Xiaomi / Redmi / POCO (MIUI) with sensible fallbacks that keep it working on any brand.
| Home-screen widget | Add / permission screen |
|---|---|
![]() |
![]() |
The date and weather condition are localized to your device language (e.g. 18 July Β· Saturday / Clear in English, 18 Temmuz Β· Cumartesi / AΓ§Δ±k in Turkish).
- Live clock using
TextClockβ updates itself with zero battery cost. - Global current weather (temperature, condition, city) from Open-Meteo β no key, no sign-up.
- Boxless / transparent design β big, clean type on your wallpaper with legible text shadows.
- Bilingual UI β English (default) and Turkish, auto-selected by device language.
- Two independent tap zones β clock β Clock app, weather β Weather app (Xiaomi-first with fallbacks to Google/Samsung/AOSP, and finally a web weather page).
- No launcher icon β no
LAUNCHERactivity is declared, so nothing appears in the app drawer. - Actively finds your location β fetches a fresh fix from the Android
LocationManager(network + GPS, no Google Play Services required) and reverse-geocodes the city name. Falls back to a configurable default city only when location is unavailable. - Auto-refresh ~every 10 minutes and after reboot β runs even if the app is never opened, via
AlarmManager+ aJobService; re-armed onBOOT_COMPLETED. No WorkManager (which MIUI aggressively kills). - Tiny & self-contained β ~880 KB APK, no external libraries.
- Download the latest
GlassWidget-x.y.apkfrom the Releases page. - Copy it to your phone and open it. Allow "install from unknown sources" if prompted.
- There is no app icon to look for (by design) β go straight to adding the widget.
Requires the Android SDK (API 36) and JDK 17+.
git clone https://github.com/fyildirim-debug/glass-widget.git
cd glass-widget
./gradlew assembleDebug # Windows: .\gradlew.bat assembleDebug
# APK: app/build/outputs/apk/debug/app-debug.apkOr just open the folder in Android Studio and press Run.
- Long-press an empty area of your home screen β Widgets.
- Find βGlass Β· Clock & Weatherβ and drop it onto the home screen (it fills a 5Γ2 area).
- On the setup screen tap βUse location & addβ:
- Grant the normal location prompt (βWhile using the appβ).
- On the next screen choose βAllow all the timeβ so the weather keeps tracking your location while you travel. (Android hides βAllow all the timeβ from the first dialog for privacy β it only appears on the second step / in Settings.)
- Prefer not to share location? Tap βAdd without permissionβ β a default city (Istanbul, editable in code) is used.
For reliable background weather refresh:
- Settings β Apps β Glass Widget β Autostart β enable
- Settings β Apps β Glass Widget β Battery saver β No restrictions
- Location permission β Allow all the time
The clock is always live regardless of these β they only affect automatic weather refresh.
| What | File | How |
|---|---|---|
| Default city (when no permission) | app/src/main/java/.../Config.kt |
DEFAULT_LAT / DEFAULT_LON / DEFAULT_CITY |
| Which apps open on tap | app/src/main/java/.../AppLaunch.kt |
CLOCK_PACKAGES / WEATHER_PACKAGES |
| Clock font weight | res/layout/widget_glass.xml |
fontFamily β sans-serif, -light, -thin, -medium |
| Text sizes / layout | res/layout/widget_glass.xml |
textSize, layout_weight, padding |
| Text colors / shadows | res/layout/widget_glass.xml + res/values/colors.xml |
textColor, shadow* |
| Clock & date format | res/layout/widget_glass.xml |
format24Hour on clock_time / clock_date |
| Translations | res/values/strings.xml (EN) Β· res/values-tr/strings.xml (TR) |
add a values-<lang> folder for more languages |
GlassWidgetProvider (AppWidgetProvider + BroadcastReceiver)
ββ onUpdate / onEnabled β render cached data, schedule alarm, refresh now
ββ onReceive β ACTION_REFRESH (alarm) & BOOT_COMPLETED β reschedule + refresh
ββ buildViews(context) β RemoteViews (clock + weather + click PendingIntents)
ββ refreshBlocking() β active location β reverse-geocode β Open-Meteo β cache β re-render
WidgetScheduler β AlarmManager (~10 min) + one-shot JobScheduler
WeatherJobService β runs refreshBlocking() in a long window (no ~10s broadcast limit)
WidgetConfigActivity β shown when the widget is added; two-step location permission
LocationHelper β framework LocationManager: active fix (network + GPS) + reverse geocode
WeatherRepository β Open-Meteo current weather over HttpURLConnection (org.json)
WeatherCodes β WMO code β emoji + localized condition string
Config β SharedPreferences cache + defaults
AppLaunch β resolves the Clock / Weather app intents (with fallbacks)
Design decisions
- No WorkManager / Play Services β MIUI kills background workers aggressively and not every device ships GMS.
AlarmManager(10-min tick) firing a short-livedJobService, plus the frameworkLocationManager, is more robust and keeps the app dependency-free. - Active location β the refresh requests a fresh fix (network + GPS) rather than only reading the last-known one, then reverse-geocodes the city. This needs "Allow all the time" to work from the background on Android 10+.
RemoteViews-safe layout β widgets only allow a whitelist of views (no bareView), so the layout usesTextClock,TextView,ImageViewandLinearLayoutonly.
- Language: Kotlin
- Min / Target / Compile SDK: 24 / 36 / 36
- Build: Gradle (AGP with built-in Kotlin)
- Weather API: Open-Meteo (free, key-less, global)
- Dependencies: none (Android framework + Kotlin stdlib only)
- In-widget settings screen to change city without rebuilding
- Extra metrics (feels-like, humidity, wind) and an hourly strip
- Additional sizes (4Γ2, 5Γ1) and theme accents
- More translations
Contributions and suggestions are welcome β open an issue or a PR.
Shows a default city (e.g. Istanbul) instead of my location
- Turn Location on system-wide (quick settings).
- Grant the location permission as βAllow all the timeβ (Settings β Apps β Glass Widget β Permissions β Location). Background location is required for the widget to update your position on its own.
- On MIUI: enable Autostart and set Battery β No restrictions.
- Give it a few minutes (it refreshes ~every 10 min and shortly after you unlock the phone), or remove & re-add the widget to force an immediate update.
Watch what it resolves with:
adb logcat -s GlassWidget:I
# refresh: located=true city=Ankara permission=true
# weather: 21Β° (Ankara)βCan't load widgetβ after adding it β reinstall the latest APK (older builds had a layout bug, fixed in v1.0+).
Weather never loads β make sure the phone has internet; the widget calls https://api.open-meteo.com.
Released under the MIT License β see LICENSE.
Keywords: android widget Β· home-screen widget Β· app widget Β· clock widget Β· weather widget Β· glassmorphism Β· boxless widget Β· minimal widget Β· kotlin Β· textclock Β· remoteviews Β· open-meteo Β· no-dependencies Β· xiaomi Β· miui Β· digital clock Β· weather Β· appwidgetprovider
Made with β€οΈ for a cleaner home screen.
