User Manual
35
TrafficStats.setThreadStatsTag(0xF00D);
TrafficStats.tagSocket(outputSocket);
// Transfer data using socket
TrafficStats.untagSocket(outputSocket);
Alternatively, the Apache HttpClient and URLConnection APIs included in the
platform automatically tag sockets internally based on the active tag (as identified by
getThreadStatsTag()). These APIs correctly tag/untag sockets when recycled through
keep-alive pools. In the following example, setThreadStatsTag() sets the active tag to be
0xF00D. There can only be one active tag per thread. That is the value that will be returned
by getThreadStatsTag() and thus used by HttpClient to tag sockets. The finally statement
invokes clearThreadStatsTag() to clear the tag.
TrafficStats.setThreadStatsTag(0xF00D);
try {
// Make network request using HttpClient.execute()
} finally {
TrafficStats.clearThreadStatsTag();
}
Socket tagging is supported in Android 4.0, but real-time stats will only be displayed on
devices running Android 4.0.3 or higher.
Using LogCat
LogCat is integrated into DDMS, and outputs the messages that you print out using the
Log class along with other system messages such as stack traces when exceptions are
thrown. View the Reading and Writing Log Messages. topic for more information on how to
log messages to the LogCat.
When you have set up your logging, you can use the LogCat feature of DDMS to filter
certain messages with the following buttons:
Verbose
Debug
Info
Warn
Error
You can also setup your own custom filter to specify more details such as filtering
messages with the log tags or with the process id that generated the log message. The
add filter, edit filter, and delete filter buttons let you manage your custom filters.
Emulating phone operations and location
Содержание SOMB-iMX6
Страница 1: ...Version 2015 MAR V 2 0 ORC SOMB iMX6 Carrier Board User Manual...
Страница 6: ...User Manual 06 3 ORC Dimension 4 Connector PIN of ORC Carrier Board to CPU Board...
Страница 17: ...User Manual 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20...
Страница 28: ...User Manual 28 Click Accept License Click Install...