This is not the best answer. But for those who still could not do this, you can use a separate Android activity for this. You can call the methods of the DroidGap class from JavaScript. But this method will violate the rules of the cross platform. Since I cannot explain every step here, refer to this link .
source share