Wednesday, June 22, 2011
JVM Error 102 On Blackberry startup
I had spent hours searching for a solution to this problem (I even went to my service provider) and all I could find was that I would have to wipe the contents of my phone and start all over again -- tough luck if I didn't have backups for my contacts, appointments, program data, etc.
What it comes down to is that the JVM 102 error means that a .cod file on your phone seems to be corrupt, so the phone refuses to load it. Why wipe everything for one bad file? You might not need to!
Follow these steps:
Download JL_Cmder
Connect your phone to your PC using the USB cable that came with it.
Run JL_Cmder and select option 2 (event log)
Scroll to the bottom of the log and look for "JVM Error 102." The line before it should tell you exactly what file is causing the error. It might look something like this. Save the file name; you will need it later.
Go to Start > Run, and type "cmd" then press Enter.
Change directory to the JL_Cmder installation folder.
e.g., type: cd "C:\Program Files\JL_Cmder\" and press enter
Type the following command to remove the offending file:
javaloader.exe -u erase -f FILENAME
where FILENAME is the name of the .cod file.
Disconnect your phone from your PC and restart it.
This might not be a permanent solution, but it should at least let you boot up your Blackberry so that you can back up all your data before reinstalling everything.
reference:
http://supportforums.blackberry.com/t5/BlackBerry-Curve/JVM-Error-102-BEFORE-YOU-WIPE-YOUR-SYSTEM/td-p/92398
Wednesday, June 15, 2011
Install and Uninstall Blackberry COD file using Command prompt
Go to Command prompt
C:\Program Files\Research In Motion\BlackBerry JDE 4.7.0\bin\JavaLoader.exe -u erase -f yourcod.cod
The above mentioned is specific to my device.It may vary from device to device depending on installation.
To install the cod Using command prompt
Go to command prompt
C:\Program Files\Research In Motion\BlackBerry JDE 4.7.0\bin\JavaLoader.exe -u load yourpath\yourcod.cod
Mention the local path of COd File while installation
Thursday, April 7, 2011
Disable BackButton (Escape) and Default MenuItems in Blackberry
protected boolean keyChar(char arg0, int arg1, int arg2) {
if(arg0 == Keypad.KEY_ESCAPE ){
return true;
}else
return super.keyChar(arg0, arg1, arg1);
};
I still faced an issue loader screen closing on Blackberry button press.
So i overrided the onMenu method as
public boolean onMenu(int instance) {
if(instance==1073741824)
return super.onMenu(instance);
//returning false to intimate menu is not created
return false;
}
Finally solved...
Monday, February 21, 2011
ObjectChoiceField ( DropDown ) Selection change event in Blackberry
Sample piece of code
context value 2 represents the field changed.
Tuesday, August 31, 2010
Error in Jvm acess violation reading from 0x00000000 in Blackberry
1)Go to simulator installed path.For me C:\Program Files\Research In Motion\BlackBerry Smartphone Simulators 4.6.0\4.6.0.259 (8220)
2)Delete all files with .dmp extension.
3)Restart the simulator
Hope works fine...
Monday, August 23, 2010
TimeZones and Timezone offsets in Blackberry and J2me
First get all the Ids by
tring ids[]= TimeZone.getAvailableIDs(); for(int i=0;i<0;i++){ // will give you the TimeZone offsets such as +5,-4 etc. TimeZone.getTimeZone(ids[i]).getRawOffset(); } // will return the timeZone offset set in the device. TimeZone.getDefault().getRawOffset();
TimeZone class is applicable for both Blackberry and J2ME
From Blackberry 4.6 a new class TimeZoneUtilities is intoduced.
Just use the following code to retrieve array of Timezones
String str[]=TimeZoneUtilities.getDisplayNames(0);
The above code will give the list of important places and their corresponding timezones where as TimeZone class willl give only TimeZones (without city name).
Gps in J2me,Blackberry
the code for getting the latitude and longitude is:
Criteria c=new Criteria(); c.setHorizontalAccuracy(1000); c.setVerticalAccuracy(1000); c.setPreferredPowerConsumption(Criteria.POWER_USAGE_LOW); LocationProvider lp=LocationProvider.getInstance(c); Location loc=lp.getLocation(60); QualifiedCoordinates qc=loc.getQualifiedCoordinates();
Latitude can be retried by qc.getLatitude()
Longitude can be retrieved by qc.getLongitude()
these latitude and longitude can be then provided to google static maps to get relevant maps.
some google urls are
http://maps.google.com/maps/api/staticmap?zoom=14&size=200x200&maptype=roadmap&markers=color:red|label:S|40.714728,-73.998672&sensor=false
The above url will give a static map with pointing marker.
List of languages supported by Blackberry device
Locale supportedLocales[]=Locale.getAvailableLocales()
gives the list of locales in the device.
supportedLocales[i].getLanguage()
returns the string,which is the language of that corresponding locale.
see also
supportedLocales[i].getCountry();
Locale.getDefault();
Connections in Blackberry and DeviceSide
1)BES(Blackberry EnterPrise Server) using MDS(Mobile Data System)
2)BIS(Blackberry Internet Services)
3)Direct TCP/IP
4)WIFI Network
5)WAP(Wireless Application Protocol) Gateway
By using BES we can directly pass url as connection parameter without appending any deviceSide.
(HTTPConnection)Connector.open("http://www.blackberry.com");
While connecting to internet using BES the connection pathway is MDS by default except for some devices(6500,7500).In order to explicitly connect using MDS in all append deviceside=false at the end of the URL.
(HTTPConnection)Connector.open("http://www.blackberry.com;deviceside=false");
From Blackberry 3.8 there is a possibility for direct TCP/IP connection without using MDS.
For Blackberry smartphones operating using IDen networks(developed by Motorolla) a direct TCP connection is established if deviceside is not specified.For Blackberry smart phones doesn't operate on IDen networks Connection is established through MDS if deviceside is not specified.If blackberry MDS is not available during time of connection a direct tcp is established.
To override the default behavior of connection append deviceside=true at the end of url.
(StreamConnection)Connector.open("socket://testserver:600;deviceside=true");
In Wifi connections Blackberry smart phone is directly connected to blackberry infrastructure via WIFI.Blackberry Infrastructure exists between blackberry smart phone and BES or BIS.For the connections through WIFI no special logic is required except appending ;interface=wifi to the required url.
(StreamConnection)Connector.open("socket://testserver:600;interface=wifi");
In WAP connections Connection string parameters are hosted by wireless network provider.
References:
http://supportforums.blackberry.com/t5/Java-Development/Different-ways-to-make-an-HTTP-or-socket-connection/ta-p/445879
Complete reference:
http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-connections-to-the/td-p/206242
Glance on networks in blackberry:
Some Video tutorials:
http://www.blackberry.com/DevMediaLibrary/view.do?name=NetworkingTransports
http://www.blackberry.com/DevMediaLibrary/view.do?name=NetworkingTransportsII
Tuesday, July 27, 2010
MIME Types supported by BlackBerry Devices
String protocols[]=Manager.getSupportedContentTypes(null); System.out.println("the supported typed are:"); for(int i=0;i<protocols.length;i++){ System.out.println(" "+protocols[i]); }
Friday, July 23, 2010
Managers in Blackberry
[4.5 JDE]
#1)DialogFieldManager:
There are few other Managers which are added in JDE 5.0.
#1)BrowserField:
Upto Jde 5.0 if you want to hit an url or a web page ,the process is to hit browser which is an external application.Now by using BrowserField we can embed the browser within the java application.No need to call an external application.The process to initialise this browserfield involves three steps.They are:
- Instantiate Browser Field
BrowserField browserField = new BrowserField(); - Add browserField to UiManager or Screen
screen.add( browserField ); - Request the content to display.This method call is done only once.
browserField.requestContent( "http://blackberry.com" );
- BrowserField()
- BrowserField(BrowserFieldConfig config)
#2)GridFieldManager:
Row and column heights and widths may be specified as fixed sizes or may be automatically sized with the available space divided evenly among the rows and columns.
The grid will scroll vertically if the heights of the rows exceeds the visible height of the grid, and will scroll horizontally if the widths of the columns exceedst he visible width of the grid.
There is only one constructor
GridFieldManager(int rows,int columns,long style);
#3)AbsoluteFieldManager:
This is not having a JavaDoc upto now.No reference available for AbsoluteFieldManager as per my knowledge.If there is reference please comment me the link.
Reference:
http://www.blackberry.com/developers/docs/4.5.0api/index.html
http://www.blackberry.com/developers/docs/5.0.0api/
Friday, July 16, 2010
Get default currency value from BB device
RadioInfo.getMCC(RadioInfo.getCurrentNetworkIndex()).
Mcc means the Mobile country code.
public String setCurrency()
{
String currency="$";//default currency symbol
String array[]={"€","$","Rs","BZ$","£","R$",
"₪","R","¥","₩","руб","CHF"};
//all Character is in UTF-8. and copy from the http://www.xe.com/symbols.php
String euro[]={"225","204","278","270","222",
"208","206","202","272","293","214"};//MCC for the country which used euro sign
String pound[]={"417","248","602","348","274","266","415"
,"360"}; //MCC for the country which used pound sign
int li_Radio = RadioInfo.getMCC(RadioInfo.getCurrentNetworkIndex());String x = Integer.toHexString(li_Radio);//MCC for country.
boolean flag=false;
for(int i=0;i<euro.length;i++)
{if(x.equals(euro[i])){flag=true;
currency=array[0];//set Euro currency symbol
break;
}}
if(flag==false){
for(int i=0;i<pound.length;i++){
if(x.equals(pound[i])){
flag=true;
currency=array[4];//set Euro currency symbol
break;
}}}
if(flag==false){
if(x.equals("724")){
currency=array[3];//set Brazil currency symbol.
}else if(x.equals("425")){
currency=array[6];//set Israel currency symbol.
}else if(x.equals("655")){
currency=array[7];//set SountAfria currency symbol.
}else if(x.equals("467")||x.equals("450")){
currency=array[9];//set Koria currency symbol.
}else if(x.equals("441")||x.equals("460")){
currency=array[8];//set China or Japan currency symbol.
}else if(x.equals("413") || x.equals("404") || x.equals("405") || x.equals("410") || x.equals("429")){
currency=array[2];//set India or Nepal or Pakistan or Srilanka currency symbol.
}else if(x.equals("250")){
currency=array[10];//set Russian currency symbol.
}else if(x.equals("228")){
currency=array[11];//set Switzerland currency symbol.
}}
return currency;
}
First go to project property and click Text File Encoding checkbox to other and set encoding to UTF-8.
This code work on real device not in simulator.Set currency according to MCC and check current mobile network.
#2)Another method if you are not having a network carrier and you are using wi-fi
This code is set to currency symbols according to phone language setting.
public static String setCurrency()
{
String currency="$";//set $ as a default currency.
String array[]={"$","£","€"};
String x = Locale.getDefaultForSystem().toString();//MCC
if(x.equalsIgnoreCase("fr")){
currency=array[2];//set € symbol.
}else if(x.equalsIgnoreCase("es")){
currency=array[2]; //set € symbol.
}else if(x.equalsIgnoreCase("en_us")){
currency=array[0];//set $ symbol.
}else if(x.equalsIgnoreCase("en_gb")){
currency=array[1];//set £ symbol.}
return currency;
}
By the above method we can get through the languages which are supported by the device.
reference:
Wednesday, July 14, 2010
small issues great impact---My basic learnings Blackberry
#1)In a Manager or a Field there will be a default Height and width.This is obtained by using getPreferredWidth().If the height or width exceeds the preferred width then the width and height is obtained by using getHeight() and getWidth().So,if you want to use the width of a Field then it is better to go for
Math.max(field.getPreferredWidth(),field.getWidth());
#2)In paint method,
If you want to draw a background type of thing,do required coding before Super.Paint(graphics),else if you want to draw a text type of thing do required type coding after Super.Paint(graphics).Super.Paint(graphics) will do the required painting defined in code(ex. for a horizontalFieldManager it will add the fields which are written in respective code.).
#3[14/07/10])If you are a Blackberry developer running and debugging costs you a lot.Better go for 8320 simulator running.it will take very less time when compared to other simulators.9700 takes a lot of time to load but the advantage is load once use number of times.unlike other simulators 9700 doesn't ask for restart if you delete the app(unless if there is an exception that too in some exceptions only).9700 is based on 5.0 JDE.when coming to 9000 simulator it allows deletion for one time.After second time deletion of same cod file it asks for restart.
Friday, July 9, 2010
online vedio streaming in Blackberry .
//BB Code
private void startPlayingVideo2(){
try
{
Class playerDemoClass = Class.forName("VideoScreen");
_player = javax.microedition.media.Manager.createPlayer("rtsp://stream.zoovision.com/Movies/vader_sessions.3gp");
// Realize Player
_player.realize();
_player.addPlayerListener(this); // Add listener to catch Player events
_player.setMediaTime(100000);
_videoControl = (VideoControl) _player.getControl("VideoControl"); // Get the Player VideoControl
// Initialize video display mode
_videoField = (Field) _videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
// Set the video display size to 200 x 200
// Create a manager for the video field
_videoManager = new VideoManager();
_videoManager.add(_videoField);
add(_videoManager);
// Set video control to visible
_videoControl.setVisible(true);
_player.prefetch(); //player has to prefetch before it is getting started
_player.start(); // Start the Player
// Set up Player volume
setVolume(_currentVolume);
}
catch (Exception e)
{
}
}
Connections should be fast for live straming.
I checked in device as well as simulator.It worked fine for me.9000 simulator only supported for online streaming and i checked in 8220 device also.
References:
http://supportforums.blackberry.com/t5/Java-Development/Video-Streaming-Guidence/td-p/248096/highlight/true
Wednesday, June 23, 2010
Blackberry App dev into my life
First of all the Mobile applications need a lot of patience to develop.We have to use less resources not like the web apps or Java apps.It is based on Java (J2Me).RIM modified the J2me API into the way Blackberry supports.BB apps are COD files(which cant be extracted) not like JAR files of J2ME.J2me apps are also supported by Blackberry.But these(J2ME) Apps will not be approved by Blackberry app store team.
I worked on J2ME for 2 months and then suddenly shifted to Blackberry dev as per requirement.My first task i remember i have to support arabic text in my app.its a simple thing,the one that challenged me is to retrieve an arabic text from editField.I struggled a lot...and At last i got soln to store the value in RMS and retrieve the value from RMS.These are some of my first experiences on BB app dev.
On the flip side,The debugging and running are too slow in BB.An app developer should have a lot of patience.
Introduction.....Ends here.