I want to use android activity

i wanted to add some in app purchase for a market in my country…and then i needed to code it in java android…
is there a possibility for me to do that?
because i had friends which they’ve done it with cocos2d which the language is c++ and they could write java android code in it and add in app purchase and advertisement…

is it possible?

thanks in advance