如何检查android中特定sim卡插槽的手机数据使用情况?

如何检查android中特定sim卡插槽的手机数据使用情况?,android,slot,dual-sim,Android,Slot,Dual Sim,我试图通过特定的SIM卡插槽查找数据使用情况。为此,我使用了TrafficStats.getMobileRxBytes()方法,但它给出了双SIM卡设备中两个SIM卡的总使用率 以下是我的代码,它返回我的总使用量: long rxBytes = (TrafficStats.getTotalRxBytes()- mStartRX)/ 1048576; RX.setText(Long.toString(rxBytes)); long txBytes = (Traff

我试图通过特定的SIM卡插槽查找数据使用情况。为此,我使用了TrafficStats.getMobileRxBytes()方法,但它给出了双SIM卡设备中两个SIM卡的总使用率

以下是我的代码,它返回我的总使用量:

 long rxBytes = (TrafficStats.getTotalRxBytes()- mStartRX)/ 1048576;
        RX.setText(Long.toString(rxBytes));
        long txBytes = (TrafficStats.getTotalTxBytes()- mStartTX)/ 1048576;
        TX.setText(Long.toString(txBytes));

        Log.d("totalWifiRe", (TrafficStats.getTotalRxBytes() - TrafficStats.getMobileRxBytes())/ 1048576+" MB");
        Log.d("totalWifiTx", (TrafficStats.getTotalTxBytes()- TrafficStats.getMobileTxBytes())/ 1048576+" MB");
        Log.d("totalDataRe", (TrafficStats.getMobileRxBytes()/ 1048576)+" MB");
        Log.d("totalDataTx", (TrafficStats.getMobileTxBytes()/ 1048576)+" MB");
        Log.d("SIM_STATUS", TrafficStats.getThreadStatsTag()+"");
        Log.d("DailyNetUsage", "");
        Log.d("CurrentTx", txBytes+" MB");
        Log.d("CurrentRx", rxBytes+" MB");
我想了解个人SIM卡的具体数据使用情况。如有任何建议,将不胜感激

有些应用程序正在像smartapp那样做