<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shrey on Medium]]></title>
        <description><![CDATA[Stories by Shrey on Medium]]></description>
        <link>https://medium.com/@shrey524?source=rss-f00c437d2b08------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*09BL5sq78JO0z5l0Q28QYw.png</url>
            <title>Stories by Shrey on Medium</title>
            <link>https://medium.com/@shrey524?source=rss-f00c437d2b08------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 12:12:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shrey524/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The End of Dumb Software]]></title>
            <link>https://shrey524.medium.com/the-end-of-dumb-software-ab8f70392bc3?source=rss-f00c437d2b08------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab8f70392bc3</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Shrey]]></dc:creator>
            <pubDate>Wed, 24 Jun 2026 12:16:48 GMT</pubDate>
            <atom:updated>2026-06-24T12:16:48.756Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Why AI won’t kill software, it will kill dumb software. Most apps and software will be rebuilt as intelligence becomes cheaper, local, and unavoidable</blockquote><p>A few weeks ago, SpaceX acquired Cursor for $60 billion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qQUIZSwzaK2BnutHoLujfg.png" /></figure><p>Sixty billion dollars for a company founded in 2022. A company that, until very recently, didn’t even have its own frontier model.</p><p>Most people looked at that headline and came to the same conclusion:</p><blockquote><em>“Of course. It’s AI.”</em></blockquote><p>I think that’s the wrong conclusion. For most of its journey, Cursor relied heavily on models built by OpenAI and Anthropic. The intelligence was available to everyone — any competitor could access the same APIs, the same underlying technology. What Cursor built was something else. A better way to use that intelligence. A better developer experience. A deeper understanding of what developers were actually trying to accomplish.</p><p>That’s what $60 billion was really buying.</p><p>This isn’t a story about AI models. It’s a story about where value is moving. And I don’t think AI is going to kill software because of it.</p><p>I think it’s only going to kill dumb software.</p><h3>Intelligence Is Becoming Infrastructure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HQAV8jyVM795N8urfxoXyA.png" /></figure><p>For the last few years, the industry has been obsessed with the intelligence layer. New benchmarks, new models, new funding rounds, every week, another announcement claiming one company has pulled ahead.</p><p>But this has played out before.</p><p>Cloud computing was a competitive advantage until it wasn’t. Same with mobile. The pattern is always the same: a powerful technology gets cheaper, spreads everywhere, and quietly becomes infrastructure. The thing that made you special becomes the floor everyone stands on.</p><p>AI is heading there faster than most people expect.</p><p>When everyone has access to the same intelligence — through frontier models, open-source alternatives, or whatever comes next — the model stops being the differentiator. Value moves somewhere else.</p><p>The question is where.</p><h3>Most Software Categories Have Stagnated</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wsYclIPneEMrsRcvo-bmSw.png" /></figure><p>Most software categories haven’t meaningfully changed in a decade.</p><p>Not because the companies building them stopped caring, but because incremental improvements to an existing workflow were the only thing that made economic sense. A cleaner interface. A new integration. Another column in the dashboard.</p><p>AI changes the economics.</p><p>Not by adding a chatbot to the corner of your screen, but by making entirely new product experiences viable for the first time. A fitness app that rebuilds your training schedule around the fact that you slept four hours last night. A CRM that tells a salesperson which deal is going cold and exactly what to say to save it. Software that doesn’t just store your data but actually does something useful with it.</p><p>That shift, from software that records to software that thinks, is what’s about to hit every category at once.</p><h3><strong>The Infrastructure Is Falling Into Place</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DkmnukUI7Rnwwz1WKTEf2g.png" /></figure><p>The next shift is already visible.</p><p>Models are getting smaller, faster, and cheaper to run. The assumption that AI requires a data center is already becoming outdated. Your phone, your laptop, the device already in your pocket, is becoming capable of running intelligence locally without a cloud call.</p><p>Every major platform company is moving in this direction. Apple, Google, Microsoft. Not because it’s a nice-to-have, but because on-device AI is faster, cheaper, and doesn’t require sending your data somewhere else.</p><p>When that happens at scale, intelligence stops being a service you access and becomes something baked into the device itself. That’s a different world than the one we’re in today, and it’s closer than most people think.</p><h3>The Rise of Specialized Intelligence</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ada6PCtyp2AQ8AHKR2tkRw.png" /></figure><p>Most conversations about AI’s future revolve around frontier models. Who has the most compute, the best benchmarks, the smartest model?</p><p>Those questions matter, but they’re distracting us from a bigger shift.</p><p>A frontier model has to be good at everything. A specialized system doesn’t. A trading platform doesn’t need to understand poetry. A fitness app doesn’t need to write code. They just need to be exceptionally good at one thing: helping users make better decisions within their own domain.</p><p>As intelligence gets cheaper, that’s exactly what we’ll see. Not one assistant that does everything, but thousands of specialized systems built for specific outcomes. Most users won’t know or care what’s powering them. They’ll just notice that the product actually helps.</p><p>The biggest opportunities won’t come from building a model that does everything. They’ll come from deeply understanding one problem and solving it better than anyone else.</p><h3>The rebuild won’t just be features. It’ll be entire companies.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NRVkvUyJ1Y5A_ZbUlVQxrw.png" /></figure><p>Software teams that took 20 engineers will be built by 4. Products that took 18 months to ship will take 3. Entire categories that were too niche to be economically viable, too small to justify a team, and too complex to build without massive investment are now fair game.</p><p>That changes who gets to compete. A two-person team can now go after problems that previously required a Series B. A solo founder can build and ship something that would have taken a product team two years. The cost of attempting something ambitious just collapsed.</p><p>This isn’t just about speed. It’s about what gets built at all. For a decade, certain problems stayed unsolved because nobody cared, but because the economics didn’t work. Building a genuinely intelligent CRM, a fitness app that actually adapts, a finance tool that thinks ahead, was too expensive to justify outside of a large company with deep pockets.</p><p>That excuse is gone.</p><p>But this doesn’t mean jobs disappear. It means the nature of the work changes. A 4-person team replacing a 20-person team doesn’t mean 16 people are out of work. It means those 16 people are building something else, something that wasn’t possible before. Every major technology shift in history created more work than it eliminated, just different work, harder work, more leveraged work.</p><p>The engineers, designers, and product people who thrive in the next decade won’t be the ones who resisted the change. They’ll be the ones who learned to operate at a completely different level of ambition.</p><h3>Where I Think This Is Going</h3><p>So here’s where I think this is going.</p><p>The next wave of infrastructure won’t be model companies. It’ll be the enablers — frameworks, tooling, and platforms that make it possible to run intelligence on edge devices. Not just phones and laptops, but cars, factory floors, medical devices, and things we haven’t thought to connect yet. The picks and shovels of the AI era haven’t all been built yet.</p><p>The services industry is about to go through its biggest overhaul in decades. Technical consultancy in particular is going to explode, not shrink. Every company that needs to rebuild its software stack, retrain its teams, or figure out what AI even means for their business will need people who can help them do it. That market is enormous and barely exists yet.</p><p>Within the next few years, I think most serious tech companies will stop relying entirely on third-party models and start building their own SLMs, small, specialized, trained on their own data, running closer to their users. The competitive advantage won’t be access to intelligence. It’ll be how well you’ve shaped it for your specific problem.</p><p>And here’s one most people aren’t thinking about. Android. Not Android phones, Android as an operating system. As devices get smarter, from medical instruments to robots to industrial hardware, they need an OS to run intelligent software on. Android already has the ecosystem and tooling to fill that role. The next wave of Android growth won’t come from smartphones at all. It’ll come from devices that have never had a screen.</p><p>These are my bets. I could be wrong on the timing, maybe even the direction.</p><p>What do you think is coming that most people aren’t talking about yet?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab8f70392bc3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beyond ExoPlayer: Designing a Production Audio Engine on Android with Media3, MediaSession, and…]]></title>
            <link>https://shrey524.medium.com/beyond-exoplayer-designing-a-production-audio-engine-on-android-with-media3-mediasession-and-42fabbd74ab6?source=rss-f00c437d2b08------2</link>
            <guid isPermaLink="false">https://medium.com/p/42fabbd74ab6</guid>
            <category><![CDATA[media-player]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[exoplayer3]]></category>
            <category><![CDATA[android-mediasession]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Shrey]]></dc:creator>
            <pubDate>Tue, 23 Jun 2026 04:01:53 GMT</pubDate>
            <atom:updated>2026-06-23T10:42:55.797Z</atom:updated>
            <content:encoded><![CDATA[<h3>Beyond ExoPlayer: Designing a Production Audio Engine on Android with Media3, MediaSession, and JUCE DSP</h3><blockquote>How we built a Spotify-style playback architecture with native audio processing, queue management, state synchronization, and background playback in 45 days.</blockquote><p>The first version of our music player took less than an hour to build. A few lines of code, an ExoPlayer instance, a media URL, and music were playing through the speakers. Looking back, that was probably the most misleading moment of the entire project because it created the illusion that we were close to being done. In reality, we hadn’t even started solving the hard problems yet.</p><p>Over the next 45 days, what began as a simple playback feature evolved into a full-fledged audio platform. We had to design a playback architecture that could survive process death, handle Bluetooth and lock-screen controls, manage queues, support shuffle and repeat behavior, synchronize state across the UI, notifications, services, and MediaSession, and eventually power a real-time equalizer built using JUCE DSP running through native C++ code. At one point, we were intercepting audio buffers, passing them through a JNI bridge for DSP processing, and feeding the modified audio back into the playback pipeline while keeping latency low enough that users would never know it was happening. That was the moment I realized we weren’t building a music player anymore — we were building a distributed system that just happened to play music.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MIqSHcsTxXMfu5juDdgNIg.png" /></figure><p>In this article, I’ll break down the architecture we built, the technical decisions we made, and some of the most interesting engineering challenges we encountered along the way. If you’ve ever wondered what sits between pressing the play button and hearing music through your headphones, this is the story of everything that happens in between.</p><p>Before we get into the architecture, it’s worth talking about what we were actually building because saying “music player” really doesn’t do it justice. When we started, it sounded fairly simple. We needed playback, queue management, shuffle, repeat, lock screen controls, Bluetooth controls, notifications, Android Auto support, background playback, and an equalizer. Individually, none of these features felt particularly difficult. The problem was that they were all connected.</p><p>A change in playback state had to update the UI, the notification, the MediaSession, and any connected Bluetooth device. Queue management affected what was shown on the lock screen. Audio focus events coming from the system could change the playback state. On top of that, we had a native JUCE DSP engine sitting in the middle of the audio pipeline, processing audio buffers in real time. The challenge was never implementing a single feature. The challenge was making all of these moving parts behave like a single system and making sure they stayed in sync no matter what the user did.</p><h3>SYSTEM DESIGN</h3><p>Before jumping into the components, I spent some time getting the fundamentals right. I didn’t want a system where services, notifications, MediaSession, Bluetooth devices, and the UI were all talking to each other directly. The goal was to build something predictable, easy to debug, and capable of handling real-world edge cases without becoming a maintenance nightmare.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gu_ideYW6Cz-O7eFhMIBgw.png" /></figure><p>The first principle was having a single source of truth. Playback state, queue state, current track, repeat mode, shuffle mode, and playback position all live in one place. Everything else observes that state instead of maintaining its own version. This prevents different parts of the system from drifting out of sync.</p><p>For state propagation, I chose Kotlin StateFlow over LiveData. It works naturally with coroutines, integrates well with Compose, and makes it easy to maintain a consistent unidirectional data flow. User actions flow into the player layer, and state flows back out to the UI.</p><p>Another important principle was the separation of concerns. The UI should only render state and send user actions. It shouldn’t know about ExoPlayer, MediaSession, notifications, or audio processing. All playback-related operations go through a central Player Manager, which acts as the brain of the entire system.</p><p>Finally, reliability and extensibility were built into the architecture from day one. The player needed to stay synchronized across the app, lock screen, notifications, Bluetooth devices, and Android Auto while also handling audio focus changes, process death, and network interruptions. At the same time, features such as the JUCE DSP engine and audio effects had to be added without rewriting the core playback flow.</p><p>Keeping these principles in mind, the system’s high-level architecture began to take shape.</p><h3>Core Building Blocks</h3><h4>Interesting Implementation Details</h4><p>Once the high-level architecture was clear, the next challenge was implementation. This is where the project became fun because every component had some small technical decision behind it. We were not just creating an ExoPlayer instance and calling play(). We needed caching, queue management, shuffle and repeat behavior, MediaSession integration, foreground playback, native bridging, and a JUCE DSP pipeline that could process audio without disturbing playback.</p><h4>Creating the Player</h4><p>The player was created behind a small factory instead of directly inside UI or service classes. This made it easier to control caching, analytics, renderers, and future player configuration from one place.</p><pre>class AudioPlayerFactory(<br>    private val context: Context,<br>    private val cacheDataSourceFactory: DataSource.Factory<br>) {<br>    fun create(): ExoPlayer {<br>        return ExoPlayer.Builder(context)<br>            .setMediaSourceFactory(<br>                DefaultMediaSourceFactory(cacheDataSourceFactory)<br>            )<br>            .setHandleAudioBecomingNoisy(true)<br>            .build()<br>    }<br>}</pre><p>The important part here is not the ExoPlayer.Builder. The important part is that player creation is centralized. Once the app grows, you do not want player configuration scattered across services, screens, and managers.</p><h4>Adding Caching</h4><p>For streaming audio, we used a cache layer so repeated playback did not always hit the network. This improves startup time, reduces bandwidth usage, and makes playback feel more reliable.</p><pre>object AudioCacheProvider {<br><br>    private const val CACHE_SIZE_BYTES = 512L * 1024L * 1024L // 512 MB<br><br>    fun createCache(context: Context): SimpleCache {<br>        val cacheDirectory = File(context.cacheDir, &quot;audio_cache&quot;)<br><br>        return SimpleCache(<br>            cacheDirectory,<br>            LeastRecentlyUsedCacheEvictor(CACHE_SIZE_BYTES),<br>            StandaloneDatabaseProvider(context)<br>        )<br>    }<br><br>    fun createCacheDataSourceFactory(<br>        context: Context,<br>        simpleCache: SimpleCache<br>    ): DataSource.Factory {<br>        val upstreamFactory = DefaultHttpDataSource.Factory()<br>            .setAllowCrossProtocolRedirects(true)<br><br>        return CacheDataSource.Factory()<br>            .setCache(simpleCache)<br>            .setUpstreamDataSourceFactory(upstreamFactory)<br>            .setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR)<br>    }<br>}</pre><p>This is one of those things that sounds small, but in a real music app, it matters a lot. If caching fails, playback should continue from the network. The cache should improve the experience, not become another reason for playback to break.</p><h4>PlayerManager as the Main API</h4><p>The UI never talked to ExoPlayer directly. Everything went through PlayerManager. This kept playback commands, queue changes, state updates, analytics, and MediaSession sync in one place.</p><pre>class PlayerManager(<br>    private val player: ExoPlayer,<br>    private val queueManager: QueueManager<br>) {<br>    private val _state = MutableStateFlow(PlayerUiState())<br>    val state: StateFlow&lt;PlayerUiState&gt; = _state.asStateFlow()<br><br>    fun play(track: Track) {<br>        queueManager.setCurrent(track)<br><br>        player.setMediaItem(track.toMediaItem())<br>        player.prepare()<br>        player.play()<br><br>        _state.update {<br>            it.copy(<br>                currentTrack = track,<br>                isPlaying = true<br>            )<br>        }<br>    }<br><br>    fun pause() {<br>        player.pause()<br>        _state.update { it.copy(isPlaying = false) }<br>    }<br><br>    fun seekTo(positionMs: Long) {<br>        player.seekTo(positionMs)<br>        _state.update { it.copy(positionMs = positionMs) }<br>    }<br>}</pre><p>This pattern saved us from a lot of bugs. The moment multiple screens, notification actions, Bluetooth events, and lock-screen controls can all control playback, you need one place where these commands are handled.</p><h4>Queue, Shuffle, and Repeat</h4><p>Queue management was more complex than it looked at first. Play next, previous, shuffle, repeat one, repeat all, and restore after process death all depend on the queue being deterministic.</p><pre>class QueueManager {<br><br>  private var originalQueue: List&lt;Track&gt; = emptyList() <br>  private var activeQueue: List&lt;Track&gt; = emptyList() <br>  private var currentIndex: Int = 0 <br>  private var shuffleEnabled: Boolean = false <br>  private var repeatMode: RepeatMode = RepeatMode.OFF <br><br>  fun setQueue(tracks: List&lt;Track&gt;, startIndex: Int = 0) { <br>    originalQueue = tracks <br>    activeQueue = if (shuffleEnabled) tracks.shuffled() else tracks <br>    currentIndex = startIndex.coerceIn(activeQueue.indices) <br>  } <br><br>  fun next(): Track? { <br>    if (activeQueue.isEmpty()) return null <br><br>    return when { <br>      currentIndex &lt; activeQueue.lastIndex -&gt; { <br>        currentIndex += 1 <br>        activeQueue[currentIndex] } <br><br>      repeatMode == RepeatMode.ALL -&gt; { <br>        currentIndex = 0 activeQueue[currentIndex] } <br><br>      else -&gt; null <br>    } <br>   } <br><br>  fun previous(): Track? { <br>    if (activeQueue.isEmpty()) return null <br><br>    return if (currentIndex &gt; 0) { <br>      currentIndex -= 1 <br>      activeQueue[currentIndex] <br>    } else { <br>      activeQueue[currentIndex] <br>      } <br>    } <br>}</pre><p>The main idea was simple. The player plays media, but the queue manager decides what should play next. Keeping those two responsibilities separate made the system easier to reason about.</p><h4>MediaSession Integration</h4><p>MediaSession was responsible for connecting the player to Android system surfaces like the lock screen, Bluetooth devices, media buttons, Android Auto, and external controllers.</p><pre>class AudioPlaybackService : MediaSessionService() {<br><br>    private var mediaSession: MediaSession? = null<br>    private lateinit var player: ExoPlayer<br>    override fun onCreate() {<br>        super.onCreate()<br>        player = AudioPlayerFactory(<br>            context = this,<br>            cacheDataSourceFactory = createCacheFactory()<br>        ).create()<br>        mediaSession = MediaSession.Builder(this, player)<br>            .setCallback(object : MediaSession.Callback {<br>                override fun onConnect(<br>                    session: MediaSession,<br>                    controller: MediaSession.ControllerInfo<br>                ): MediaSession.ConnectionResult {<br>                    return MediaSession.ConnectionResult.AcceptedResultBuilder(session)<br>                        .build()<br>                }<br>            })<br>            .build()<br>    }<br>    override fun onGetSession(<br>        controllerInfo: MediaSession.ControllerInfo<br>    ): MediaSession? {<br>        return mediaSession<br>    }<br>    override fun onDestroy() {<br>        mediaSession?.run {<br>            player.release()<br>            release()<br>        }<br>        mediaSession = null<br>        super.onDestroy()<br>    }<br>}</pre><p>This is where the app starts behaving like a real media app. Without MediaSession, audio may play, but the system does not understand your playback properly.</p><h4>Native Bridge for JUCE DSP</h4><p>The equalizer was the most technically interesting part. We had a native JUCE DSP engine written in C++, and Kotlin had to communicate with it through JNI. The bridge had to be small, stable, and careful with memory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IyqtavGdxjDhfj9Fa4Azog.png" /></figure><pre>class NativeEqualizerBridge { <br>  <br>  external fun createEngine(sampleRate: Int, channelCount: Int): Long <br>  <br>  external fun processBuffer(<br>    engineHandle: Long, <br>    input: FloatArray, <br>    output: FloatArray, <br>    frameCount: Int <br>  ) <br><br>  external fun updateBandGain( <br>    engineHandle: Long, <br>    bandIndex: Int, <br>    gainDb: Float <br>  )<br> <br>  external fun releaseEngine(<br>    engineHandle: Long<br>  ) <br><br>  companion object { <br>    init { <br>      System.loadLibrary(&quot;native_audio_engine&quot;) <br>    } <br>  } <br>}</pre><p>On the Kotlin side, the bridge only knows about buffers and configuration. The actual DSP logic stays in C++ inside the JUCE layer.</p><pre>extern &quot;C&quot;<br>JNIEXPORT jlong JNICALL<br>Java_com_example_audio_NativeEqualizerBridge_createEngine(<br>    JNIEnv* env,<br>    jobject,<br>    jint sampleRate,<br>    jint channelCount<br>) {<br>    auto* engine = new JuceDspEngine(sampleRate, channelCount);<br>    return reinterpret_cast&lt;jlong&gt;(engine);<br>}<br><br>extern &quot;C&quot;<br>JNIEXPORT void JNICALL<br>Java_com_example_audio_NativeEqualizerBridge_processBuffer(<br>    JNIEnv* env,<br>    jobject,<br>    jlong engineHandle,<br>    jfloatArray inputArray,<br>    jfloatArray outputArray,<br>    jint frameCount<br>) {<br>    auto* engine = reinterpret_cast&lt;JuceDspEngine*&gt;(engineHandle);<br>    jfloat* input = env-&gt;GetFloatArrayElements(inputArray, nullptr);<br>    jfloat* output = env-&gt;GetFloatArrayElements(outputArray, nullptr);<br>    engine-&gt;process(input, output, frameCount);<br>    env-&gt;ReleaseFloatArrayElements(inputArray, input, JNI_ABORT);<br>    env-&gt;ReleaseFloatArrayElements(outputArray, output, 0);<br>}</pre><p>The tricky part was not writing the JNI function. The tricky part was making sure the audio path stayed fast enough. Every copy, every allocation, and every blocking call matters when audio is being processed in real time.</p><h4>Intercepting and Processing Audio Buffers</h4><p>At a high level, the processing flow looked like this:</p><pre>class AudioProcessingPipeline(<br>    private val equalizerBridge: NativeEqualizerBridge,<br>    private val engineHandle: Long<br>) {<br>    fun process(inputBuffer: FloatArray, frameCount: Int): FloatArray {<br>        val outputBuffer = FloatArray(inputBuffer.size)<br>        equalizerBridge.processBuffer(<br>            engineHandle = engineHandle,<br>            input = inputBuffer,<br>            output = outputBuffer,<br>            frameCount = frameCount<br>        )<br>        return outputBuffer<br>    }<br>}</pre><p>The first version duplicated buffers very aggressively because it was safer and easier to debug. Once the flow was stable, we rewrote parts of the pipeline to reduce unnecessary allocations and avoid copying more than required.</p><pre>class ReusableAudioBufferPool(<br>    private val bufferSize: Int,<br>    private val poolSize: Int = 4<br>) {<br>    private val buffers = ArrayDeque&lt;FloatArray&gt;()<br>    init {<br>        repeat(poolSize) {<br>            buffers.add(FloatArray(bufferSize))<br>        }<br>    }<br>    fun acquire(): FloatArray {<br>        return buffers.removeFirstOrNull() ?: FloatArray(bufferSize)<br>    }<br>    fun release(buffer: FloatArray) {<br>        if (buffers.size &lt; poolSize) {<br>            buffer.fill(0f)<br>            buffers.add(buffer)<br>        }<br>    }<br>}</pre><p>This kind of optimization mattered because audio processing is unforgiving. If the UI drops a frame, the user may not notice. If the audio pipeline glitches, everyone notices immediately.</p><h4>StateFlow for Playback State</h4><p>Playback state was exposed as StateFlow so UI, notifications, and other observers could react to the same source of truth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JOYXBfNQS_xmBRsyhQEo1g.png" /></figure><pre>data class PlayerUiState(<br>    val currentTrack: Track? = null,<br>    val isPlaying: Boolean = false,<br>    val isBuffering: Boolean = false,<br>    val positionMs: Long = 0L,<br>    val durationMs: Long = 0L,<br>    val shuffleEnabled: Boolean = false,<br>    val repeatMode: RepeatMode = RepeatMode.OFF<br>)<br><br>class PlaybackStateStore {<br>    private val _state = MutableStateFlow(PlayerUiState())<br>    val state: StateFlow&lt;PlayerUiState&gt; = _state.asStateFlow()<br>    fun update(transform: (PlayerUiState) -&gt; PlayerUiState) {<br>        _state.update(transform)<br>    }<br>}</pre><p>This kept the flow predictable. User actions entered the player layer, and updated state flowed back out. The UI did not need to ask ExoPlayer what was happening. It simply observed the state.</p><h4>Logging and Observability</h4><p>Audio bugs are difficult to debug without logs because many events happen outside the visible UI. A Bluetooth headset can pause playback. Audio focus can change. The notification can send an action. Android can recreate the service.</p><p>So we logged playback events at the core layer.</p><pre>class PlaybackLogger {<br>fun log(event: PlaybackEvent) {<br>        Log.d(&quot;AudioEngine&quot;, event.toString())<br>        // Optional:<br>        // analytics.track(event.name, event.properties)<br>        // crashReporter.setCustomKey(&quot;last_playback_event&quot;, event.name)<br>    }<br>}<br>sealed class PlaybackEvent {<br>    data class TrackStarted(val trackId: String) : PlaybackEvent()<br>    data class TrackPaused(val source: String) : PlaybackEvent()<br>    data class BufferingStarted(val trackId: String) : PlaybackEvent()<br>    data class PlaybackFailed(val trackId: String, val reason: String) : PlaybackEvent()<br>    data class ExternalCommandReceived(val source: String, val command: String) : PlaybackEvent()<br>}</pre><p>This became extremely useful during development because when something went wrong, we could trace whether the command came from the UI, notification, Bluetooth, MediaSession, or the service itself.</p><h3>The Hardest Problems We Had to Solve</h3><p>Looking back, none of the difficult problems were the ones we anticipated at the beginning of the project. Creating a player, integrating Media3, or even setting up MediaSession was fairly straightforward. The real challenges started appearing once all of these components needed to work together in a production environment. Most of the time wasn’t spent building features. It was spent handling edge cases, keeping different parts of the system synchronized, and making sure the experience remained seamless regardless of how users interacted with the player.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C3Ja_N0wwGBMU1J0BZBAqQ.png" /></figure><p>Some of these problems took days to solve. Others went through multiple iterations before we found an approach we were happy with.</p><h3>What I Would Do Differently Today</h3><p>If I had to build this system again, I would spend more time thinking about the features that might exist a year from now, not just the features required for the first release.</p><p>The architecture we built was flexible enough to support future enhancements, but there were several cases where we ended up revisiting components because new requirements emerged after the initial implementation. One example was intelligent queue caching. Once playback was stable, we started looking at ways to improve the user experience even further. Instead of only loading the currently playing track, we wanted tracks that were likely to be played next to already be available locally. The goal was simple: if a user taps on any song in the current queue, playback should feel instant regardless of network conditions.</p><p>Another area was metadata enrichment. Every track carried a significant amount of associated information, including artwork, artist details, recommendations, engagement data, and other metadata required by different parts of the application. Initially, we only fetched what was necessary for playback. As the product evolved, we needed a way to enrich tracks in the background, cache that information, keep it synchronized with the source of truth, and eventually evict data that was no longer useful. Introducing that capability later required changes across repositories, DTOs, caching layers, state synchronization flows, and parts of the native bridge.</p><p>None of these changes was particularly difficult because the architecture was poor. They happened because the requirements evolved. Looking back, I would spend more time identifying these kinds of future capabilities during the design phase and creating extension points for them from the beginning. Features such as predictive caching, metadata enrichment, offline playback, recommendations, cross-device synchronization, and advanced audio processing often start as “future ideas” but have a habit of becoming product requirements much sooner than expected.</p><p>One of the biggest lessons from this project was that good architecture is not just about solving today’s problems. It’s about making sure tomorrow’s problems can be solved without rewriting half the system.</p><h3>Results</h3><p>After roughly 45 working days, the platform evolved from a simple playback prototype into a production-ready audio engine capable of supporting real-world usage across multiple playback surfaces.</p><p>By the final release, the system was supporting:</p><ul><li>Background playback with full MediaSession integration</li><li>Queue management with shuffle, repeat, play-next, and queue restoration</li><li>Bluetooth, lock screen, notification, and Android Auto controls</li><li>Native JUCE DSP processing through a custom JNI bridge</li><li>Intelligent media caching and preloading</li><li>State synchronization across all playback surfaces through a single source of truth</li></ul><p>From a performance perspective, the final implementation delivered:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UYSppoHBNiB9DZDe0-vFug.png" /></figure><p>One of the areas I’m personally most proud of was the DSP pipeline. The first implementation focused on correctness and stability, but after several iterations around buffer management, JNI communication, and memory reuse, we were able to process audio in real time while keeping playback smooth and responsive.</p><p>More importantly, the architecture gave us room to grow. Features such as intelligent queue prefetching, advanced metadata enrichment, offline playback, recommendations, and additional audio effects could all be added without major architectural changes.</p><p>Looking back, the biggest achievement wasn’t building a music player. It was building a platform that could continue evolving long after the first release.</p><h3>Final Thoughts</h3><p>If you’ve made it this far, thank you for reading.</p><p>What started as “let’s build a music player” eventually turned into one of the most interesting engineering projects I’ve worked on. Over roughly 45 working days, we built a production audio platform capable of handling playback, queue management, state synchronization, MediaSession integration, background playback, native DSP processing, and a number of other features that I unfortunately can’t go into detail about here.</p><p>Like most real-world systems, the final architecture looked very different from what we imagined on day one. Some problems were easier than expected. Others took multiple iterations before we found an approach that felt right. That’s probably my favorite part about building software. The requirements change, the product evolves, and every challenge forces you to rethink assumptions you were convinced were correct a week earlier.</p><p>I hope that this article saves someone a few days, a few debugging sessions, or at the very least helps them avoid a couple of mistakes we made along the way. If you’re currently building an audio application, I’d love to hear how you’re approaching similar problems. And if you’re planning to build one, hopefully this gives you a head start.</p><p>As for me, I’ll happily continue arguing with Android services, debugging state synchronization issues that only reproduce once every three days, and pretending buffer allocations don’t matter until they suddenly matter a lot.</p><p>If you’d like to discuss architecture, Android, audio systems, or just geek out over complex engineering problems, feel free to reach out. I’m always happy to connect with people building interesting things.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42fabbd74ab6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Most Engineers Are Preparing for a Version of the Industry That May No Longer Exist]]></title>
            <link>https://shrey524.medium.com/most-engineers-are-preparing-for-a-version-of-the-industry-that-may-no-longer-exist-d61cca00c8c5?source=rss-f00c437d2b08------2</link>
            <guid isPermaLink="false">https://medium.com/p/d61cca00c8c5</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[job-hunting]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Shrey]]></dc:creator>
            <pubDate>Sun, 07 Jun 2026 11:11:11 GMT</pubDate>
            <atom:updated>2026-06-07T11:11:11.979Z</atom:updated>
            <content:encoded><![CDATA[<h4>Are you one of them?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-K4hE5t2yJ8f1C8HXnQibg.png" /></figure><p>A few years ago, the roadmap into tech felt simple.</p><p>You picked a stack.<br>You learned a framework.<br>You grinded DSA and LeetCode.</p><p>You watched interview videos late at night and convinced yourself that once you solved enough problems, things would eventually work out.<br>If you were lucky, maybe you got into a big company straight out of college. If not, you joined a smaller startup, worked your way up slowly, switched jobs every few years, and hoped that eventually experience would outweigh pedigree.</p><p>That was the game.<br>And honestly, for a long time, it worked.<br>Entire industries were built around this roadmap. Bootcamps, coding influencers, “complete developer roadmaps,” interview prep ecosystems- everything was optimized around creating implementation engineers.<br>But lately, I’ve started feeling like the ground underneath this entire system is quietly shifting. Not in theory. Not in some “AI will take over the world” kind of way. I mean, in actual interviews, actual hiring conversations, and actual engineering teams.</p><p>Over the last few weeks, I’ve been actively interviewing. A couple of companies shortlisted me, some interviews went really well, and in a few cases, I even reached later rounds, and then something strange kept happening. The positions would suddenly get paused. At first, I assumed it was bad luck. The market is weird right now, so I didn’t think much of it.<br>But after talking to people internally at some of these companies, a pattern started appearing. Someone on the team had left. The company opened a replacement role. But while hiring, they slowly realized something uncomfortable:<br>The remaining team was still managing the workload.<br>A few years ago, maybe a team needed seven or eight engineers to sustain a certain level of output. Now, with AI-assisted workflows, faster tooling, and dramatically increased implementation speed, the same work could often be handled by five people instead. So the replacement never happened. This happened to me multiple times in less than two weeks.<br>And honestly, that was the first moment where the shift stopped feeling theoretical.</p><p>Then came an interview that genuinely stayed in my head afterward.<br>The company had a relatively small application. Technically, it wasn’t some insanely complicated distributed system. But the product had real scale, real users, and was generating a few hundred thousand dollars in monthly revenue. What surprised me wasn’t the product. It was the hiring expectation. They weren’t trying to build separate Android and iOS teams. They wanted one strong engineer who could take ownership across Android and iOS and move fast. A few years ago, that would have sounded unrealistic. Today, companies are increasingly believing this is possible. Not because engineering suddenly became easy, but because AI has massively increased the leverage of strong engineers. Then the interviewer asked me something unexpected. He asked me what percentage of my code I write using AI. I answered honestly.</p><blockquote>Probably around 80–85%.</blockquote><p>And his reaction completely surprised me. He looked at me and casually said,</p><blockquote>That’s actually lower than most people in our organization.</blockquote><p>According to him, many engineers there were already generating almost all of their implementations using AI-assisted workflows. That conversation genuinely changed how I viewed the industry. Because at that moment, it became obvious that the debate around whether AI changes software engineering is already over. The shift is already happening inside companies. Even interviews themselves are changing.<br>In another interview recently, after discussing architecture, Android internals, and system design, the interviewer asked me to open my IDE and the AI coding tools I use. Then he asked me to implement a fairly large real-world problem statement live in around thirty minutes.</p><p>Not DSA.<br>Not algorithm puzzles.<br>Actual product implementation.<br>The expectation was no longer,</p><blockquote>“Can you manually write everything from memory?”</blockquote><p>The expectation was,</p><blockquote>“Can you use modern tools effectively enough to execute extremely fast?”</blockquote><p>That is a completely different hiring philosophy from the one most developers are still preparing for. And honestly, I think this is where many people are getting left behind without even realizing it. A lot of developers are still preparing for a version of the industry that rewards memorization above everything else. Learn frameworks. Learn patterns. Grind interviews. Repeat. But the market is quietly shifting toward something else entirely.</p><p>Adaptability.<br>Leverage.<br>Ownership.</p><p>The ability to enter unfamiliar domains and figure things out quickly.<br>The ability to work with AI instead of pretending it doesn’t exist.<br>At the same time, I think people are getting one major thing about AI wrong.</p><p><strong>I don’t think AI is going to kill tech jobs.<br>If anything, I think it’s going to push technology deeper into industries that have never seriously invested in software before.</strong></p><p>Today, millions of businesses still operate without internal tooling, automation, AI systems, or even a single technical employee.<br>That changes over the next decade. As software becomes cheaper and faster to build, more businesses become technology-enabled. More workflows become automated. More companies need technical people internally. The difference is that future engineers may look very different from the traditional “single-stack developer” model most of us grew up preparing for.<br>Recently, I was talking to a few people in leadership positions across startups and engineering teams, and one thing kept coming up repeatedly.<br>Companies are no longer only looking for people who can implement tickets.</p><p><strong>They’re looking for people who can own problems.</strong></p><p>People who can move across domains. People who are comfortable learning unfamiliar things. People who can use AI to increase execution speed instead of fearing it. And honestly, I think this shift is happening much faster than most people realize.<br>The strange thing is, despite all this uncertainty, I’m actually optimistic.<br>Because this might also become the best time in history to build.<br>One engineer today can do things that previously required entire teams. The barrier between “I have an idea” and “I can build this” is collapsing rapidly.<br>You no longer need permission to start.<br>You no longer need months of tutorials before touching something new.<br>You can learn while building. Reverse-engineer while building. Explore unfamiliar domains while building. And maybe that’s the real shift happening underneath all of this.</p><p><strong>The future may belong less to people who optimized for one framework forever and more to people who became adaptable enough to evolve alongside the industry itself.</strong></p><p>Because honestly, I don’t think engineering is dying. But I do think the definition of a strong engineer is changing very quickly. And I think most people still underestimate how early we are.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d61cca00c8c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>