A great feature I finally got to play with is the alpha/beta testing channel for selected users. Users wishing to take part of your beta must be part of either a Google Group or Google+ Community of your picking. You can set up a new group or community for each app if you wish.

The general idea is you add the group or community into a "list of testers" and it'll give participants of those groups special access to test builds.

Setting up your special access list

Firstly, set up a Group or Community. I chose to use a Google Group in this example (I may update instructions for G+ Community later). To create a Google Group or Google+ Community, log into Google Groups, click on "Create Group" and follow the instructions.

Once created, go to Settings > Permissions > Basic permissions to select who can join.

Once you're done setting up the privacy and access to the group, copy the email/URL from said group.

Setting up your app

For newly created apps, ensure the sections "APK", "Store Listing" and "Pricing & Distribution" don't have any marks against them by filling in the correct information, otherwise you can't publish. You can upload the APK last, it's just easier that way.

Under the APK tab, click on "Beta testing". Upload a new APK there. You can't publish without an APK in either production, beta or alpha.

The APK section has multiple tabs for different stages of testing

Change the app mode to "published". Changes will annoyingly take a few hours for the app to appear on the Play Store. You don't need to have a production APK ready, it'll publish fine with only alpha/beta but your app won't show up on searches.

A new heading under the "Beta testing" tab should have appeared called "Current APK". You should have the option to "Manage list of testers".

Click on "Manage list of testers".

Under "Add Google Groups or Google+ Communities", enter in the email address of your Google Group or Google+ Community.

Click add.

You should now see "Share the following link with your testers". Copy that link and save it somewhere.

When your app is finally visible on the Play Store (to you), share a message on the group/community board containing that testing link as either a topic on the group board or as a G+ post.

The user should click on the given link, giving them the option to opt into the beta.

Once they opt in, they can download the APK from the play store.

Other than that, the update and beta testing procedure doesn't look much different to the standard process of installing from the Play Store. Happy testing!

If there's one thing I found troublesome about XBMC, it's the poor support for anime shows out of box. I get that anime are done a little differently and that there's a separate scraper for anime information, but even that is a tad out of date.

The majority of the shows I had weren't scraped. Either due to different naming conventions or they just weren't matched at all.

Filenames

First of all, unlike TV shows, anime is treated like one big season. Your episodes should follow the naming convention of "Show Name - ep001.mkv". The important bit is "ep123" which lets XBMC know the episodic order.

The naming of this mod could have been a bit better, but it gets the job done well.

If your show still doesn't appear, you can tell it to scrape from a specific URL on aniDB.net by creating a file called "tvshow.nfo" in the show folder and pasting a link to the information.

For example Gintama (season 1), Gintama` (season 2) and Gintama Enchousen (season 3) are an absolute bitch to get right. Have no fear, just put the episodes into the right folders and place "tvshow.nfo" in each one.

For each file, paste in the direct link to each show accordingly and it'll scan right into XBMC fine. You may have to remove the show first in order for it to re-scan.

The good old "classic" layout from blogger.com has certainly served me well since my first post on the 25th of June, 2008. Over the past 5 years, I eventually wanted more space for content as my posts and code snippets became lengthier.

After searching around for a nice free theme, I stumbled upon Ultra Theme from bloggerthemes.net. Applying a few tweaks and updates of my own to the theme, I finally think it's ready!

The main changes are:

Obviously the colour has changed

Wider body column

Wider right column

Updated blocks on RHS column

Moved donation blurb to RHS column & semi-fixed it

Ads actually fit in the given space now

H4 headings are now actually different to "bolded" text

Cleaned up some markup so it's quicker to load

I'll probably make more tweaks as I go along, but for now you can compare them side by side below.

It is often handy to keep a service running in the background to manage certain tasks. They can be started from an Activity or a broadcast receiver. Managing the service lifecycle can be tricky unless you follow some key points, as I learned the hard way when creating Air Waves.

First off, services can either be;

a) Bound by the activity lifecycle (created and destroyed along with activity). Normally services will be destroyed once they have no more work to do and no remaining activities are binded to them.

b) Running along side with activity and only stops when it's done (or told to)

I'll show you how to start and manage the latter, a service that's running independently from an any binded Activities.

Defining

First you have to add some definition about the service in the AndroidManifest.xml file. Under application, simply add:

Key functions

Shown above is the important parts of it. The main points you'll need are:

onCreate() and onDestroy(): Use this to initialise and clean up your variables, much like in Activity.

onStartCommand(): If you were writing a service which is bound to the activity lifecycle, then this is the fun one where you write your service logic. Since ours isn't, then we can write our functions anywhere, like in doSomethingOnService().

Note: if you're starting the service from a broadcast receiver then onStartCommand() will be called often, whereas onCreate() won't. You'll need to keep track of this yourself.

Starting the service

Now there's no point having a fancy service if you can't use it. To start it up, you'll need some simple yet (hopefully) familiar code:

This is the key point you have to remember. If a service is started by startService(), then it will stay alive until you manually terminate it.

Connecting to the service

Once it's up and running, you can connect to the service and use it like a normal object.

The term you're looking for here is "binding" to a service. Services often provide functions which are needed by an Activity, and in order to access those functions easily you need to provide some "binding glue" between the two Activity and Service classes.

These two have been binded.

Within the Service class, notice the definition for LocalBinder. That allows your Activity to connect to the service via a ServiceConnection.

Here's a "trimmed down" version of the Activity class (I'm not kidding!)

// If we no longer need it, kill the service if (!G.isListening && !G.isSpeaking) { stopService(new Intent(this, AirWavesService.class)); }

super.onDestroy(); } }

Taking a closer look

Alright working our way from top to bottom, you'll see "service" and "serviceConnection" declared at the top. They're important as they bind your Activity to the Service.

Nothing interesting is happening at onCreate().

However, just below is onResume() and onPause() which control the life of the binding connection.

Whenever your Activity is destroyed, the bind is no longer valid and needs to be undone. Rule of thumb is if the number of bindService() and unbindService() calls don't match up, you'll get debug error logs:

Activity has leaked ServiceConnection <X> that was originally bound here. android.app.ServiceConnectionLeaked

With connectToService(), the startService() call will kick-start it into a persistent service. By the time we call bindService(), we can be sure that the service is already up and running, ready for connection.

AirWavesServiceConnection is simply an implementation of ServiceConnection so we can get a handle to the service. In onServiceConnected(), we save the reference to the service and during onServiceDisconnected() we delete that reference.

This isn't really necessary, but callServiceFunction() shows you how to call functions from the service. Pretty easy eh?

And of course, onDestroy() stops the service using stopService() when we no longer need it.

And there you have it, a long life service on Android!

Just wait until you start reading into stuff like foreground services and wake-locks in order!

In this example, I start a service when the internet connection is connected. This service does the heavy lifting of logic since broadcast receivers are meant to be very quick, otherwise you'll get system lockups.

Also, services are handy because users would definitely find it annoying if you started a full-screen Activity every time they connected to the internet.

In this case it starts a service called ContentCheckService. You can write whatever code you want in there, but I've added an example of a Toast notification so you can easily check if your broadcast receiver is working properly.

Keep the onReceive() call short! According to the BroadcastReiver docs, you only get 10 seconds before it's killed. This is because it runs on the main thread. Palm it off to a service thread as soon as possible!

Varnish is a load balancer, an extra layer of server software which sits in place of your web server (Apache, nginx, etc) listening to port 80 (or whatever you configure) and waits for HTTP requests. It then forwards the request to the server which isn't overloaded.

After the response is returned by your web server, Varnish will detect any ESI fragments which need replacing and cache the fragment. Varnish will not request the fragment from the server again until the content expires.

The data fragments are returned from Varnish's memory cache, which is pretty damn quick. This saves your server a whole heap of computational and database load.

sub vcl_recv { # Assuming that all your cacheable fragments/views contain the pattern /esi/ in the URL. # You can add other patterns too, but for the sake of this tutorial we'll just use this. if (req.url ~ "/esi/") { # Remove variances so it caches for every request unset req.http.Vary; unset req.http.cookie; } }

As you can see, it conditionally sets the custom headers which the VCL script is expecting.

A Python decorator simply wraps around a function and can modify the input/output of the given function. The following code is for a decorator varnish() in "varnish/decorators.py", which basically makes it easier to use esi().

In order for Varnish to know that we want a cacheable code fragment view, we need to add into the HTML:

<esi:include src="/path/to/your/esi/cached/view/" />

It's important that we have "/esi/" in the URL pattern as we've configured that pattern in the VCL script. Varnish will attempt to fill it in automatically from cache, or fetch the include URL from your server if necessary.

The following code is for a Django template tag in "varnish/templatetags/varnish.py" which I use to quickly write "esi:include" tags when ESI is enabled, or output the fragment content directly into the template when ESI is disabled.

The reason why we need to create a new temporary short[] called "x" is because not all values in audioBuffer will be filled by by AudioRecorder. The unfilled slots will cause exceptions when ByteBuffer tries to convert it.

Ensure that data stream is read and stored in 16bit

Now you might be wondering why I spent so much time writing up about silly bytes and shorts.

Well even though you're streaming audio data at 16bit, you can still access it 8bit at a time by fetching it out as bytes rather than shorts.

Now this bit is vital. In tandem with noise cancellation, we want to also improve the perceived audio quality for the user. By using of only 8bits of the 16bit audio data we are damaging the audio source, causing the sound to become fuzzy and unclear.

Well at first I did use MIC, until I found out the hard way that MIC will record EVERYTHING. Soft taps on the table or keyboard, rustling of a plastic bag, someone coughing in the background, etc.

You'll hear everything. Every. Single. Thing.

For my app in particular I needed to record speech WITHOUT all the distracting background fuzz. Using VOICE_RECOGNITION will pass the audio data into the phone's noise cancellation filters before handing it over to you.

So unless you're comfortable with implementing your own noise cancelling algorithm, it's much easier to just let the phone's built-in hardware handle it.

Another way to reduce noise is by using the AudioEffect NoiseSuppressor class available with Jelly Bean (Android 4.1 API level 16). I haven't looked into this very much as I still need to support Android 2.3.

After the explanation, I believe the rest of the sample code is fairly straight forward. The method simply loops until the audio stream fails to read, much like reading from a socket or file. Lastly, remember to clean up after yourself by closing the stream and everything should be happy.

As always, feel free to donate (link below) if you found this information helpful!

Sources

If you feel like checking out the various sources of information I looked at to learn all that, feel free to check out the links below.

Moving around long lines in Vim with the arrow keys has always driven me nuts. Sometimes it's just a big chunk of text (think legalese) and I just need to get to a column in the middle of the text and it takes forever to get there.

It's unorthodox, but it'll get you there.

To quickly navigate through long lines in normal/command/viewing mode, try pressing "gk" and "gj" to go up/down a visual soft-line and ignore the line wrapping.

If that's the sort of behaviour you're after, you can map it to a key of your choice by editing ~/.vimrc by adding these lines:

" Allow arrow keys to navigate soft lines map <Up> gk map <Down> gj

Of course you can substitute <Up> and <Down> with any other key you feel like.

This is something that's had me baffled for some time. It just didn't make sense that CPU usage was barely 9% during video playback, but when it's paused or a menu is shown the damn thing would cook the computer!

It isn't very noticeable when switching between episodes/movies/shows but if I fall asleep before a movie finishes, I'd definitely be woken up by the busy CPU fan when my HTPC tries to stop itself from roasting in the TV unit.

HTPC, meet heat and XBMC.

A little research quickly shows that XBMC still carries a lot of legacy code from it's XBOX days, and redrawing the interface at every given chance is just one of those things.

This means XBMC is written with "game loop" logic in mind, so they had to add some options in order to optimise the redrawing process.

Thankfully there is a fairly easy way to fix this (possible since Eden or Frodo I beleive).

Make sure XBMC is NOT running.

Open up Windows Explorer and go to "%APPDATA%\XBMC\userdata\" (or ~/.xbmc/userdata/ on Linux)

If "advancedsettings.xml" doesn't already exist, create a file called and open it with Notepad.

Under the <gui> tag, copy in <algorithmdirtyregions> and <nofliptimeout> as shown below.

I appreciate that you guys are thinking outside the square, but please consider eating your own dog food before sending it out to the public.
But it's really annoying when I have to go through a few extra clicks to do things that used to be straight forward.
And a big thank you for making an option so I can toggle the old one back.
Yours sincerely, Twig.

Much like this guy overtaking, it works. But at the same time it shouldn't be this hard.

So, how did I do it? It's actually not that hard!

Go to a new tab and type in "about:config".

Paste in "browser.download.useToolkitUI"(as of Firefox 26 this no longer works)

Toggle the boolean value to "true"

Click on the "Download" button and it should work immediately!

Firefox 26

This release broke support for the old download manager. As a result, you now have to download an addon in order to revive this feature.

People are always hawking on about how the PC is dead, but I've always found that having a specially built PC in the living room dedicated to media playback is much easier to manage.

You get so much more control compared to purchasing a pre-built media player (such as Boxee, WD TV Live, Apple TV, Android media unit, etc). You can actually upgrade software and make changes without hacking it, rather than hoping it already has options/compatibility you want and need.

Majority of it's life will be spent sitting pretty in the TV unit running XBMC as a media centre front-end. It's quite flexible, but a pain in the rear end to set up.

But of course, with every completed DIY project, you get this huge sense of accomplishment that money just can't buy.

And with every PC build, your personal preference will dictate which parts are selected. For me, I'd like my build to be:

quiet

low power consumption

a very small case (preferably slick and clean looking)

flawless 1080p playback (without the need for over-clocking)

cheap - under $500AUD (at time of build, early 2013)

Problems getting stock and mistakes

With all the possible hardware combinations available to you, being fussy with parts can actually bite you in the bum. What could possibly go wrong you ask? Well ...

My initial choice of cooler was bad as it wouldn't have fit, and the wait for it was even worse. I was after the Scythe Big Shuriken 2 Rev.B Low Profile because everyone recommended this thing, but the sole supplier for Australia just couldn't get any supply! Order placed in January, cancelled in April.

Just to get an idea of how small my case is, here it is next to a an average-sized CPU cooler.

Make sure stock can be purchased in your country before committing to it! Buying parts from around the world will mean more shipping costs, which adds greatly to your total cost.

Initially I decided on the LianLi PC Q12 (silver) but that wasn't available ANYWHERE in Australia, not even by order.

So my next choice was the InWin BQ656S, which was conveniently out of stock everywhere so I had to wait until Christmas was over and suppliers could order one in.

Pro Tip: When possible, don't leave your purchases too close to holiday season. Most computer stores close for public holidays and suppliers take long breaks over the Christmas break until the new year resumes. Even then, it'll still take about 2 weeks for stock to start flowing again.

I also forgot to check if the memory was low profile. The red memory sticks (G.Skill Ripjaws-X) I bought were not low profile so it wouldn't have fit with a bigger cooler.

The parts chosen, and why

The photos from this tutorial were taken over the span of 3 months as I waited for parts to arrive. I'll try to clarify each section as much as possible, but hopefully it isn't too confusing.

During 1080p playback and idle however, both the A4 and A8 use about 24W~30W on the same motherboard.

I opted for the A8 since I intend on running a few Steam games (mainly Castle Crashers) on the HTPC. If you go with the A4, it's much easier to find a 65W TDP low profile aftermarket cooler.

CPU Cooler

As my parts arrived in batches, I just couldn't wait to build my computer. Like a kid who couldn't wait to unwrap his presents on Christmas Day, I quickly built this HTPC using the stock cooler and planned on reassembling it when the Xigmatek cooler arrived.

After waiting for a few months, I found the Xigmatek PRAETON LD963 and cancelled my order for the Scythe Shuriken cooler. It was the ONLY low profile cooler that:

would fit in the case

provide enough cooling for 100W processors

and had a PWM fan, allowing the motherboard to adjust fan speed/noise (22dBA MAX)

and orange looks pretty good against black :)

Due to the open-mesh case design, there is NO sound insulation provided by my case. With the stock cooler, this is very annoying as the fan was rather noisy during quiet movie scenes.

Motherboard

In terms of bang for buck, this board already delivers on benchmarks so I didn't quite need the stuff in the 85X board.

What was most important to me was HDMI output, SATA3 (6Gb/s) for SSD, front USB3 ports and gigabit Ethernet.

WiFi isn't a deal breaker as I've already got Cat5E running around the walls of the house, but 7.1CH HD audio was nice a bonus.

There's a risk though. Some people have been reported this motherboard catching on fire! This was a bit of an uncertain purchase for me, but it's worked out well over the past 5 months.

Memory

"G.Skill Ares Series 8GB (2x4GB) DDR3-1866" to make use of dual channel speeds. 8GB is more than enough for basic media playback, and sparing some for gaming if needed. The motherboard can only access it at 1866mhz without over-clocking anyway.

The ARES ram also is short/low profile, so it'll help accommodate for any low profile coolers you're putting in. The red Ripjaws-X pictured in the photos aren't low profile, so when the Ares memory finally arrived I threw the Ripjaws into another computer.

Storage

When Sandforce released the current generation of SSD controllers, there was a flaw in the firmware which caused catastrophic drive failures.

Most of the SSD manufacturers rushed it out anyway, selling products with broken firmware. Many angry customers had their drives returned.

Intel took a different approach. They took the time and money to work with Sandforce, developing their firmware in order to iron out bugs and get it working, properly.

For this, I chose to pay extra to buy some peace of mind. It's been a few months now and the drive runs pretty sweet. Definitely can't complain about the 15s cold boot on Windows 7.

Most of the stuff will be streamed from another computer anyway. For those who want to stash stuff on the HTPC, get an external. It's easier for everything, especially when you have front-panel USB ports.

Case

Now this is very much up to personal taste, and to be honest there aren't many mini-ITX cases to choose from in Australia.

I admit, this InWin case looks like crap on the official site but when it arrived, there was no regret. Overall, it was surprisingly well built and looks quite nice in person.

The fact it came with a power supply made the choice easier. I didn't have to bother looking into silent Pico PSUs and that kept the price down.

Comparing it to my sofa cushion, just to give you an idea how small it is.

Throwing it all together

Alright, let's get busy! Time to crack open our canvas and do some prep work.

Note: Before touching any of these electronic components, remember to ground yourself to remove any excess static.

If needed, gently move some aside cables to make room for the motherboard.

Notice the big hole on the side in the photo above? That's where you should pop the IO shield as you can't physically do this once the motherboard is in.

If you're using the stock cooler (or a simple cooler which doesn't require a custom back-plate) then skip this part as you can install the cooler much later in the build process.

------------------------------

Some after-market coolers may require their own bracket, meaning you have to remove the one that came with the motherboard and use the one provided with the cooler.

Looking at the photo above, on the right is the original "clipped" state. Get a pen or something pointy to push the pin from the bottom. After pushing, it should look like the left pin so you can pull the clip off.

For the ASRock FM2A75M-ITX, it required access to the back of the motherboard. Instructions will vary depending on the clips used by the manufacturer.

This is what it should look like after you've removed both clips. Now it's time to install the custom back-plate.

Some coolers require you to have access to both sides of the motherboard in order latch it on. If that's the case, you're going to have to lock in the CPU first. Jump to the CPU section ahead before continuing.

Aftermarket coolers usually come with some thermal paste. Put on a small amount (usually the size of a rice grain) in the middle of the CPU and then press the cooler onto the CPU evenly. Lock it onto the motherboard when it's in place.

Sorry for the lack of photos when it comes to installing coolers, but you really do need two hands to do this.

Oh and don't forget to connect the CPU fan to the motherboard!

Note: The rest of the guide was written with the assumption that a stock cooler was installed, so you won't see it in the photos.

------------------------------

Motherboard

The InWin case already has non-screw "standoffs" for the motherboard, so it didn't need any standoff screws.

Look at how small it looks in my hand!

Time to slot in the motherboard. Use the screws provided and lock it in place. Make sure it's not going to move because everything else will sit onto it.

Memory

Take a close look at the photo. There is a groove in the memory slot that's located about 2/3 of the way. It should match the orientation of the memory.

Place the memory onto the slot evenly and push one end in first, then the other. There should be a click on each end as the latch locks automatically.

If it doesn't match, you're doing it wrong!

CPU

Raise the lever to unlock the CPU socket.

Taking a look at the AMD APU chip, you'll notice a little arrow in the bottom right corner. Match that corner with the arrow in the CPU socket (bottom left).

Making sure it's in the right orientation, place the CPU in and push the lever down. It'll move a little but that's fine. The CPU shouldn't move once the lever is in place.

Note: If you're installing an aftermarket cooler, a reminder to go back up a few pages!

Stock CPU cooler

For AMD sockets, place the cooler onto the chip and run the metal clamp through the middle of the cooler. Press firmly to lock it into place and close the latch.

For Intel sockets, place the cooler onto the chip and push each corner into the board until it clicks. Sometimes it's a bit tricky to hear it click. I hate those clips. Rotate the head of each corner to lock it into place.

Oh and don't forget to connect the CPU fan to the motherboard!

Storage

Almost there now! Find the drive bay and lock the SSD into place. Some drive bays require screws, other use clips depending on your case.

Mine just happen to be on the underside of the HTPC

Connect the power and SATA cables to the motherboard, preferably into SATA0. Just make sure you follow the "L" shape of the SATA lead and connector.

Spotted some Foxconn parts :)

Back and front panel connections

Now to plug things in! It tends to be stuff like USB ports, power/reset switch, HDD activity & power lights for the case.

For this step, it'll depend on the case you've chosen and the motherboard. I'm afraid there's not much I can do for you apart from telling to you read the manual and find the bits that match.

Pro tip: There's a little triangle in the plug which helps you figure out which way to put it in.

Next step is gonna suck... Remember those fiddly cables that you gently moved aside? It's time to plug them in, and I'd hate to tell you but these are the worst.

I spend more time trying to get these plugged in properly than compared to the rest of the build!

Take your time with these. Try to spot the triangle/arrow as it indicates a positive lead. Get them right now as it'll be a hassle to fix it up later.

It's good to have a torch handy as your hand is covering the motherboard, making it hard to see inscriptions.

On the bright side, now the hardest part is done.

Onwards to victory!

Wrapping up

Make sure there are no loose screws in the case. Someone I know had their newly-built gaming rig short-circuited by a rogue screw.

Here are some photos of the somewhat schizophrenic build. First up is the temporary build while I waited for the right cooler/memory to arrive.

Given the small space to work with, I managed to tuck some of the wires along the side of the case to keep cables neat. Unfortunately, the stock cooler didn't fit and left a huge gap with the cover.

For the HTCP's final boss form, here are pictures of the completed build with the right cooler and memory. No more gaps!

The new CPU cooler is MUCH quieter than the stock one supplied by AMD. Sweet orange colour too, couldn't be happier!

Time to close up the case as you prepare for your PC's maiden voyage. Time to test the power and reset buttons.

And IT'S ALIVE!!!

Quickly check to see if your LED connectors; power should always be on and disk activity flashing only when it's doing something.

Now you can start setting it up with an operating system, drivers and all of that magical software stuff. Once you're done, you'll have to find a nice place in the TV unit and wire it up properly.

Goals and results

Well, how did this build fare against the initial requirements?

Quiet?

Prior to getting into Windows, it's quite loud... But after it gets into Windows? Oh hell yes, can't hear it!