Recently I came up across a blog which provides valuable information on the connections we can make in a BlackBerry application.
If you are interested read more at the following URL.
Recently I came up across a blog which provides valuable information on the connections we can make in a BlackBerry application.
If you are interested read more at the following URL.
If you are eager to find out about BlackBerry security permissions and ways to handle prompts following video from BlackBerry will help you in understanding the basics of it.
http://www.blackberry.com/DevMediaLibrary/view.do?name=SecurityPrompts
Further more if you are seeking ways to change application permissions using code, following link will help you to get more details of the Application Permissions class from RIM device API.
You will now see a set of cod files with names like App-1.cod, App-2.cod, App-3.cod, etc.
Step 2 - Prepare the ServerAPN or Access Point Name is a setting which needs to be set on the mobile when we need to get connected to internet using the phone.
APN changes from one mobile service provider to the other. For example Dialog will have http://www.dialogsl.com/ Rogers will have internet.com set as their APN.
But letting users set the APN manually is always not the preferred way. Recently we developed an application for BlackBerry which the user needed to get to the internet without he manually setting the APN. The application was supposed to be delivered through BlackBerry App World so manually setting APN was not an option. In a case like this what you have to do is set the APN programmatically into the connection.
String URL = “www.SomeServer.com”;
StringBuffer bfURL;
bfURL = new StringBuffer ();
bfURL.append (URL);
bfURL.append (";deviceside=true ;apn=internet.com");
bfURL.append (";tunnelauthusername=UserName;tunnelauthpassword=Password");
String FinalURL = bfURL.toString ();
In the above code I have set the Rogers APN in to this connection.
If you need more details on the parameters used or need to know about the other parameters you are eligible to use such as WapGatewayIP
, WapGatewayPort
, WapGatewayAPN
, etc visit the following link to view full details of the connector class.
http://www.blackberry.com/developers/docs/4.2api/javax/microedition/io/Connector.html
To find out the issue we had to even upgrade the BlackBerry OS and we found that in the new OS version the HorizontalFieldManager is having its default width wrong. So our textbox was hidden. We corrected it by the following change, making the sub layout always have a width that we prefer.
hfmtxtPassword = new HorizontalFieldManager() {
protected void paint(net.rim.device.api.ui.Graphics graphics) {
graphics.setBackgroundColor(Color.WHITE);
graphics.clear();
super.paint(graphics);
}
protected void sublayout(int maxWidth, int maxHeight) {
super.sublayout(278, maxHeight);
}
};