安卓设备扫描cpu卡和rfid超频卡插件cordova-plugin-pda

1.该插件只支持安卓设备,能够扫描上海复旦fm1216卡(CPU卡),s50卡,rfid超频卡等;这是我写的一个cordova插件,下面是安装步骤ionic

2.安装方法:工具

cordova plugin add hellowoody/cordova-plugin-pda

3.安装后,须要将com.woody.plugins.pda.Util类中的"import com.ionicframework.myplugins257081.R;" 修改成本身的包名如“import com.ionicframework.XXXXXX.R";”this

4.在你的项目MainActivity类中onCreate方法中增长Util.initSoundPool(this);这句代码,目的是为了初始化播放声音的工具类插件

5.使用演示:code

识别m1卡(s50)cordova

woody.plugins.PdaPlugin.m1(function(data){
  alert(data);
},function(err){
  alert(err);
});

识别cpu卡(复旦cpu)it

$scope.cpu = function(){
    woody.plugins.PdaPlugin.cpu(function(data){
      alert(data);
    },function(err){
      alert(err);
    });
}

识别uhf标签(超高频功能)io

$scope.uhf = function(){
    woody.plugins.PdaPlugin.uhf(function(data){
      if(data != "")
      {
        alert(data);
      }
    },function(err){
      alert(err);
    });
}

$scope.stopuhf = function(){
    woody.plugins.PdaPlugin.stopuhf(function(data){
    },function(err){
      alert(err);
    });
}
相关文章
相关标签/搜索