android posts

Make Spotify Start Playing Over Bluetooth When You Get In Your Car (or any other BT device connects)

I know I'm a little late to the party, but I just recently got a Bluetooth-enabled radio installed in my older car.  I've never had such before, and I LOVE it.  You can get them at Best Buy, and have them installed there for around $70 if you don't want to do it yourself.

I also love Spotify.  The "pro" plan is cheap, especially if you do a family plan which they recently started offering.

Here's my problem:  When my car connects to my Android phone, it starts to play the default Android mp3 player-- and nothing I could do (at the time of this writing) could change that.  I found helpful apps online which would *start* Spotify when the car connected, but nothing that would make it start *playing*.  I still had to do that manually on my phone.

But then I found a solution (for Android anyway)...

Best Free Apps for Android - The App

If you are anything like me, you like finding nifty apps for your android phone, but are also too much of a cheapskate to actually pay for such an app unless it's really remarkable.

Well, I decided to assemble the best free apps for android I could find into its own app, where you can download and even launch directly from the app itself.

It's called simply Best Free Apps!, and it was released under my more legitimate software company, Offworld Software.

The list of apps are categorized and hand-curated.  Unfortunately, a lot of free apps on the marketplace lure you in, but then bombard you with advertising notifications or popups.  There's none of that in Best Free Apps!, just a basic banner ad at the bottom.

Check it out!

Download from Google Play

Android Games with Gamepad Support

If you happen to own an Android-based phone or tablet, and you also happen to enjoy playing games with a real gamepad instead of on-screen controls, then you are in luck.

I recently started a new site, specifically for the purpose of keeping up with games that have these options.  It's called simply Android Gamepad Games (

There's also now an official app on the Google Play store!  Check it out here.  You can even launch your games directly from the app, making it more like a console experience.

The list can be sorted, and entries includes a screenshot taken from the Google Play store.  The list is hand-curated by yours truly, but updates can easily be submitted if you notice a problem.



Android Tip: Preferences - Easier Than Using a Database - With Code Sample!

Attached File(s): 

If you have done any programming for an Android phone, you've probably already used (or at least heard of) Android's built-in database option of SQLite.  SQLite is a fine system, but it can be cumbersome to work with, especially if you only need to store a few values. 

samsung-omnia-hd-android.jpgEnter your new best friend: Preferences.

Think of "Preferences" as a way to save data (like Strings) outside of your application.  It's like a database in that way, but it is much easier to put data in and get data out.  If you build a Preferences Activity at some point, then it will actually be using this very system-- but that's another blog post.

I have included my own class for working with Preferences.  It is linked at the top of the post.  To use it, instantiate a Prefs object like so:

Prefs prefs = new Prefs(context);
// Prefs prefs = new Prefs(this) will work 
// if you are within an Activity

Now, to store a String value, all you have to do is this:

String mUserNameString = "rpeacock";
prefs.setPreference("username", mUserNameString);

To retrieve that value later, even after the app has closed and restarted, all you have to do is this:

String temp = prefs.getPreference("username");

Isn't that easy?  More to the point, isn't that much easier than creating an SQLite object, constructing a query, executing the query, then closing the connection?  That's why I use Preferences everywhere I can.  It's also great for accessing values between Activities, services, etc.

The code I attached only does Strings, but you can easily extend it to work with any value.  Enjoy!


Software License Fine Print

Creative Commons LicenseThis code is licensed as-is, with no warranty or guarantee, under a Creative Commons Attribution 3.0 Unported License.

You may use this code however you want, even in commercial products, but only if you include attribution to me, Richard Peacock, as the original author of this small portion of code, but not in a way that implies I endorse your project.

For example, on a Help/Credits screen:  Portions of this project were based on work freely obtained from these developers: Richard Peacock (, NAME HERE, etc.  These outside developers neither endorse nor support this software.

If you use this code, feel free to email me to let me know!  I'll include a link to your project here.

Syndicate content