If you are building a hybrid app, then you will need a plugin for this task. If this code is from a custom plugin you are building, I would suggest posting your query on the Android developer forums
If you are looking for a general approach to updating your hybrid application from within Google Play, then you can define a service that regularly checks for updates of your app and when a new update is detected, prompts the user to install it. You can use the Market Cordova plugin to open Google Play or AppStore from within your application.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.