Wednesday, January 29, 2014

Listening to bluetooth connections




In this quick tutorial I'm going to lead you through creating a BroadcastReceiver that will listening for bluetooth device connections and disconnections.



Permissions

The first though we'll do is add a few permissions in the AndroidManifest, we need both the Bluetooth and the Bluetooth Admin permission for listening to connections/disconnections.




BroadcastReceiver

The next step is to create a BroadcastReceiver that receives ACL_CONNECTED and ACL_DISCONNECTED broadcast actions.



Registration

The last step is to register the BroadcastReceiver in the AndroidManifest so it can start receiving the broadcasts automatically. Alternatively you can handle this by registering the receiver in an Activity or Fragment when needed.


Monday, January 13, 2014

Does the Galaxy S4 deserve the hate


The Galaxy S4 has been copping quite a lot of flack over the last couple of months as higher powered devices are pushed out in time for the christmas rush. I’ve heard the lag word thrown around a bit, as well as sound issues however, I’m always fairly sceptical of peoples opinions, particularly tech people and power users who are renowned for getting caught up in the boredom factor. There’s nothing wrong with that, I fall into the same trap time and time again. After 5 or 6 months with a phone I’m pretty well over it and looking for the next flagship phone to lay my hard earned on. Luckily I work in a great field where I have access to many different mobile devices including the Galaxy S4, so I thought I’d use it for my daily driver and see if it’s deserving of all the hate.


First boot experience

The first thing that sticks out when reaching the Android homescreen for the first time is Samsung’s big push to their own ecosystem. Each screen is full of average looking “samsung content” widgets, and most Google Play services apps are buried in the app drawer. This makes perfect sense, there’s a lot of money to be made for the company that controls the ecosystem. The problem is Samsung’s ecosystem barely a shadow of Google Play.

Another annoyance is the rounded square icons Samsung has enforced. This really gets under my skin, as I know the effort some designers put into their launcher icons, only to be so quickly disregarded by Samsung for the sake of outdated design language.

I think it’s safe to say I really don’t like touchwiz, the fundamental design language just doesn’t sit well with me. It’s glossy, outdated, and chock full of skeuomorphic design. It feels like a bridge for transitioning iOS 6 users who aren’t quite yet ready to shrug off the chains of the past and take on a real Android experience. I can really see why Apple wasn’t overly impressed with how close Samsung has flown to pre iOS 7 design language.


Customisation required

There are many things I love about Android, but in the case of the Galaxy S4 there’s none better than the ease of dropping in a new launcher. My launcher of choice is the “Google Experience Launcher” (GEL) found on the Nexus 5. It has Google Now built in, and doesn’t play with the launcher icons. Not only that it offers some nice extra features over the standard launcher without losing the look and feel of Android.

I also switched the keyboard out, this isn’t the fault of Samsung. Keyboards are a very personal thing, some people swear by Swiftkey, others Swype, I’m definitely a standard Google Keyboard guy. I’m sure I could have gotten used to the default keyboard, but I didn’t have the interest or the time.


Screen

The screen on the Galaxy S4 I found was way over saturated, which seems to be a AMOLED traite, however after setting the screen to movie mode it was much more color accurate and didn’t tire my eyes as much. The screen itself is very sharp at 441 ppi, and outdoor usage was acceptable. Even though the screen isn’t Super AMOLED Plus, meaning it uses pentile matrix arrangement, there wasn’t any noticeable banding throughout the range of brightness levels.


Camera

The camera on the Galaxy S4 is quite good, again it’s not DSLR quality but in good lightly it creates vibrant snaps. Even in low light the photo quality was surprisingly good, there was definitely noise in the photo but nothing unacceptable. The autofocus is fast and accurate, and the camera app is feature packed with some useful and interesting modes. Some features take a bit of setup and probably too much foresight to be useful aka the eraser mode which removes background people.


Sound quality

Normally the phone speaker quality wouldn’t get a mention, however ever since HTC launched the HTC One with boom sound I’ve become a little more interested. Unfortunately it feels like Samsung didn’t even try in this department. The speaker internal speaker is weak, tinny and overall horrible. Though it’s probably not an issue for most, as those that care have the HTC One already, it is a pretty pathetic speaker.

Headphones are another story, when listening to music through the Galaxy S4 bass appeared to have a little more punch and crispness than my beloved Nexus 5 through the same headphones, and the highs and mids seem to have more “clarity”. I suspect this has a fair bit to do with the equalizer curve in use rather than the hardware itself, and could most likely be replicated through an equalizer app. Out of the box though the Galaxy S4 has a pleasing balanced sound.

I have heard and read a lot of complaints about sound quality with Google Play music, I used All Access heavily throughout my time with the phone and noticed no issues in any of the music I listened too. The phone was factory reset prior to me using it so maybe that played some part.


Performance

The overall performance was a bit luck-luster to be honest, there was a lot of random lag, and jenkiness in places that lesser phones (in hardware and cost) ran quite fine. I don’t it’s fair to blame the Snapdragon 600 either, while it’s not as fast as the Snapdragon 800 there are other phones running the same platform with out the jenk. I have a feeling that touchwiz isn’t as efficient as it probably could be and that Samsung is just trying to do too much with all it’s extra features.


Overall

Overall I think Galaxy S4 is quite a good phone with a great screen and a feature packed camera. I’d pull up short of saying it’s a great phone though, it’s full of half baked features, and average quality bloatware that noticeably slow down the phone. Then there's the issue of it running TouchWiz, a UI that is in desperate need of a make over and a good performance tune. As such I couldn’t and wouldn’t recommend it to anybody I knew. The bottom line is there are better phones to be had at the same cost point like the HTC One, or below it like the Nexus 5 or Moto X.

Saturday, January 11, 2014

Virgin Usage Meter - An end is a new beginning

The Virgin Usage Meter has always been my favourite app, it taught me a lot about Android Development, but even more so about people. Virgin Usage Meter started out as a small app I wrote for myself which was never intended for release, in fact it wasn't until I saw a thread on Whirlpool requesting somebody write one, 3 months later, that I started to entertain the idea of releasing the app. After a few beta tests by the kind people in the Whirlpool thread I released the app which, for an app on the play store at that time, became a quick success. Within the first few days I had 1000 active users shooting past my very low expectations and steady growth over three years saw me topping 92000. Even more remarkable was that the app never dropped lower than a 4.5 star rating, and had a 5 star rating for the first 18 months.

So what did it teach me about people? It taught me that a very small minority of people expect that every developer owes them 24/7 support, instant fixes and can be incredibly condescending and rude. Luckily and more importantly it taught me that a large majority of people are encouraging, extremely accommodating, will step in to defend you against the above small minority. Even with all the time I spent developing the app, it was the users who shaped it into the app it eventually turned out to be.

Retiring the app wasn't as tough a decision as I thought it might have been. Three years is a long time for a single person to maintain a hobby app, and VMA's constant plan and website changes meant a lot of late night bug fixes and updates. I also started to receive a larger proportion of demanding emails, of which many grew abusive and threatening if I didn't respond within a few hours. So when Virgin approached me to sell the app to them and help rebuild it into an official app with official APIs, I saw a win/win scenario for myself and users and jumped at the opportunity.

I am really very pleased with how My Account turned out, there's a lot of my app lurking in there but with the new API's it's much more reliable and the new polish has made it much easier to use better to look at. It's still early days for My Account and I know Virgin have some great ideas for the future, and I'm happy to still be a part of an app that helped to carve out my career as an Android developer.


Virgin Mobile Australia - My Account