No special permissions needed as far as I know - just read them like a
regular file. For example, I was using code like this for a prototype
network monitoring app (I am no java expert - this is mostly cut &
paste):

FileReader fstream;
try {
 fstream = new FileReader("/proc/self/net/dev");
} catch (FileNotFoundException e) {
...
}
BufferedReader in = new BufferedReader(fstream, 500);
String line;
try {
 while ((line = in.readLine()) != null) {
...


Bernhard



On Oct 29, 2:57 pm, blues <[EMAIL PROTECTED]> wrote:
> Can we read from Java? Any permission is required?
>
> Blues
>
> On Oct 29, 4:34 am, brs <[EMAIL PROTECTED]> wrote:
>
> > You could try to read
>
> > /proc/self/net/dev
> > /proc/self/net/snmp
>
> > to get interface and protocol level stats. I guess since this is not
> > part of the public API, there is not guarantee that these formats
> > won't change, but for now at least this information might be what you
> > are looking for.
>
> > Bernhard
>
> > On Oct 29, 2:15 am, blues <[EMAIL PROTECTED]> wrote:
>
> > > Is there a way to monitor the IP traffic? For example throughput?
> > > If not in java, can it be done through native code? I have seen some
> > > IP sniffer source code for linux.- Hide quoted text -
>
> > - Show quoted text -
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to