Wednesday, September 30, 2009

How to Hard Reset i-mate JASJAM

Different phone has different key combinations to perform a hard (factory) reset.
In i-mate JASJAM you need to press the 2 soft keys together while pressing the reset whole.
Then it will show options, letting you proceed or cancel the reset. Remember hard resetting will wipe all the applications and data in your device, so remember to backup everything before performing a hard reset.

Wednesday, September 23, 2009

Distributing BlackBerry Applications Over Internet

BlackBerry applications that you develop can be distributed over the internet quite easily when you know what you need to do. In this method users need to browse to the web URL and click on it so the BlackBerry will download and install the file automatically.

Step 1 - Prepare the Files
When you compile the source code of the application you will be getting a .cod file.
Check the file size of it, if the cod file is less than 55KBs then you can use it without doing anything more.
If that is larger than you need to do the following trick to make the application distributable over the internet.
  • Change the extension of the cod file to zip.
  • Unzip the zip file.

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 Server
To make BlackBerry devices correctly identify and download the files you need to add or update the Multipurpose Internet Mail Extension (MIME) types in your web server. The required MIME types are as follows.
File Name Extension - MIME Type
cod - application/vnd.rim.cod
jad - text/vnd.sun.j2me.app-descriptor
jar - application/java-archive

If you need more details on how to set MIME types in different web servers please contact me, I will try to provide you with more details.

Now place the cod files we prepared in Step1 in the server.

Thursday, September 17, 2009

BlackBerry Network Diagnostic Tool

Latest BlackBerry smart phones are supporting many different network transports to enable reliable data communication between third-party applications and the Internet.

BlackBerry have provided a good tool named "Network Diagnostic Tool" which is essentially a role model that answers all these questions and is a functional diagnostic tool for testing a URL over various transports supported by the BlackBerry solutions, as well as for displaying the values of many network attributes during the test period.
You will be able to download it freely from BlackBerry knowledge base.
If you need to know more about the available transports and more in depth details on the network diagnostic tool, better visit the Article Number: DB-00684 at the BlackBerry knowledge base.

Setting APN Automatically

If you tried to create a BlackBerry application which uses internet through Direct TCP transport and needed to release it to a set of users who are using different mobile networks you may have had the problem of how you can release the application in a way that users don't have to make any setting changes to make your application get connected. The complexity here happens because different service providers (mobile networks) are using different settings (for example APN).
After some searching on the net I found one way to achieve this is by identifying the mobile network and then setting the connection properties appropriately.
The steps involved is as follows.

Step 1
Identify the network the phone is currently in.
If you need help on this go to this URL.

Step 2
Get the APN settings for your network.
The way here is to have a file with all the settings of different wireless service providers you intend to run your application on, and then compare the value returned from Step 1 and get to the particular APN.
I suggest you to keep a XML or text file with the following details of the service provider,
  • Country Name
  • MCC
  • Carrier Name
  • MNC
  • TCPAPN
  • TCPAPNUserName
  • TCPAPNPassword
  • WAPAPN
  • WAPIP
  • WAPPort
  • WAPUserName
  • WAPPassword
  • WAPSourceIP
  • WAPSourcePort
  • IsEnableWTLS
Step 3
Add the APN to the connection.
If you need help on this go to this URL.

Determining the Network

In the BlackBerry project that I am in now we are having the requirement to detect the mobile network the phone is currently in.
Basically in BlackBerry mobile network is uniquely identified by the Mobile Country Code (MCC) and the Mobile Network Code (MNC).
To get these details from your code what you have to do is to call

RadioInfo.getMCC()
and
RadioInfo.getMNC()

These will return the codes in decimal.
You can find a full list of MNC codes of the mobile phone operators and a list of country codes by following the following URLSs to Wikipedia.
http://en.wikipedia.org/wiki/Mobile_Network_Code
http://en.wikipedia.org/wiki/Mobile_Country_Code

If you need to access the BlackBerry knowledge base article describing the above process you can follow the following link.
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/1467358/How_To_-_Determine_the_MCC_and_MNC_of_the_current_network.html?nodeid=1467359&vernum=0

Sunday, September 13, 2009

Setting APN

APN 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

Tuesday, September 08, 2009

Benz Show 2009

Recently I managed a project which targeted iPhone and SharePoint server. This was a project for Dimo who are the dealers for Mercedes Benz in Sri Lanka. Total software services were provided by IronOne Technologies.

When we finalized the technologies I thought that this project will be an interesting one.
But the real interesting part was on the day when I saw all the Benz models present on the day. Even though I have seen international car shows before this, this is the first time I have seen this much of cars of the same manufacturer on the same place live.
You will agree after you see the photos.

Sunday, September 06, 2009

SharePoint Content Placeholders

I found the following image describing the content placeholders in Windows SharePoint Services (WSS) 3.0 master page.
I think I got this from Microsoft. Thanks Microsoft.

Hope it helps to you.

Friday, September 04, 2009

iPhone / iPod Not Shown in iTunes

Is your iPhone or iPod not getting detected by iTunes?
If yes here is the way to get your device back to the iTunes.
iTunes is using two background services (Apple Mobile Device Service and iPod Service) while it is running. These services will be watching your USB ports and if an iPhone or iPod is connected they will detect those.
If your device is not getting detected first thing you need to do is to check the service statuses. It is always good to stop and restart the services using the Services in your machine.
To check the statuses first making sure iTunes is closed and your device is disconnected from USB ports then go to Start -> Control Panel -> Administrative Tools -> Services.
There you will find Apple Mobile Device Service and iPod Service.
Right click on each service and Restart (Better to Stop and Start) them.
Then start iTunes and connect your iPhone or iPod and the device will get detected again in iTunes.
If this fails you need to restart your machine and check again and if that also fails better try reinstalling iTunes with the latest version from Apple.

Friday, August 21, 2009

Missing Textbox in BlackBerry Application

Recently in one of my BlackBerry projects my development team faced a peculiar error.
We were targeting the device BlackBerry 8900 Curve for the project.
The device we purchased was having OS version 4.6.1.114 and our application was functioning properly on that.
But when we sent the application to our client suddenly he was complaining that one textbox was missing completely. Only difference was that the client was using a BlackBerry 8900 Curve having the OS version 4.6.1.250.
Following are the view at the two ends.
At our device.
At the customer site.

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);

}

};

Tuesday, August 18, 2009

Updating the OS of Blackberry 8900 Curve

Recently I needed to update the OS of the BlackBerry 8900 Curve device from 4.6.1.114 to 4.6.1.250.
To do this first you need to download the BlackBerry Desktop Manager Latest Version (5.0) and the OS required (4.6.1.250).
You can download the files required at,

Desktop Manager
and select the desktop manager software and download it.

OS
Downloading the correct OS is bit tricky. You need find the correct version for the service provider (Dialog Sri Lanka, T-Mobile, Rogers, etc...). All the available service providers are listed in the above link.

When the download is complete you will get a file similar to 8900jEastAsia_PBr4.6.1_rel378_PL4.2.0.113_A4.6.1.250_Dialog_Sri_Lanka.exe
After completing the download, first install the Desktop Manager and then run the executable (8900jEastAsia_PBr4.6.1_rel378_PL4.2.0.113_A4.6.1.250_Dialog_Sri_Lanka.exe) of the OS. That will add the OS files to a place where desktop manager can use them to update the device.

Browse to the place where the Desktop Manager is installed (C:\Program Files\Common Files\Research In Motion\AppLoader), then delete the "Vendor.xml".
Now run the "Loader.exe" to start the application loading process. Make sure your BlackBerry is connected to the computer. In the second screen you need to select the connection which your device is using (for e.g. USB).
Then after few clicks of the next button the wizard will start installing the new OS to the device.
It will take about 25 minutes to complete the updation process. While that is happening make sure that you are not pressing any buttons on the phone and as also make sure you keep the USB connection alive.
After sometime the BlackBerry will get restarted with the new OS. Enjoy.
I you are having any problems please contact me, I may be able to help you.

Monday, June 08, 2009

Configuring DB Mail to use GMail

Have you configured SQL DB Mail to use GMail to send mails?
This post shows you how to achieve it.
1. Start the SQL Server Management Studio and login as SA.
2. Expand "Management" and right click on Database Mail and click on Configure Database Mail.

3. Select the first radio button and press Next.
If DB Mail service is not started it will prompt you to enable it.4. Put a profile name, then click on Add to configure the SMTP account.5. Click on the New Account, to create the account.
6. You need to put the account name, email address, display name, server name (smtp.gmail.com), port number (587), check the checkbox for Require secure connection (SSL) and select basic authentication as the SMTP authentication method and provide your user name and password.
When all are done press Ok.

7. Now pressing Next will bring you a screen to select the default profile. Select the newly created profile as default and click Next.
8. Using the Configure System Parameters screen you can change the parameters if required. But in this case defaults are perfect. Press Next.
9. Press the Finish button after checking the actions to create the new profile.
10. You can check whether it is properly setup by right clicking on Database Mail and Sending a Test Mail.