I already know how to set the opacity of the background image but I need to set the opacity of my shape object.
In my Android app, I have it like this:
In general you just have to define a slightly transparent color when creating the shape.
You can achieve that by setting the colors alpha channel.
#FF000000 will get you a solid black whereas #00000000 will get you a 100% transparent black (well it isn't black anymore obviously).
The color scheme is like this #AARRGGBB there A stands for alpha channel, R stands for red, G for green and B for blue.
The same thing applies if you set the color in Java. There it will only look like 0xFF000000.
UPDATE
In your case you'd have to add a solid node. Like below.
The color here is a half transparent black.