Splitting and rejoining a bitmap

I am writing an Android app that processes large bitmaps, and need to split the bitmap into separate 'tiles' and process each tile individually before stiching them back together in the final bitmap.

Any clues on how to do this? I thought it would be simple enough using createBitmap() and specifying the smaller tiles in a couple of nested for loops, but it's not as easy as I thought, because setPixels does not work as I thought it would.

A complication I have is that the 'tiles' need to overlap where they are not at the edge of the bigger bitmap, since the processing needs to see a couple of extra pixels around the sides of the bitmaps. I get around this if there is no need to split the image by simply adding a couple of layers of black pixels around the edges of the image, but this won't work for the tiles as they need the information of the actual surrounding pixels or the processing will not work.

Are there any easier methods to doing this? If not, how do I go about doing it using setPixels and createBitmap?