DEV Community

Cover image for How I Built a Full-Stack Android App at 84 Years Old (Using Google Gemini as my Junior Dev
Terry Mechan
Terry Mechan

Posted on • Originally published at Medium

How I Built a Full-Stack Android App at 84 Years Old (Using Google Gemini as my Junior Dev

By Terry Mechan

They say you can’t teach an old dog new tricks. I firmly disagree.

I started my career as a British Telecom apprentice in 1960.

I spent decades managing technology projects across Africa and Asia and developing patent-winning security systems for De La Rue.

I know engineering. I know logic. I know architecture. I know innovation

But I didn’t know Kotlin or anything to do with building an Android App.

At 84, I wanted to build a solution to a modern problem: Mainstream family safety apps have turned into surveillance tools. They drain battery and track 24/7 history. I wanted to build a Privacy-First Utility that only checks location on-demand via SMS and Email, without the receiver needing an app.

I had the vision, but not the syntax. So, I hired an AI assistant:-Google Gemini.

Here is how I used AI not to “do it for me,” but to act as my hands while I provided the brain.

The Architecture

Most people use AI to write email subject lines. I used it to build a full-stack architecture. I needed four distinct technologies to talk to each other securely:

Android App (Kotlin): To run on the phone and manage GPS.
Cloud Messaging (Firebase FCM): To wake up the phone from “Doze Mode” instantly.
Backend API (PHP): To handle secure requests.
Database (MySQL): To store authorized “Buddy” relationships.

I acted as the Technical Director. I described the logic flow, error handling, and privacy constraints. Gemini acted as the Junior Developer, writing the syntax and refactoring based on my testing.

Here is a look under the hood.

Challenge 1: The “Sleeping” Phone (Kotlin & Firebase)

The biggest technical hurdle was Android’s “Doze Mode.” If a phone is in a pocket for an hour, the OS kills background network access to save battery. I needed a way to wake it up remotely to check location.
I explained the logic to Gemini: “I need a high-priority signal that bypasses battery optimization to trigger a location check immediately.”
Gemini recommended Firebase Cloud Messaging (FCM) and wrote this Kotlin service to handle the “Wake Up” command.

The Code (Kotlin):

// Generated by Gemini, Architected by Terry Mechan
override fun onMessageReceived(remoteMessage: RemoteMessage) {
val action = remoteMessage.data["action"]

if (action == "buddy_location_request") {
// The phone is asleep. We need to wake it up and grab a snapshot.
val webTriggerCode = remoteMessage.data["web_trigger_code"]
val replyToNumber = remoteMessage.data["requester_phone_number"]

// Critical: Use WorkManager to guarantee execution even if app is killed
val workerData = Data.Builder()
.putString("task", "FETCH_BUDDY_LOCATION")
.putString("reply_to_number", replyToNumber)
.build()
val request = OneTimeWorkRequestBuilder()
.setInputData(workerData)
.setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST)
.build()
WorkManager.getInstance(applicationContext).enqueue(request)
}
}

My contribution: I realized the initial code failed when the app was force-closed by the OS.

I directed Gemini to switch from a standard IntentService to WorkManager with setExpedited to ensure reliability during deep sleep.

Challenge 2: The “No-App” Interface (PHP)

My core requirement was that the Receiver (the Buddy) should not need to install the app. They should just click a link.

I needed a secure, expiring link system.

I directed Gemini to write a PHP script that validates a secure token against my MySQL database before allowing a location request.

The Code (PHP):

// Validating the Secure Link (Backend Logic)
$web_code = $_GET['code'];
$stmt = $pdo->prepare("SELECT owner_user_id, is_master_buddy_switch_on FROM sms_authorized_requesters WHERE web_trigger_code = ?");
$stmt->execute([$web_code]);
$buddy = $stmt->fetch();
if ($buddy) {
if ($buddy['is_master_buddy_switch_on'] == 1) {
// Send the 'Wake Up' signal to the Android Phone via Firebase
sendFCMToDevice($buddy['owner_user_id'], 'buddy_location_request');
echo json_encode(["status" => "success", "message" => "Location requested. Check your SMS."]);
} else {
echo json_encode(["status" => "error", "message" => "User is currently offline."]);
}
}

My contribution: I insisted on the logic check for is_master_buddy_switch_on. Privacy is paramount; if the user toggles the switch OFF in the app, the PHP backend must reject the request instantly.

Challenge 3: The Data Structure (MySQL)

We needed a way to link “Buddies” (Requesters) to “Users” (Phone Owners) without storing sensitive personal data unnecessarily.

I sketched the schema; Gemini wrote the SQL.

The Code (MySQL):

CREATE TABLE sms_authorized_requesters (
id INT AUTO_INCREMENT PRIMARY KEY,
owner_user_id INT NOT NULL,
requester_name VARCHAR(100),
requester_phone_number VARCHAR(20),
web_trigger_code VARCHAR(64) UNIQUE, -- The secret key
is_email_only TINYINT DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (owner_user_id) REFERENCES users(id) ON DELETE CASCADE
);

The Result: MyBuddy

After 12 months of iteration, testing, and “arguing” with the AI (yes, you have to correct it!), the result is a robust, published application.
MyBuddy allows users to share their location or set arrival alerts without 24/7 tracking.

The code is efficient (thanks to Kotlin Coroutines).
The backend is fast (thanks to PHP).
The logic is sound (thanks to 60 years of engineering experience).

This project proved to me that AI does not replace human experience — it amplifies it. It allowed an 84-year-old to build a product that usually requires a team of five.

Where to see it:

The Philosophy: Read more about my concept of “Sharing without the stalking” on the main website:
👉 PlaceMe Guardian Homepage

The Tech Demo: Try the technology right now without installing the app (Web Simulation):
👉 Try the Web Demo

The App: View the live release on the Play Store:
👉 MyBuddy on Google Play

Top comments (0)