BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 07-03-2009, 12:04 PM   #1
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
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
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
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
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
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
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
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
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
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
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
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
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
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
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

RadioInfo.getNumberOfPacketsReceived() and RadioInfo.getNumberOfPacketsSent()
__________________
My other Blackberry is a PlayBook.
Offline  
Old 07-07-2009, 01:07 AM   #9
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
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
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
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
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
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
Dougsg38p
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
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
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
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
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
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
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
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
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
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
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
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
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
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
misty83
Thumbs Must Hurt
 
Join Date: Jan 2009
Model: 7100T
PIN: N/A
Carrier: -
Posts: 73
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
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Bissell 3-in-1 Lightweight Corded Stick Vacuum 2030 picture

Bissell 3-in-1 Lightweight Corded Stick Vacuum 2030

$28.88



BISSELL 3-in-1 Turbo Lightweight Stick Vacuum, 2610 (Black) picture

BISSELL 3-in-1 Turbo Lightweight Stick Vacuum, 2610 (Black)

$37.96



Dirt Devil Scorpion Plus Corded Handheld Vacuum Cleaner SD30025VB Red NEW picture

Dirt Devil Scorpion Plus Corded Handheld Vacuum Cleaner SD30025VB Red NEW

$35.00



Shop Vacuum upholstery extractor conversion kit auto vac detail carpet or home.  picture

Shop Vacuum upholstery extractor conversion kit auto vac detail carpet or home.

$192.00



VEVOR 5 Gallon Vacuum Chamber with 5CFM Vacuum Pump Kit 1/3HP Single Stage 110V picture

VEVOR 5 Gallon Vacuum Chamber with 5CFM Vacuum Pump Kit 1/3HP Single Stage 110V

$104.99



DZ-260C Chamber Vacuum Sealing Packing Machine 320W Commercial Vacuum Sealer picture

DZ-260C Chamber Vacuum Sealing Packing Machine 320W Commercial Vacuum Sealer

$310.99







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