PremoFM: The Source Code

web_hi_res_512

I just uploaded the source to my podcast app, PremoFM, to GitHub.  PremoFM was my attempt to create the podcast player I loved using.  I was super successful at that.  However, I built PremoFM with too many costs, mainly servers.  It didn’t make a lot of sense to keep that going with no revenue so I ended it.

However, PremoFM was super important to me and crucial to my career as a now, full-time, Android developer.  It is a modern Android app that embraces Material Design and some of the latest APIs available on Android.  I want to share this with the world.

What are the top three aspects of PremoFM that make me the proud?

  1. The podcast player service is baller.  I built an Android service that leverages new MediaSession APIs introduced in Android 5.0 “Lollipop”.  I also refactored that actual MediaPlayer so that I can seamlessly switch between MediaPlayer (plays media through the phone’s speaker or headphones) and the CastMediaPlayer (plays media through a Google Cast device).  The LocalMediaPlayer was built on Google’s awesome, open source media player, ExoPlayer.  I was one of the first apps to build an experience around ExoPlayer.
  2. User interface and design.  PremoFM was not the prettiest podcast app, but I thought it was the cleanest and most intuitive.  It presented everything you wanted to look at up front and didn’t require the user to do too much digging.
  3. Notifications and the Download service.  PremoFM never polled the API server for new episodes periodically.  A Google Cloud message was sent to the device when new episodes were ready.  This allowed me to alert users of new episodes almost immediately.  The Download service cached episodes and podcasts in the background in a battery efficient manner because it was built on JobScheduler (introduced in Android 5.0 Lollipop).  JobScheduler allowed PremoFM background services to run in the most battery efficient manner, when other things were happening, like the Google Play Store updating apps.  

notify_item

What are the top three disappointments?

  1. Architecture.  I failed to separate lot of the business logic from Android-centric components like Activity, Fragment, and Service.  This made it really hard to write tests.  If I had to do it all over again, I would use a modern Android development architecture like MVP (Model, View, Presenter)…that would enforce some code and logic compartmentalization.  It would allow me to easily write unit test for important business logic without needing to worry about mocking Android APIs and components.
  2. Database stuff.  I wrote all of the database logic from scratch.  I built the entire app on ContentProvider.  While it worked well for PremoFM, it was a headache to maintain.  I often introduced bugs because I’d add a column and would forget some important aspect like making it nullable.  I did not have a ton of unit tests so many of these problems made it to beta when they could have been prevented earlier.  If I were to change something I would use a library like OrmLite to make this portion of the app simpler and easier to maintain.
  3. JSON & HTTP.  Again, this is another area of the app where I was better off leaving it to a library like OkHttp, Retrofit, and GSON.  I wrote all the code that dealt with HTTP (built on HTTPURLConnection), JSON parsing, and serialization / deserialization.  On one hand I learned a lot of what happens underneath the hood.  On the other hand I spent a lot of time on parts of the app where my time should have been spent on something else.

Other things to browse the codebase for:

  • Integration with Google Cloud Messenger
  • Using the Material Design Support library for the navigation drawer
  • The episode downloaded
  • Cursors and CursorLoaders
  • Implementation of the Sonic library to altering the playback speed of audio in ExoPlayer
  • Aggregation of new episode / download notifications, built on a network of PendingIntents
  • My abstraction of image loading libraries, halfway through this project I switched from Picasso to Glide.  Due to the fact that I abstracted this from the app, all of my code changes happened in one or two files despite the use of image loading in tons of places.
  • Tricky tricky SQL queries

I do have plans to make PremoFM functional again.  If you build it, chances are you won’t get far because it requires the PremoFM backend and API.  All of the XML parsing happened on the server.  I have plans to port all of the XML retrieval and parsing logic to the app because I desperately want to use this app again.  Clone it, fork it, and hack away at it to your hearts content.

Be on the lookout for my apps from me…soon.

Tom Brady, ESPN, Media, and Barack Obama

600x600bb

Bill Simmons and guest, Chuck Klosterman, cover a ton of ground in the latest Bill Simmons Podcast. Particularly insightful conversation as they discuss how cord cutting affects ESPN’s bottom line, Bills Simmons recent interview of President Obama, and Chuck’s interview with Tom Brady. For example, ESPN loses out on $70/year in revenue for every cable subscriber that cuts the cord (cancels their cable subscription)!? Cord cutting is getting worse (I cut the cord 2 years ago) so I’d imagine they’re losing a ton of money.

As an side, I really just got into The Bill Simmons Podcast….it’s a good one.  Check it out.

You can find podcasts like The Bill Simmons Podcast on PremoFM, in the Google Play Store now.

Discover new passions with PremoFM

Screenshot from 2015-11-10 08:05:44

 Google Play | Website | Twitter


 

I have a wide variety of interests and passions that matter to me, gadgets & technology, programming and UI/UX design, Android, indie rap & hip hop, dope Volkswagens, people of color in technology, New York Jets football, NC State Wolfpack athletics, travel and so many more.  I don’t have a crazy amount of time to sit and read things around my interests, but I have tons of time to listen.  Podcasts fill the majority of my free listening time.

As you’d imagine, I listen to a ton of podcasts. A few of my favorites, His & Hers with Jemele Hill & Michael Smith, The Vergecast, Tomorrow, The Accidental Tech Podcast, and Greenbench Podcast.  I built a podcast app for Android because I wanted to find and listen to more podcasts around my interests and passions and, perhaps, discover new interests and passions.  Now, you can too.  PremoFM 1.0 launches in the Google Play Store today, for free.  I’ve been building it in my spare time for almost a year and using it for about 10 months.  I’ve had beta testers using it for 6 months and now I want everyone to use it.  I have a vision for a podcast app that can help you discover new interests and passions. PremoFM 1.0 is the first step towards that vision.

I expect to move very fast, adding highly sought after features like public podcast collections, Chromecast support, variable speed playback and audio enhancements, better podcast discover-ability, and more

However for today, happy listening.

So, I could probably work on this forever.

screenshots

I’ve been building a podcast app for Android for the last year in my spare time. (Side note: I’ve been building an app for Android for the last 18 months. Fun fact, Premo started off as a contextual messaging app). In the last six months I’ve been working with a small team of beta testers to assist me in creating a great experience for Android podcast fans. It’s time to widen the audience.

Taking a few steps back, I love listening to podcasts. I’m a HUGE podcast fan. That might be an understatement. When I’m not listening to my wife, daughter, friends, or coworkers, I’m listening to podcasts. I started listening to podcasts in the Google Reader days (who remembers Google Listen?). Since then I have tried and purchased many podcast apps on Android including BeyondPod, Podkicker Pro, PlayerFM, and Pocket Casts. They’re all great apps.

But I decided to build a podcast app because I think there’s still room to do something different.

  • I should be able to sample and listen to new podcasts, without needing to subscribe to them
  • I should be able to share my collections of podcasts and episodes with other listeners, easily
  • I should be able to see episode show notes without digging too deeply
  • I should be able to easily organize and navigate my podcasts
  • I should be able to use a beautiful app

I decided to build a podcast app I would love to use. Now I’m making a bet that others will too. Today I’m opening up the beta to anyone running Android 5.0 “Lollipop” or higher. To sign up, visit Premo.FM and click “Join the Beta”.

The beta is free, which given all of the work I’ve put into this app, is crazy. The app may go paid (via an in-app purchase) or become listener supported (donations like public radio). In the meantime, just try it out and send me any feedback on Twitter, @PremoFM. I’m looking forward to it.

Happy listening 🙂