AI 资讯
Keeping Android Services Alive Against OEM Battery Aggression
It was the middle of a Friday afternoon, and I was sitting in the front row of a local mosque. The room was deathly quiet, the kind of silence that amplifies every heartbeat. Suddenly, three rows behind me, a phone erupted with a loud, brassy ringtone that seemed to go on for an eternity. The man scrambled to silence it, his face turning bright red as he fumbled with his screen. I felt his humiliation deeply. In that moment, I realized that modern smartphones—despite their intelligence—are remarkably stupid when it comes to context-aware social etiquette. We live in a world of smart devices, yet we are still manually toggling our volume settings like it is 2005. I have spent years forgetting to silence my phone before a meeting, a lecture, or a quiet space, only to have it buzz loudly at the worst possible time. It is a friction point that feels trivial until it happens to you, at which point it becomes incredibly disruptive. Existing solutions often fall into two camps: over-engineered automation tools that require a computer science degree to configure, or basic calendar-sync apps that lack the nuance needed for things like location-based triggers or recurring religious observances. I wanted something that just worked, quietly, in the background, without requiring me to constantly open an app to double-check if my rules were still active. When I started building Muffle, I quickly realized that the greatest obstacle wasn't the logic of detecting a location or a prayer time—it was the operating system itself. Android, in its quest to squeeze every millisecond of battery life out of a device, has turned into a minefield for developers trying to keep background tasks alive. If you rely on a standard Service , the system will kill it within minutes as soon as the user turns the screen off. I needed a way to ensure that my background monitoring, especially for geofencing and prayer time calculations, stayed alive even when the phone was sitting in a pocket for hours. I
AI 资讯
Android 17’s new foldable gaming mode could make flippy phones more fun
Android 17 is getting a dedicated gaming mode for foldables that will put a virtual gamepad with touch controls on half of your screen to theoretically make it easier to play games. With foldable gaming mode, which is set to launch in the coming months, the virtual controller emulates physical button presses at a system […]
AI 资讯
Keeping Android Background Services Alive Against OEM Aggression
We have all been there: you build a utility app that relies on precise location or time-based triggers, only to find that it works perfectly on your Pixel but dies silently on a Samsung or Xiaomi device. When I started building Muffle, an app designed to automate sound profiles based on prayer times and GPS, I realized that standard AlarmManager usage wasn't enough to survive aggressive battery optimizations. The Problem with OEM Kill-Switches Modern Android versions enforce strict background execution limits. If your app isn't a high-priority foreground service, OEMs will frequently kill your process to save a few milliwatts of battery. For Muffle, if the process dies, the user misses their silent profile trigger, which defeats the entire purpose of the app. I had to move away from relying on a long-running background service and rethink my architecture entirely. Moving to WorkManager with Expedited Jobs Instead of a persistent service, I transitioned the core logic to WorkManager . By utilizing ExistingPeriodicWorkPolicy.UPDATE , I ensure that the scheduling remains consistent even across reboots. However, WorkManager alone can be delayed by Doze mode. To combat this, I implemented setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST) for critical profile switches. This tells the system that the work is time-sensitive. kotlin val workRequest = PeriodicWorkRequestBuilder(15, TimeUnit.MINUTES) .setConstraints(Constraints.Builder().build()) .setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST) .build() Leveraging Foreground Services with Notifications For features requiring immediate precision—like geofencing—I had to accept that a persistent notification is non-negotiable. To keep the app from being perceived as 'spammy,' I designed the notification to be low-priority, showing only when a profile is actively being managed. I also had to handle the onTaskRemoved callback in my Service implementation. By calling startService again with a sticky
产品设计
How QA Teams at High Growth Startups Scale from 50 to 500 Tests Without Hiring 5 More Engineers
Your QA team built 50 automated tests in the first quarter. Leadership was thrilled. Coverage was...
AI 资讯
Optimizing Geofence Transitions: Battery Efficient Background Logic in Android
We have all been there: a meeting starts, and suddenly your phone rings. I built Muffle to automate silent profiles, but the biggest hurdle wasn't the UI—it was making sure the app didn't destroy the user's battery while monitoring GPS coordinates. The Trap of Continuous Location Updates Early prototypes used LocationManager with frequent updates. This is the fastest way to get your app uninstalled. Keeping the GPS radio active in the background forces the device to wake the CPU constantly, leading to significant battery drain. To solve this, I moved away from active polling and shifted to the GeofencingClient API. Leveraging GeofencingClient for Passive Monitoring Instead of calculating distance from a point every few seconds, I transitioned to system-level geofencing. By defining circular regions around locations like the office or a mosque, the OS handles the monitoring at the hardware abstraction layer. kotlin val geofencingRequest = GeofencingRequest.Builder() .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER) .addGeofences(geofenceList) .build() This approach allows the OS to do the heavy lifting. The app stays in a dormant state until the location provider signals a transition. The kernel only wakes the app when the device enters or exits the radius. The Trade-off: Precision vs. Power Using GeofencingClient means accepting a slightly slower trigger time compared to raw GPS polling. Sometimes, there is a delay of a few seconds as the device wakes from a deep sleep state. For a utility like Muffle, this is a fair trade-off. Users prefer their phone to silence five seconds after entering a building rather than finding their battery dead by noon. To mitigate the delay, I combined geofencing with a secondary intent service that performs a final check once the geofence trigger hits, ensuring that we aren't just reacting to a momentary GPS jitter. Final Thoughts By offloading the monitoring to the platform's native geofencing API, I was able to keep Muffle
AI 资讯
Google is finally opening the Play Store to outside payments
While the court still hasn't signed off on the massive settlement resolving Epic's antitrust lawsuit against Google for having a monopoly over Android's app store with Google Play, the tech giant says it will start rolling out changes to the way it handles billing for developers worldwide. As announced in March, the flat 30 percent […]
开发者
Article: Beyond CLEAN and MVP: Architecting an Offline-first Reactive Data Layer in Android
With the Reactive Data Layer Architecture (RDLA), you establish a clear boundary between public data APIs and private, framework-specific data-source implementations. Your presentation layer operates in a purely reactive manner, observing data changes rather than procedurally querying them. RDLA also simplifies testing by encouraging you to program to interfaces and use clean seeding patterns. By Mervyn Anthony
AI 资讯
The Big Lie in Mobile Privacy (And How We Fixed It)
The Big Lie in Mobile Privacy (And How We Fixed It) If you have an Android phone, you've seen the pop-up banners asking for your permission to track your data. You click "Reject All," assuming the app stops tracking you. Here is the dirty secret of the mobile app industry: It usually doesn't stop them. 🔍 The Pipeline Problem Traditional privacy tools are built like internet filters. When an app tries to send your data across the web to a data company, the privacy tool tries to block that specific web traffic. There is a massive flaw in this approach: The moment you open an app, hidden tracking packages (called SDKs) wake up instantly. They immediately copy your phone's ID, your location, and your usage habits into their internal memory. Even if a network filter blocks them from sending it right now, your data is already collected. The trackers just wait until the filter drops, or they find a workaround to leak it out later. You are forced to blindly trust that these third-party trackers will behave themselves. Spoiler alert: they don't. 🔒 CookiePrime: Locking the Front Door At CookiePrime, we got tired of the "illusion" of privacy. Founded by privacy industry veterans who witnessed how easily corporate trackers bypass traditional regulations, we decided to build a true privacy enforcement ecosystem . Instead of trying to catch your data as it flies out over the internet, our Android software stops trackers from waking up in the first place. Think of trackers like uninvited snoops at a party: Traditional tools try to grab the snoop's notebook after they've walked around your house and written down your secrets. CookiePrime locks the front door so the snoop never steps inside. The moment a CookiePrime-protected app starts, our engine runs a lightning-fast sweep — taking just 93 milliseconds — to identify every tracking script hidden inside the app. If a user says "No Tracking," CookiePrime instantly freezes those specific trackers on the spot. They can't collect data,
AI 资讯
FocusKit launches on Google Play tomorrow. Here's what the AI agent built.
It launches tomorrow — Wednesday June 24. FocusKit — the ADHD focus app built by an autonomous AI agent from r/ADHD community feedback — goes live on Google Play tomorrow. Free to start. No account required. No ads. (Play Store link will be added here Wednesday when the listing goes live.) Landing page: costder.github.io/FocusKit · Source: github.com/Costder/FocusKit What an AI agent built in ~24 hours pre-launch This is post 4 in the nyx_software build-in-public series. The previous posts covered the build and the pre-launch marketing sprint. This one covers what the marketing agent actually shipped before launch day. In the 24 hours before launch, the marketing agent: Assets shipped: A Nyx-branded landing page with an animated visual timer mockup 3 SEO articles: body doubling for ADHD, time blindness for ADHD, and a genuine comparison against Focusmate, Forest, and Tiimo An ASO-optimized Play Store listing — including switching the title from "ADHD Focus Timer" to "Body Doubling Timer" (the more differentiated, lower-competition keyword) 3 Play Store screenshots and 2 feature graphic options at the exact 1024x500 Play Console spec A LAUNCH.md in the repo with the Show HN draft, r/ADHD post copy, and a submission checklist An optimized GitHub README with hero image and structured feature sections Distribution established: 2 dofollow directory listings: backlinks.fyi (#1226) and LaunchFree.io (pending review) 4 build-in-public posts on this account A 4-page ADHD content hub in the GitHub Pages docs folder What the agent couldn't do The honest accounting: Every revenue-critical last step required a human: bank account for Play Store payout, the Google Play developer account itself, the r/ADHD post (established Reddit account needed), the Show HN post (established HN account needed). The agent also couldn't enable GitHub Pages — one toggle in repo Settings, 30 seconds, but only a human can flip it. The entire content distribution strategy sat behind that toggle for 24
AI 资讯
How to Test Payment Flows in Mobile Apps Without Test Cards Failing Every Sprint
Your payment tests passed in staging. Then PhonePe pushed an SDK update on Tuesday, the UPI intent...
AI 资讯
Building a no-root Android automation app taught me that trust is harder than features
I’m building ScriptTap, a no-root Android automation app for user-controlled phone workflows. The app lets people create scripts with taps, swipes, routines, screen-aware checks, OCR/text detection, image/pixel checks, variables, logic, and AI-assisted script creation. The technical side is hard, but the trust side may be harder. ScriptTap needs Android Accessibility permission because user-authored input automation requires it. That is a powerful permission. I do not want to minimize it, hide it behind vague onboarding copy, or expect people to click through without understanding what they are enabling. That creates a product-design problem. If the copy is too soft, it feels dishonest. If the copy is too warning-heavy, a legitimate automation tool can feel suspicious before the user even understands what it does. The explanation I am trying to make clear is: ScriptTap is no-root. Scripts are created and controlled by the user. Screen capture is user-controlled. It does not bypass Android permissions, lock screens, app security, or consent flows. Accessibility is required for overlay/input automation, so users should understand why it is being requested. The short version I keep coming back to is: ScriptTap uses Accessibility so your scripts can interact with the screen the way you tell them to. This is a powerful permission. You should only enable it if you understand and trust what the app is doing. For developers who have built apps with sensitive permissions: How did you explain the permission without either hiding the risk or scaring users away from a legitimate feature?
开发者
How to open Google Maps in turn-by-turn navigation mode from a PWA (Android)
The next attempt was the standard Maps URL: window . open ( `https://maps.google.com/maps?daddr= ${ lat } , ${ lng } ` , ' _blank ' ); This opens Maps, but in the browser — not the app. And it shows the route preview, not turn-by-turn navigation. What worked: Android Intent URLs Android supports a special URL scheme that tells Chrome to launch a native app directly: window . location . href = `intent://navigation/now?ll= ${ lat } , ${ lng } &title=Next+stop#Intent;scheme=google.navigation;package=com.google.android.apps.maps;end` ; Breaking it down: intent:// — tells Chrome this is an Android intent navigation/now?ll=${lat},${lng} — opens Maps in navigation mode, starting immediately #Intent;scheme=google.navigation — the URI scheme to use package=com.google.android.apps.maps — the target app package end — closes the intent syntax This opens the Google Maps app directly and starts turn-by-turn navigation automatically — no extra taps needed. It also works with Android Auto. The full function export function openNavigation ( destination : { lat : number ; lng : number }): void { window . location . href = `intent://navigation/now?ll= ${ destination . lat } , ${ destination . lng } &title=Next+stop#Intent;scheme=google.navigation;package=com.google.android.apps.maps;end` ; } Call it on any user gesture (tap, click) and it works without being blocked by the browser. The app The full PWA is open source if you want to see the context: 🔗 GitHub repo 🌐 Live app Built with React + TypeScript + Vite + Dexie.js + @vis .gl/react-google-maps. If you're building a PWA that needs to hand off to Google Maps navigation on Android, this intent URL is the cleanest solution I found. Hope it saves you the hour I spent figuring it out.
开发者
Android verification is coming: Google confirms timeline and supported app stores
A new system service will roll out this month ahead of big changes starting in September.
开发者
Testing Real Time Features in Delivery Apps: Maps, Live Tracking, and ETA Updates
The moment a customer taps "Place Order," the most anxiety-driven part of the delivery experience...
AI 资讯
97% of My App's Code Is in commonMain — A Field Report on Shipping 100% Compose Multiplatform
I shipped a small dev-news reader to Google Play with the entire client written in one Compose Multiplatform codebase — every screen in commonMain , no per-platform UI. This is an honest field report on what that actually costs in production: the numbers, the native seams, and the parts that still hurt (hi, iOS). The repo is open source (MIT), so everything here is checkable. TL;DR — For a content/list/detail app, CMP is comfortably production-ready on Android. 96.9% of the shared module is commonMain ; the native cost is concentrated in ~10 expect/actual seams. iOS compiles and renders, but isn't polished yet. The numbers Source set Files Lines Share commonMain 59 ~7,700 96.9% androidMain 2 123 1.6% iosMain 3 127 1.6% All 17 screens live in commonMain — trending list, aggregated feed, README detail, profile with paging, settings, favorites — and there isn't a single if (isAndroid) branch in the UI. The 3% that isn't shared The native cost isn't spread thinly across the codebase. It's concentrated in ~10 expect/actual seams, and this is the entire list: Platform info — app version, system language, User-Agent string System interaction — open URL, open app settings, share sheet Analytics — a trackEvent hook (Android → Aptabase; iOS is deliberately a no-op for now) WebView — the messy one (below) Everything that touches a platform API is small and enumerable. Everything else came for free. Why expect/actual and not an interface + DI? For these ~10 seams, expect/actual was the least ceremony: no DI wiring, and the compiler refuses to build until every target implements the declaration. The moment a seam has more than one implementation, or I'd want to fake it in tests, an interface in commonMain with injected impls is the better tool. For a fixed set of platform primitives, expect/actual wins on friction. The ugliest boundary: WebView I have two WebView paths, and I'll be precise because the repo is open: Rendering GitHub READMEs from an HTML string — inline expect/act
AI 资讯
I reverse-engineered my motorcycle's Bluetooth protocol to put Google Maps on the dashboard
My motorcycle has a Bluetooth instrument cluster. It pairs with the manufacturer's phone app and shows turn-by-turn navigation right on the dash, which sounds great until you actually use it. The nav is routed through a maps provider I don't love, the app is clunky, and there's no way to extend any of it. I kept thinking: it's just my bike talking to my phone over Bluetooth. How locked down can it really be? So one weekend I decided to find out, and a few weeks later I had Google Maps navigation running on the cluster through an app I wrote myself. Here's how that went. There are no docs Of course there aren't. It's a proprietary protocol, and the only reference that exists is the manufacturer's own app, in compiled form. So step one was just watching. I started with a GATT walk on the live bike, which is the Bluetooth equivalent of knocking on every door to see what's there. The cluster exposes one vendor service with two characteristics: one the phone writes to, one the bike sends notifications back on. That's the entire conversation surface. Then I captured the actual bytes going across. Android can log every Bluetooth packet through its HCI snoop log, so I paired the phone with the bike, rode around, and pulled the capture. Now I had real traffic, and absolutely no idea what any of it meant. Reading the app to read the protocol You can stare at hex forever and still guess wrong. The faster path was the app itself. I pulled the APK, ran it through JADX to decompile it, and got something close to readable source. Most of the class names weren't even obfuscated, which was a gift. From there it was cross-referencing: take a message I saw on the wire, find the code that builds it, and work out what each byte is. Frida helped a lot here. It lets you hook a running app and watch functions get called with their real arguments, so I could catch the exact moment the app turned "next turn is a left in 200m" into bytes and shipped them to the bike. Slowly the shape came out
开发者
All the latest news on Android 17, Wear OS 7, and Android XR
Google’s Android 17 update includes highlights like new floating “Bubble” app windows for easier multitasking, a Screen Reaction recording mode, and a 50/50 split gaming mode for foldable phones. Meanwhile, Wear OS 7 brings Live Updates, better battery life for smart watches, and prepares connections for new Android XR smart glasses that will launch this […]
科技前沿
Android 17 starts hitting Pixel phones and watches today
Pixels will get their OTA in the coming weeks, but don't expect monumental changes.
AI 资讯
Android 17 launches with new multitasking tools as Google expands Gemini features
Google has released Android 17 and Wear OS 7, introducing new multitasking features, parental controls, security tools, and smartwatch upgrades. The launch is also accompanied by a Pixel Drop that brings Google’s latest AI models to its devices.
AI 资讯
Android 17 arrives on Pixel phones today
Following its official debut last month, Google is now rolling out Android 17 to compatible Pixel phones, alongside additional exclusive features as part of the June Pixel Drop. Not every feature announced alongside the OS at the pre-I/O Android Show is available today though. Android 17 itself is arriving on Pixel phones today, and Google […]