BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-28-2009, 04:41 AM   #1 (permalink)
New Member
 
Join Date: May 2009
Model: 9530
PIN: N/A
Carrier: vodafone
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default IPAddress and broadcasting

Please Login to Remove!

Hello,

i am developing an application. in that i need to braodcast in LAN and want to have array of ip addresses in lan ..
how can i do this ..
for this i need to activate wifi on my device
am very new to this..

thoughts and suggestion are welcome

Thanks in advacne
Offline  
Old 05-28-2009, 04:48 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Dec 2007
Location: East Texas
Model: 8230
OS: 4.6.1.208
Carrier: Alltel
Posts: 110
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

uhm, wat?
Offline  
Old 05-28-2009, 04:53 AM   #3 (permalink)
New Member
 
Join Date: May 2009
Model: 9530
PIN: N/A
Carrier: vodafone
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok
i have a code which is written in .net, i need to convert

string sIP = "";
IPHostEntry IPHost = Dns.Resolve(Dns.GetHostName());
IPAddress[] addressList = IPHost.AddressList;
if(IPHost.AddressList.Length >0)
sIP = addressList[IPHost.AddressList.Length - 1].ToString();
else
sIP = "Unable to determine network address Error";

this means, i have IP address on my own, with the use of it i am broadcasting in LAN.

i need to implment this way on BlackBerry
Offline  
Old 05-28-2009, 05:14 AM   #4 (permalink)
New Member
 
Join Date: May 2009
Model: 9530
PIN: N/A
Carrier: vodafone
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

in the above code
Dns.GetHostName) returns my machines name "machine2"
one of the field (AddressList) in IPHost will contain my IP address

so in case of BlackBerry i need to know IP address f my device and using that ip address i will broadcast ??

but i am not getting IPADdress?

how can i resolve this ?
Offline  
Old 05-29-2009, 05:34 AM   #5 (permalink)
New Member
 
Join Date: May 2009
Model: 9530
PIN: N/A
Carrier: vodafone
Posts: 5
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

this is how i got IP address

int apnId = RadioInfo.getAccessPointNumber("rim.net.gprs");
byte[] ipaddr = RadioInfo.getIPAddress(apnId);
String ip =new String("");
for(int i = 0;i<ipaddr.length;i++){
System.out.print(" "+(ipaddr[i] & 0xff));
int temp = (ipaddr[i] & 0xff);
if(i<3)
ip=ip.concat(""+temp+".");
else{
ip=ip.concat(""+temp);
System.out.println("ipaddress "+ip);
}
}

but in this i have hardcoded the APN string ,, is there anyway by which i can get to know whats the APN on device .. as am testing this on simulator
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

Vintage DEC Digital M8639-YB RDRX Disk Controller Board 50-15649-01 E1 M8639
$125.0
Vintage DEC Digital M8639-YB RDRX Disk Controller Board 50-15649-01 E1 M8639  pictureVintage SIGNODE Crimping W14 Tool 17.5" long pat#1784123 dec9 1930 /N12167
$19.72
Vintage SIGNODE Crimping W14 Tool  17.5HSS 12PCS VALVE SEAT & FACE CUTTER 45DEC 30DEC 20DEC FOR VINTAGE CAR, BIKES,JEEP
$163.99
HSS 12PCS VALVE SEAT & FACE CUTTER 45DEC 30DEC 20DEC FOR VINTAGE CAR, BIKES,JEEP pictureHSS 21PCS VALVE SEAT & FACE CUTTER 45DEC 30DEC 20DEC - VINTAGE CAR,BIKES, JEEP
$222.99
HSS 21PCS VALVE SEAT & FACE CUTTER 45DEC 30DEC 20DEC - VINTAGE CAR,BIKES, JEEP pictureVintage Working Pelouze Model Y-5 Postal Scale Up To 7 Lb. Dec 31, 1975
$18.95
Vintage Working Pelouze Model Y-5 Postal Scale Up To  7 Lb. Dec 31, 1975   picture






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