BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-03-2009, 12:04 PM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default is it possible to check when a user has connected(disconnected) to the internet?

Please Login to Remove!

hi,
is it possible programatically to check that the user has just connected (disconnected) to the internet?

kind regards
Offline  
Old 07-03-2009, 12:16 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

What do you mean? If you want to know if another program has opened or closed an http connection, then not unless that program implements an API to provide that information. If you want to know if the unit is configured and in service to enable a particular type of connection, then yes.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 07-03-2009, 12:34 PM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i must check if user:

-opens a browser (couse that means ofcourse that he is using internet)
-opens an application that (for example) download or send some files using internet

what i must to do is a log-every day i must write into a file for how long user was using internet, how many data did he received/sent. for receiving/sending data i know that there is RadioInfo.getNumberOfPacketsSent/Received but as i checked-it always returns something even if i do not run any application that connects to the internet and the browser is closed..

so i was wondering if there is any method that will tell me that (par example) the user has started/finished using a browser or an application (that connects to the internet).-cause having such methods i could simply count for how long the internet was used and also-when disconnected-i can get the packets sent/received.

can You please suggst me anything? cause i'm trying to solve it from yesterday and have no more ideas..
Offline  
Old 07-04-2009, 01:03 PM   #4 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

A BES will do that for you, I don't know if it would be possible for a third party application to find out what the browser is up to. That would run counter to Blackberry security.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 07-05-2009, 12:33 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i do not want to check what the browser does (which pages user has visited etc). i just need to recognize when user has started using internet and when finished it..
Offline  
Old 07-05-2009, 08:55 PM   #6 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

That would be a very difficult metric to validate, even if you could find that information which I don't think you can outside of the BES.

For example, I could start the browser and open a page, then put the browser in the background for several hours before coming back to it later without ever closing it. In fact the Blackberry browser never exits. The most you can do is go back to the start page. This is because one of the things the Blackberry browser does is listen for push data.

The BES can tell you when a particular page was loaded, but that is about it.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 07-06-2009, 01:19 AM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok, maybe let's try differently. i saw an application on bb which checks every day how many data did user sent/received from internet. i would like to do something similar for me. how can i do that?
Offline  
Old 07-06-2009, 11:07 AM   #8 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

RadioInfo.getNumberOfPacketsReceived() and RadioInfo.getNumberOfPacketsSent()
__________________
My other Blackberry is a PlayBook.
Offline  
Old 07-07-2009, 01:07 AM   #9 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i know these methods. but look-You must know when to call them. when? when user starts using internet.. so that is the reason why i was asking-how can i check if user has started using internet? i've noticed that getNumberOfPacketsSent() and getNumberOfPacketsReceived() returns me something even if i do not use internet at the moment (browser is closed and all application are closed also)...
Offline  
Old 07-07-2009, 12:10 PM   #10 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

I thought we covered that. You won't be able to get that information in a third party application. Your line of inquiry is based on a false assumption. A Blackberry never connects or disconnects from the Internet (except when turning on/off or entering/leaving coverage). The browser never starts or stops except when the device reboots. You may (with a BES) easily find out what URLs a user looks at and when (unless you allow third party browsers).

If you really have to have that kind of data, you should probably put your users on a BES anyway. Once they are on a BES you can disable all browsers except the Desktop Browser, disable loading third party applications then buy web monitoring software for your network.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 07-08-2009, 01:08 AM   #11 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hmm..
ok, so actually what for are these methods:
RadioInfo.getNumberOfPacketsReceived() and RadioInfo.getNumberOfPacketsSent()

as i cannot use them as i described? i really do not unerstand meaning of them, in this situation they are totally useless..
Offline  
Old 07-08-2009, 05:40 PM   #12 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

One more try: there is no way to determine if the user has "connected" to the internet, because the device is almost always connected (unless the device is in a basement or something).

The RadioInfo methods just tell you how much traffic is flowing between the device and the network. I suppose you could save these values at some given point in time, then compare a future value to determine how much traffic occurred.

The CoverageInfo class will tell you what type of coverage is *available*.

Perhaps if you explain what your end-goal is, someone can make a productive suggestion.
Offline  
Old 07-09-2009, 02:34 AM   #13 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

what i need to do is write to a log how much data did user downloaded and sent. every 24h data will be send to a server, the log ill be erase, and new data will be written.

as i understand-so.. if BB is almost always connected, probably that is the reason why getNumberOfPacketsReceived()/Sent() always return something. but i need an information of the data sent/received when user knows it (par example when he opens a browser and download something). i need to get somehow info about user's internet activity for which he would be charged!

also-getNumberOfPacketsReceived()/Sent() returns data in bytes?
Offline  
Old 07-09-2009, 02:49 AM   #14 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

even if using RadioInfo methods for checking transmission activity-i need to know when should i start checking it.. (that was the reason why i asked is there a possibility to check when user starts using an application which connects to the internet). i was thinking about writing a timer which will call getNumberOfPacketsReceived()/Sent() methods every second so that i can register the transmission activity.. but i do not think that putting it into timer is very efficient way of doing it.. i just do not have any idea.. :/
Offline  
Old 07-09-2009, 03:09 AM   #15 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i saw a presentation of a company whose application shows the usage of internet. par example-you run the application and You can see that You've used 3.5MB from 5MB free..
so if they did it-it is possible to do somehow..
Offline  
Old 07-09-2009, 09:43 PM   #16 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

You can't count on everything a company tells you in a presentation. The RadioInfo calls can be used for that, and that is the only way I've been able to find that kind of information. The problem is there are so many variables. Is the device in Wi-Fi cover. Even if it is, is some poorly written application using direct. Is the plan staggered with 50MB free for mail and 1GB free for web and everything else at $10/MB.

In any case, if you want to know how much data has gone to/from the Blackberry over a period of time you read those values at the beginning and the end of the period. The difference is the data use over the period.

Blackberries are very chatty, the values will more often change than not.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 07-10-2009, 01:33 AM   #17 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,
thx for answer.
i have implemented RadioInfoListener and i've noticed that it only reacts on the change of the signal. par example-when i turn on/off the radio. or when the strength of the signal has been changed. none of these parameteres says me if i'm using internet right now.

i'm trying to understand it (what is not always simple as my english is not too sophisticated). and as i understand-information about how much data did user download/sent can be taken from BES.. am i right?

regards and thx for Your time
Offline  
Old 07-10-2009, 01:38 AM   #18 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

and actually i have another question about these methods getNumberOfPacketsReceived()/Sent(). actually i think i do not understand them, i mean:

1. are these method for this, par example-when my application connects to a server and i sent to it, let's say and image.. so then i can call getNumberOfPacketsSent() and it would tell me how much data i've just sent?

2. or is it like that, when i call this method it returns me the number of packets that have been sent/received at that second when the methods were called?

3. or is it like that: i run my application and (par example) after one hour of the application's activity i call these methods so then they would return me how much data was sent/received during this hour?

that is really not clear to me..
Offline  
Old 07-10-2009, 02:51 AM   #19 (permalink)
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

i would also like to know what exactly is returned by these methods? cause in API it is written that number what packets.. but what is the size of these packets?
Offline  
Old 07-10-2009, 01:25 PM   #20 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

I don't know what API you are reading in mine is says getNumberOfPacketsReceived returns:
Quote:
Number of bytes received by the radio, or -1 if this feature is not supported.
__________________
My other Blackberry is a PlayBook.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.