Added support for api level < 13

Signed-off-by: Andrea Cappelli <a.cappelli87@gmail.com>