上記の私の質問に従って...ダウンロードと同様にICSカウントアップロードに存在してきたデータ使用量を行いますか?
上記の私の質問に従って...ダウンロードと同様にICSカウントアップロードに存在してきたデータ使用量を行いますか?
As per my question above... does the data usage that came into existence in ICS count uploads as well as downloads?
はい、そのためのAPIがあります(クラスは 99887766544330
です)。 APIレベル8(Android 2.2)で追加されました。
下記を見ることができるように、合計でRXおよびTXバイトの両方を提供し、会計モバイルまたはアプリごとの(APIレベル14に追加された場合は、1つとして等しいUIDカウントで)。これは抜粋です。すべての方法については、以下のリンクを参照してください。
Static Long getMobilerXBytes()
静的ロングgetMobiletxBytes()
静的ロングgetTotalRxbytes()
静的ロングgetTotaltxbytes()
静的ロングgetuidrxbytes(int uid)静的LONG getuidtxbytes(int uid) ...
API - ソース:> http://developer.android.com/reference/ Android / Net / TrafficStats.html
「データ使用量」ビューの実装:ここ
<事前> <コード> 9988776655443331PS:キャリアはまた、携帯電話がキャリアを失っているが、とにかく全体のビデオ全体がストリーミングされるように、到着するだけでなく、到着したことはありません。
Yes, there's an API for that (the class is android.net.TrafficStats
). It was added with API level 8 (Android 2.2).
As you can see below, it offers both Rx and Tx bytes in total, only accounting mobile or per app (added in API level 14, note that with an equal UID count as one). This is an excerpt, see the link below for all methods.
static long getMobileRxBytes()
static long getMobileTxBytes()
static long getTotalRxBytes()
static long getTotalTxBytes()
static long getUidRxBytes(int uid)
static long getUidTxBytes(int uid)
...
API-Source: http://developer.android.com/reference/android/net/TrafficStats.html
Implementation for the "data usage" view: here
final long foregroundBytes = entry.rxBytes + entry.txBytes;
PS: The carriers also count UDP traffic that just leaves their end but never arrives, such as rtp streams where the phone loses the carrier but the whole video gets streamed anyway.
© 2022 cndgn.com All Rights Reserved. Q&Aハウス 全著作権所有