-
-
Lantern: emergency guidance that works offline. Gemini picks a source-checked Safety Card on the phone or in the cloud.
-
Report in 3 steps: what is happening, how many people, then needs and place. Saved on the phone if there is no signal.
-
Ask screen: type a question in English, Urdu or Roman Urdu, or tap a topic. Answers come from source-checked Safety Cards.
-
Past alerts and the current alert level in each area.
-
Past alerts and the current alert level in each area.
-
Responders send URGENT, WARNING or INFO alerts to an area, with a preview of how it looks on a phone.
-
Open a report to see the people, the needs and the arrival time, then assign it or mark it done.
-
Alerts tab: live alerts that responders send from Lantern Desk.
-
Lantern Desk: live reports, most urgent first, with counts for not taken, very urgent and people waiting for help.
-
Lantern Desk sign-in. Only approved responder Google accounts can enter.
-
Map view of reports. Our test reports came from an emulator, so they show Mountain View, California.
Inspiration
When a flood or an earthquake hits, mobile networks are often the first thing to fail. That is exactly when people need clear steps and a way to ask for help. Most emergency apps need a connection, and AI chatbots can sound confident and be wrong. We wanted an app that still gives checked guidance with no signal.
What it does
Lantern is an Android app for floods and earthquakes, with a dashboard for responders.
- Ask: type a question in English, Urdu or Roman Urdu. Lantern finds the matching Safety Card and shows its text unchanged, with its source. The model picks the card. It does not write the advice.
- Report: send what is happening (type, needs, people, place). If there is no signal, the report is saved on the phone and sent when signal returns.
- Lantern Desk: a responder dashboard with Google sign-in for allowed responders, live reports sorted by urgency, a map, alerts and a light and dark theme.
How we used Firebase AI Logic
Firebase AI Logic is how the app calls Gemini. The routing is: Gemini Nano on the device first, then cloud Gemini through Firebase AI Logic, then an offline keyword match on the phone, and finally a clear "no match" message with the emergency numbers. Only the question text goes to the cloud. Never a name, a phone number or an exact location.
We also use App Check, Remote Config (to update cards and settings without a new build), Firestore, Firebase Authentication and Analytics.
Cloud Gemini through Firebase AI Logic is tested on a real phone. On-device Gemini Nano runs only on supported phones, and we could not test it on one in time, so we do not claim a Nano result.
Why the model never writes the advice
In an emergency, one wrong sentence can hurt someone. So every answer comes from a Safety Card. We built 6 cards (3 flood, 3 earthquake). Every step on every card links to a public source (PDMA Khyber Pakhtunkhwa, NIH Pakistan, CDC), and the supporting sentence for each step is in our verification log in the repo. The model only chooses which card fits.
Rules that never change: no medical doses, no diagnoses, a report leaves the phone only when the user taps send, and every answer starts with "Call your local emergency number first if you can."
Challenges
- Gemini Nano is validated on-device for English and Korean only. Urdu and Roman Urdu quality is unknown, so we kept the model's job small: choose a card.
- Gemini Nano runs only on supported phones, and none of our team phones are on the list.
- Emergency numbers differ by region. We list only the ones we saw on official pages (Punjab 1122, Khyber Pakhtunkhwa PDMA 1700), each with its region.
Accomplishments we are proud of
- A working Android app with Ask and Report, including offline queueing.
- Six Safety Cards with every step traced to a public source.
- A responder dashboard, Lantern Desk, connected to live Firebase data (Google sign-in, live reports and alerts).
- A routing order that still gives an answer when there is no signal and no Nano.
What we learned
Keep the model's job narrow and let verified text do the talking.
Honest limits
- The Safety Cards were checked by one person. The Urdu and Roman Urdu text is our own translation of the English sources.
- The flood sources are from Khyber Pakhtunkhwa, so we do not claim they cover every province.
- Emergency numbers are verified for Punjab and Khyber Pakhtunkhwa only.
- Alerts are in-app banners from live listeners, not push notifications.
What's next
Cards for shelter and missing family, emergency numbers for every province, a native Urdu review and a second card checker, testing on supported phones, and push notifications for alerts.
Built With
- android
- firebase
- firebase-ai-logic
- firebase-app-check
- firebase-authentication
- firebase-remote-config
- firestore
- gemini
- gemini-nano
- jetpack-compose
- kotlin
- react
- typescript
- vite

