replace ctx with cordova.getActivity()