The Many Facets of Love and Intents: Blending Romance and Code in Android Development

Emmanuel Ututu
4 min readDec 1, 2023

Part II

Photo by Boluwatife Oguns on Unsplash

Some weeks back, we learned about intents, love, and shooting your shot right, and now, revisiting the charming lanes of Lagos, we find Chijioke and Olufe, our protagonists, again in a tale that intertwines love with Android development. As the festive season approaches, their story evolves, mirroring the complexities and nuances of creating seamless Android applications. Let’s delve into this narrative, exploring how various aspects of love can enlighten the multifaceted world of Android Intents.

Starting an Activity — The First Date:

Remember Chijioke’s first date with Olufe? The butterflies, the anticipation, and finally, the leap of faith to ask her out. This mirrors the process of starting another activity in Android. Just as Chijioke prepared for the date, developers prepare their apps for transitions.

Scenario: Ideal for travel apps when booking a flight, transitioning from choosing a destination to filling in passenger details.

val dateIntent = Intent(this, DinnerActivity::class.java)
dateIntent.putExtra("ReservationName", "Table for Two")
startActivity(dateIntent)

This code is akin to Chijioke planning his date, selecting the perfect venue, and making a reservation — all set for a memorable evening.

Starting a Service — The Daily Good Morning Texts:

Just as Chijioke and Olufe exchanged daily “good morning” and “good night” messages, a service in Android runs quietly in the background, continuously performing tasks. It’s like a steady stream of affection, reminding your app that you’re always there.

Scenario: Common in fitness apps to track steps or monitor heart rate in the background.

val msgIntent = Intent(this, MorningMessageService::class.java)
startService(msgIntent)

These lines of code represent the routine yet comforting messages that keep the spark alive in a relationship.

Delivering a Broadcast — Announcing Your Relationship Status:

The excitement of making a relationship official mirrors the broadcasting of intents in Android. When Chijioke and Olufe decided to announce their status, it’s akin to an app sending out a broadcast to all who may be interested.

Scenario: Used in messaging apps to notify other components of new messages or updates.

val statusIntent = Intent()
statusIntent.action = "com.dikascode.NEW_RELATIONSHIP_STATUS"
sendBroadcast(statusIntent)

This announcement in the app world is like changing your relationship status on social media, letting the whole world know you’ve found the special one ❤️🫠.

Implicit Intents — Finding Shared Interests:

Chijioke knew Olufe loved music, but not her favorite genre. This uncertainty is the charm of implicit intents. You express a general desire, and the Android system finds the best fit.

Scenario: Useful in photo-sharing apps where users can choose images from the gallery without the app needing to know the source of the files.

val musicIntent = Intent(Intent.ACTION_PICK, MediaStore.Audio.Media.EXTERNAL_CONTENT_URI)
startActivity(musicIntent)

This code is Chijioke inviting Olufe to a music festival, open to exploring whatever tune catches their fancy.

Receiving Results — Waiting for a Reply:

The anxious wait for a reply after Chijioke confessed his feelings is akin to starting an activity for a result in Android.

Scenario: This mirrors situations in social apps where you might send a friend request and wait for acceptance.

val replyIntent = Intent(this, ConfessionActivity::class.java)
startActivityForResult(replyIntent, AWAITING_REPLY)

It’s a moment of vulnerability, both in love and in code, where the outcome is eagerly anticipated.

Application Integration — Meeting the Friends:

Introducing your partner to your friends is much like using intents to integrate two applications. It’s about extending your circle and trusting another app to add value to yours.

Scenario: Seen in payment apps integrating with e-commerce platforms for seamless transactions.

val shareIntent = Intent().apply {
action = Intent.ACTION_SEND
type = "image/jpeg"
putExtra(Intent.EXTRA_STREAM, photoUri)
}
startActivity(Intent.createChooser(shareIntent, "Share Image"))

Setting Alarms — Remembering Anniversaries:

Just as we set reminders for special dates in a relationship, intents can set alarms for specific actions in an app, ensuring that significant moments are not forgotten.

Scenario: In a personal task management app, users can set alarms to remind them of important personal events like anniversaries. This feature ensures that amidst their busy schedules, they never miss these significant moments.

val anniversaryIntent = Intent(AlarmClock.ACTION_SET_ALARM)
anniversaryIntent.putExtra(AlarmClock.EXTRA_MESSAGE, "Anniversary Dinner")
startActivity(anniversaryIntent)

This code is like marking your calendar for that important date night, a gesture of care and attention.

Device Capabilities Interaction — Going Beyond Texts:

Sometimes, a relationship needs more than texts; a call can make a difference. In Android, intent bridges the gap between different forms of communication.

val callIntent = Intent(Intent.ACTION_CALL, Uri.parse("tel:070XXXXXXXX"))
startActivity(callIntent)

This action in the app world is like choosing to call instead of text, offering a more personal touch.

Custom Application Actions — Personal Love Gestures:

Personal gestures in a relationship, like Chijioke planning a surprise for Olufe, parallel custom actions in apps, where unique functionalities enhance the user experience. These tailored experiences make each interaction special and memorable.

Scenario: In gaming apps, where custom actions can lead to different gaming experiences.

val gestureIntent = Intent(this, GameActivity::class.java)
gestureIntent.putExtra("GestureType", "SwipeRight")
startActivity(gestureIntent)

Conclusion — A Tapestry of Love and Code:

Photo by Opeyemi Adisa on Unsplash

As the approaching festive lights of Lagos cast a warm glow, Chijioke and Olufe’s story blends with the world of Android Intents, illustrating that both love and app development require understanding, communication, and adaptability. To the developers, as you continue on your coding journey, let these parallels guide you through the intricate web of Android Intents. May your festive season be filled with successful coding, heartwarming connections, and the joy of discovery.

Happy festive season ahead 🎄❄️☃️❤️

--

--

Emmanuel Ututu

3yr Android developer & writer, adding creativity & imagination to projects. I love to dream of needs and their solutions.