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

Used Motherboard MSI PM8M3-V DDR2 USB2.0 For Parts
$196.0
Used Motherboard MSI PM8M3-V DDR2 USB2.0 For Parts picture12" X 16" Antistatic Resealable ATX Motherboard Bag ESD Metal Silver -FREE SHIP
$10.0
12ITW Ransburg 77431-12 Chassis - 77378 Motherboard - A10946-01 and 77377-02
$1500.0
ITW Ransburg 77431-12 Chassis - 77378 Motherboard - A10946-01 and 77377-02 pictureFANUC MOTHER BOARD A20B-1003-0230/07C A20B1003023007C
$100.0
FANUC MOTHER BOARD A20B-1003-0230/07C A20B1003023007C pictureLOT OF 2 SAFTRONICS MOTHER BOARD A1200R
$3.99
LOT OF 2 SAFTRONICS MOTHER BOARD A1200R picture






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