The technique you need is to isolate the chosen bit and either set or clear it. You already have the expression to isolate the bit since you're using that to test it above. You can set the bit by ORing it in, or clear the bit by bitwise AND with the 1's complement of the bit.
Please see the class java.util.BitSet that do the job for you.
To set : myByte.set(bit);
To reset : myByte.clear(bit);
To fill with a bool : myByte.set(bit, b);
To get the bool : b = myByte.get(bit);
Get the bitmap : byte bitMap = myByte.toByteArray()[0];