Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Blanc
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

"deviceside=true" + APN settings in the device or added to this connection String

Hi all, i found this in the peter's thread

http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-c...

 

@peter : if we specify the or hardcoded the APN settings of our device in the code,  will it work on teh other devices???

 

Am trying to open a Httpconnection. but am unable to do it. HttpDemo is also not working.

 

In my url i mentioned as follows.... "http://mydevice/BI/services/BIReport.asmx/GetUserToken?UserName=venky&Password=venky!&AccountName=venky;deviceside=true"

 

I enabled the APN settings options, in the device also, but i didnt mention any username, password for it. do i need mention them to make it work? how to get the APN username and password.

 

Am working on storm1 4.7os.

 

help me...

Thanks and Regards,
PraveenGoparaju.
Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: "deviceside=true" + APN settings in the device or added to this connection String

whats the result of the network diagnostics?whats the result of the network diagnostics?

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is... http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/What_Is...

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Blanc
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: "deviceside=true" + APN settings in the device or added to this connection String

Hi simon thanks for reply, i gave APN name as portalnmms and i left usename and password, when i try to run the http demo and try to open the default page it is giving general socket error. and when i try to oprn google it is giving error trying to resolve.

 

what should i do. ...???

Thanks and Regards,
PraveenGoparaju.
Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: "deviceside=true" + APN settings in the device or added to this connection String

Are you sure about the APN details which your are using are correct?


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
Developer
Blanc
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: "deviceside=true" + APN settings in the device or added to this connection String

no... i found those on the net  and just enabled the APN.

Thanks and Regards,
PraveenGoparaju.
Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: "deviceside=true" + APN settings in the device or added to this connection String

apn is a provider specific value.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Blanc
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: "deviceside=true" + APN settings in the device or added to this connection String

means my carrier/provider  is vodafone, so vodafone is having some specific value and we need to get them from there, rite??

 

I have few things to be clarified.... .

 

one  thing to raise here... if the client or user is not having or didnt enabled the APN settings.. will our app works??

 

APN settings are only for apps or to get Internet access?? because anyhow am connecting to the interner and am able to access the google, gmail etc... but unable to connect to the net from my app. so some1 can help me to understand details of APN or kindly provide some info or references regarding this. 

 

 

Thanks for your time............

Thanks and Regards,
PraveenGoparaju.
Please use plain text.
Developer
simon_hain
Posts: 16,010
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: "deviceside=true" + APN settings in the device or added to this connection String

what is the result of the network diagnostic tool?

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Blanc
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: "deviceside=true" + APN settings in the device or added to this connection String

[ Edited ]

Thanks simon!!!  for the  valuable link... i wonder how i missed that stuff all these days!!!

 

I just gone through the demo and am studing the code.... it is very helpful for me, i tried to run it on the device but am not having the code signing keys with me. so am unable to test it on device, anyway it is working fine in the emulator.

 

 

Thanks and Regards,
PraveenGoparaju.
Please use plain text.
Developer
tek3
Posts: 190
Registered: ‎07-08-2009
My Device: Not Specified

Re: "deviceside=true" + APN settings in the device or added to this connection String

why dont you switch to using WAP2 method of connecting to internet...

 

The proper way to make internet connection form third party application is first checking for WIFI, then for WAP2 and then for TCP connection(APN settings)...

 

u can check for this like..

 

 

if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT,RadioInfo.WAF_WLAN, false))
             				{
             				   url = url + ";interface=wifi";   
             				}
             			   else if (CoverageInfo.isCoverageSufficient(CoverageInfo.COVERAGE_DIRECT)) {
             				   ServiceBook sb = ServiceBook.getSB();
             		    		net.rim.device.api.servicebook.ServiceRecord[] records = sb.findRecordsByCid("WPTCP");
             		    		 String uid = null;
             		    		              		    		 
             		    		        for(int i=0; i < records.length; i++) {
             		    		        if (records[i].isValid() && !records[i].isDisabled()) {

             		    		            if (records[i].getUid() != null && records[i].getUid().length() != 0) {
             		    		              if ((records[i].getCid().toLowerCase().indexOf("wptcp") != -1) && records[i].getUid().toLowerCase().indexOf("wap2") !=- 1 &&
             		    		                  (records[i].getUid().toLowerCase().indexOf("wifi") == -1) &&
             		    		                  (records[i].getUid().toLowerCase().indexOf("mms") == -1)) {

             		    		                uid = records[i].getUid();
             		    		                break;
             		    		              }
             		    		            }
             		    		          }
             		    		        }
             		    		        if (uid != null) {
             		    		        	url = url +";ConnectionUID=" + uid;
             		    		        }
             		    		        else
             		    		        {
             		    		        	url=url + ";deviceside=true";
             		    		        }

 

where url is ur specified url...you can either hardcode your APN settings for your provider..or manually enter them by going to Options -> Advanced Options -> TCP/IP

 

 

 

 

 

Please use plain text.