08-16-2008 03:31 PM
Hi -
I am getting a ClassCastException on : map = new MapField(). This is on real hardware 8820, v4.5.0.52. It
runs fine on the simulator 8820, v4.5.0.44.
Since this class needs signing, I have gone through the process of getting the keys and signing the app. This is my first
time, and I could have done something incorrect in the signing. The signing tool says that it is signed.
Do I need to synch up on xx in the 4.5.0.xx? If so, is there a place for the release notes? I downloaded the
JDE from the official website, and it comes with 4.5.0.44. How do I get to 4.5.0.52 on the simulator?
Any other ideas would be appreciated as well.
Thanks
amod
08-18-2008 11:26 AM
08-18-2008 12:03 PM
Sure. I have removed some of the other code for clarity.
I am getting the exception in the catch block.
Did you run on the real hardware or the emulator? This works on the emulator, but
throws the exception on the hardware.
Thanks
amod
1) Entry -
package com.mobigility;import net.rim.device.api.ui.UiApplication;
public class Parkido extends UiApplication{
/**
* Sets up an instance of this class as the event dispatching thread.
** @param args Not used.
*/
public static void main(String[] args){
new Parkido().enterEventDispatcher();}
/**
* Loads the application screen.
*/
Parkido()
{
pushScreen(new ParkidoScreen());}
}
2) ParkidoScreen.java:
package com.mobigility;import java.util.*;
import javax.microedition.location.Coordinates;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.XYPoint;
import net.rim.device.api.lbs.MapField;
public class ParkidoScreen extends MainScreen {
/*************************************************
* Members
**/
MapField map; // Map instance that will be pushed on foreground
Vector vecGPSCoordinates; // GPS simulated coordinates
static Vector vecSM; // SM vectors
final int NUMPOINTS = 17; // Number of points that are simulated
final static int NUMSM = 2; // Number of points that are simulated
final int PERIOD = 2000; // Ring the timer every PERIOD time
final int ZOOM = 2; // Set the level for map view.
static int indexCoordinate;String sEx="deadbeef";
/*************************************************
* Constructor
**/
ParkidoScreen() {
try {
// Instantiate the MapField object
//
map = new MapField();
} catch (Exception ex) {
setException(ex);
UiApplication.getUiApplication().invokeLater(new Runnable() {public void run() {Dialog.alert(
"Exception in ParkidoScreen().Bailing ." +getException());System.exit(1);
}
});
}
}
08-18-2008 02:55 PM
I did tested this on an actual BlackBerry, not just the BlackBerry Simulator.
I created a simple test application that just pushes the screen you have below and I didn't receive any exception. Is there more to your application that triggers the exception?
What are the version numbers of the following modules on the BlackBerry. You can see these by going to Options, Advanced Options, Applications and selecting View Modules from the menu.
net_rim_bb_lbs
net_rim_bb_lbs_api
net_rim_bb_lbs_api_2
08-18-2008 03:48 PM
There is more code in the application, but I started commenting to a point
where the instatiation of the MapField class throws an exception.
Here are the versions:
net_rim_bb_lbs - 1.2.26
net_rim_bb_lbs_api - 1.2.26
net_rim_bb_lbs_api_2 - 4.5.0.52
What do they show up on your BB?
Thanks
amod
08-18-2008 04:55 PM
Those values are fine and are the same as mine. They should match the BlackBerry handheld software version in 4.5.0.
Have you been able to reproduce this in a stripped down sample application that just pushes the screen you have posted? Or does this only occur in a larger application?
08-18-2008 05:22 PM
I will build a new project and try just that tonite. Earlier, I was commenting the larger project.
Any other suggestion to try out?
Thanks
amod
08-18-2008 05:53 PM
08-18-2008 11:28 PM
1) I built a new project, and I still see the same exception.
2) I then tried to print the returned class, but I still see the Exception.
As before, both work well in the emulator.
I am lost, and I can to reinstall the device software. Can you point me to the location for a stable 4.5.0 release?
If there is anything else, let me know.
Thanks
amod
Here is the code of the new project -
Parkido.java:
=========
package com.mobigility;import net.rim.device.api.ui.UiApplication;
public class Parkido extends UiApplication{
/**
* Sets up an instance of this class as the event dispatching thread.
** @param args Not used.
*/
public static void main(String[] args){
new Parkido().enterEventDispatcher();}
/**
* Loads the application screen.
*/
Parkido()
{
pushScreen(new ParkidoScreen());}
}
ParkidoScreen.java:
==============
package com.mobigility;
import java.util.*;
import javax.microedition.location.Coordinates;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.XYPoint;
import net.rim.device.api.lbs.MapField;
public class ParkidoScreen extends MainScreen {
/************************************************
* Members
*
*/
// MapField map; // Map instance that will be pushed on foreground
String sEx="deadbeef";
/************************************************
* Constructor
*
*/
ParkidoScreen() {
try {
// Instantiate the derived MapField object
//
Object o = new MapField();
setException(o.getClass().getName());
UiApplication.getUiApplication().invokeLater(ne
public void run() {
Dialog.alert("Class name of object " +getException());
System.exit(1);
}
});
} catch (Exception ex) {
setException(ex.toString());
UiApplication.getUiApplication().invokeLater(ne
public void run() {
Dialog.alert("Exception in ParkidoScreen().Bailing out ." +getException());
System.exit(1);
}
});
}
}
/* For exception handling
*/
private String getException(){
return sEx;
}
private void setException(String strEx){
sEx=strEx;
}
}
08-18-2008 11:50 PM
I just realised that my desktop manager version is 4.5.0.15. Does that need to be in synch with the device
software version of 4.5.0.52? If so, where should I get that desktop manager version?