Fixed the deprecated function-calls for cordova version >= 4