Interesting article in "Blackberry Cool"
Erasing All Data On Handheld
Enjoy!
Ideas and thoughts about Microsoft Identity, C# development, cabbages and kings and random flotsam on the incoming tide
Showing posts with label Blackberry. Show all posts
Showing posts with label Blackberry. Show all posts
Friday, October 14, 2005
Thursday, October 06, 2005
BB : Running simulator without IDE / JDE
Obviously you need the IDE / JDE to develop the application. However, the simulator can be run without starting up the IDE. The IDE requires the Java 2 SDK Standard Edition. The simulator does not.
Assume you want to run the simulator on a laptop which does not have the J2SE platform installed.
First install the BlackBerry Java Development Environment (JDE) from the Blackberry site. Then copy across the program files app.code, app.cso, app.debug and app.jar into the "C:\Program Files\Research In Motion\BlackBerry JDE 4.0.2\simulator" directory on the laptop. (This path assumes that you have installed the 4.0.2 JDE).
Now run the required simulator file from that directory e.g. 7100v.bat.
Enjoy!
Assume you want to run the simulator on a laptop which does not have the J2SE platform installed.
First install the BlackBerry Java Development Environment (JDE) from the Blackberry site. Then copy across the program files app.code, app.cso, app.debug and app.jar into the "C:\Program Files\Research In Motion\BlackBerry JDE 4.0.2\simulator" directory on the laptop. (This path assumes that you have installed the 4.0.2 JDE).
Now run the required simulator file from that directory e.g. 7100v.bat.
Enjoy!
Friday, September 23, 2005
BB : pushScreen always displays the menu on top
Really annoying problem. You invoke pushScreen and lo and behold the current menu pops up on top of the new screen. You have to escape out.
Lots of traffic on the Net about this. Half of the people say that it is not the default behavior and refer you to the Blackberry samples that don't exhibit this behavior. The other half say "Stuff the samples, I can SEE the problem and it's driving me nuts".
And the reason is the humble button (ButtonField). You aren't supposed to use buttons, rather add the action to the menu. But some users are Windows centric and WANT a button. The samples don't use a button; hence don't exhibit the behavior.
The problem is that the click is passed onto the next screen and so invokes the menu. The trick is to dump the click. You do this by:
bf = new ButtonField ("Submit", Field.FOCUSABLE | ButtonField.CONSUME_CLICK);
Problem solved.
Enjoy!
Lots of traffic on the Net about this. Half of the people say that it is not the default behavior and refer you to the Blackberry samples that don't exhibit this behavior. The other half say "Stuff the samples, I can SEE the problem and it's driving me nuts".
And the reason is the humble button (ButtonField). You aren't supposed to use buttons, rather add the action to the menu. But some users are Windows centric and WANT a button. The samples don't use a button; hence don't exhibit the behavior.
The problem is that the click is passed onto the next screen and so invokes the menu. The trick is to dump the click. You do this by:
bf = new ButtonField ("Submit", Field.FOCUSABLE | ButtonField.CONSUME_CLICK);
Problem solved.
Enjoy!
Thursday, September 22, 2005
BB : Installing an application from Desktop Manager
The first thing to remember is that you need to generate an alx file. Either right-click on the project in the "Files" window or under "Project" in the toolbar.
Then start Desktop Manager. (I have found that sometimes it helps to use the version of Desktop Manager on the CD that comes in the box with your Blackberry.)
Then "Application Loader". Then "Add" and browse to the alx file and select it. Then confirm that the checkbox is ticked and "Next".
It helps if you have a "Title" and a "Version" in your project properties under "General" . Also an "Output File Name" under "Build". That way Desktop Manager can tell you which file is which rather than a list of blank lines!
Enjoy!
Then start Desktop Manager. (I have found that sometimes it helps to use the version of Desktop Manager on the CD that comes in the box with your Blackberry.)
Then "Application Loader". Then "Add" and browse to the alx file and select it. Then confirm that the checkbox is ticked and "Next".
It helps if you have a "Title" and a "Version" in your project properties under "General" . Also an "Output File Name" under "Build". That way Desktop Manager can tell you which file is which rather than a list of blank lines!
Enjoy!
Wednesday, September 21, 2005
BB : Running simulator standalone
The Blackberry IDE puts the project files into e.g. :
C:\Program Files\Research In Motion\BlackBerry JDE 4.0.2\simulator
There will be .cod, .cso, .debug and .jar files for each project.
To run the simulator standalone, ensure that the project’s files are in the above directory, cd to the directory and then run the “type”.bat file in a command prompt.
e.g. to run the 7100v simulator, run 7100v.bat
Enjoy!
C:\Program Files\Research In Motion\BlackBerry JDE 4.0.2\simulator
There will be .cod, .cso, .debug and .jar files for each project.
To run the simulator standalone, ensure that the project’s files are in the above directory, cd to the directory and then run the “type”.bat file in a command prompt.
e.g. to run the 7100v simulator, run 7100v.bat
Enjoy!
Friday, September 09, 2005
BB : Showing the Blackberry screen on a PC
You can do this in Windows Mobile with one of the Power Tools.
It's really useful for demos. Just hook up the native device via Active Synch. , display the device screen on your PC, drive it from your PC mouse and keyboard and you can enlarge it and project it, make screen shots etc.
Beats the hell out of 10 people elbowing each other out of the way to look at the miniscule screen.
But there is no such facility on Blackberry. That sucks major league big time.
You have to do the demo. using the simulator. That leads to "smoke and mirrors" comments. And the Blackberry simulator DOESN'T simulate. It will run perfectly on the simulator and throw exceptions on the device.
My previous post concerning "blocking operation not permitted on event dispatch thread" is just one such example.
Enjoy!
It's really useful for demos. Just hook up the native device via Active Synch. , display the device screen on your PC, drive it from your PC mouse and keyboard and you can enlarge it and project it, make screen shots etc.
Beats the hell out of 10 people elbowing each other out of the way to look at the miniscule screen.
But there is no such facility on Blackberry. That sucks major league big time.
You have to do the demo. using the simulator. That leads to "smoke and mirrors" comments. And the Blackberry simulator DOESN'T simulate. It will run perfectly on the simulator and throw exceptions on the device.
My previous post concerning "blocking operation not permitted on event dispatch thread" is just one such example.
Enjoy!
BB : The dreaded "blocking operation not permitted on event dispatch thread"
Seen this message on your Blackberry?
“Uncaught Exception:blocking operation not permitted on event dispatch thread”
Have you done this?
A new class for threading:
class NewThread extends Thread
and in this you have a
public void run ()
Then in the main thread, you have
NewThread nt = new NewThread ();
nt.start ();
In NewThread, to access the UI you need:
UiApplication.getUiApplication().invokeLater
(new Runnable()
{public void run()
{
Dialog.alert ("Some message");
}
}
);
To access fields in the UI, use get / set methods (which are declared in the main thread) from the Runnable code above. I used to have the blocking exception until I changed to the above.
Enjoy!
“Uncaught Exception:blocking operation not permitted on event dispatch thread”
Have you done this?
A new class for threading:
class NewThread extends Thread
and in this you have a
public void run ()
Then in the main thread, you have
NewThread nt = new NewThread ();
nt.start ();
In NewThread, to access the UI you need:
UiApplication.getUiApplication().invokeLater
(new Runnable()
{public void run()
{
Dialog.alert ("Some message");
}
}
);
To access fields in the UI, use get / set methods (which are declared in the main thread) from the Runnable code above. I used to have the blocking exception until I changed to the above.
Enjoy!
Thursday, September 08, 2005
BB : BlackBerry MDS Studio
This is part of the BlackBerry Mobile Data System v4.1
http://www.blackberry.com/developers/promos/mds.shtml?CPID=OTC-devsept02
From the FAQ:
"BlackBerry MDS Studio is a powerful visual application design and assembly tool that allows developers to quickly create applications using drag and drop functionality."
It's different to a vanilla J2ME application because "BlackBerry MDS Applications are applications developed using BlackBerry MDS Studio and that require BlackBerry MDS Runtime Environment to be installed on the device in order to run."
So much like Windows Mobile where you also have to load the Compact Framework.
One question?
"Q: Does BlackBerry MDS support Microsoft .NET?
Yes. BlackBerry MDS Applications can integrate directly with Web Services created with
Microsoft .NET tools and running within a Microsoft .NET environment."
That's actually saying you can create a Blackberry client that speaks via web services to a .NET server. It doesn't mean that you can run .NET applications on a Blackberry. Isn't that the usual meaning of "support"?
Best of all though "BlackBerry MDS Studio is based on Eclipse. Eclipse is a widely used open source IDE framework that can be extended to create software development tools for particular types of applications."
Got to be heaps better than the current IDE. Finally some standardisation and another feather in the cap for Open Source.
Bring it on!
Enjoy!
http://www.blackberry.com/developers/promos/mds.shtml?CPID=OTC-devsept02
From the FAQ:
"BlackBerry MDS Studio is a powerful visual application design and assembly tool that allows developers to quickly create applications using drag and drop functionality."
It's different to a vanilla J2ME application because "BlackBerry MDS Applications are applications developed using BlackBerry MDS Studio and that require BlackBerry MDS Runtime Environment to be installed on the device in order to run."
So much like Windows Mobile where you also have to load the Compact Framework.
One question?
"Q: Does BlackBerry MDS support Microsoft .NET?
Yes. BlackBerry MDS Applications can integrate directly with Web Services created with
Microsoft .NET tools and running within a Microsoft .NET environment."
That's actually saying you can create a Blackberry client that speaks via web services to a .NET server. It doesn't mean that you can run .NET applications on a Blackberry. Isn't that the usual meaning of "support"?
Best of all though "BlackBerry MDS Studio is based on Eclipse. Eclipse is a widely used open source IDE framework that can be extended to create software development tools for particular types of applications."
Got to be heaps better than the current IDE. Finally some standardisation and another feather in the cap for Open Source.
Bring it on!
Enjoy!
Wednesday, September 07, 2005
Misc : Blackberry vs Compact Framework development
You can say what you like about Microsoft but the Compact Framework development environment and support creams RIM and Blackberry hands down, TKO, no contest!
- Visual Studio is a much better, less buggy IDE than the Blackberry JDE.
- Deployment is much easier with Active Synch as opposed to Desktop Manager. It's basically another folder and you can drag and drop all kinds of files anywhere.
- Blackberry Forum support is a joke. Does anyone from RIM actually read it? Most of the posts go unanswered for days on end. Compare this to the Google group "microsoft.public.dotnet.framework.compactframework". You get answers within hours and the quality is excellent with such people as Peter Foot, Paul G Tobey, Daniel The Moth, the two Alex's and so on.
- CF has the superb OpenNETCF. RIM has nothing even remotely comparable.
- Do a Google search for some CF samples. You are spoiled for choice. Do the same for Blackberry - the quickest way I know to return zero Google results. If anyone out there is doing Blackberry development, they certainly don't seem to be posting it to anywhere.
- To be fair, Blackberry is constrained by the J2ME environment in terms of the quantity and richness of the components but it's still no contest.
Enjoy!
Thursday, August 18, 2005
BB : Updating your application via Desktop Manager
The trick to getting DM to recognize that an application has been updated and hence a new version needs to be downloaded is to change the "Version:" under "Project/Properties/General".
Enjoy!
(Blackberry)
Enjoy!
(Blackberry)
Monday, August 15, 2005
BB : Adding an icon to your program
Use .png format.
Add the image to your project, then right click on the image file in the IDE, "Properties / Use as application icon".
Enjoy!
(Blackberry)
Add the image to your project, then right click on the image file in the IDE, "Properties / Use as application icon".
Enjoy!
(Blackberry)
Friday, August 12, 2005
BB : Getting a guid for Event Log
Ensure you are not in debug mode.
Type:
long guidName
Drag the cursor to highlight "guidName" and then right click.
Select "Convert guidName to long"
"guidName" will be replaced by the generated guid xL
Just edit to add "guidName =" before the xL to create
long guidName = xL;
Enjoy!
(Blackberry)
Type:
long guidName
Drag the cursor to highlight "guidName" and then right click.
Select "Convert guidName to long"
"guidName" will be replaced by the generated guid xL
Just edit to add "guidName =" before the xL to create
long guidName = xL;
Enjoy!
(Blackberry)
BB : Logging to Event Log
String myApp = "My App";
long appId = 0x8b979f96520ee725L;
EventLogger.register (appId, myApp, EventLogger.VIEWER_STRING);
String logMessage = "This is a test";
if (EventLogger.logEvent (appId, logMessage.getBytes()))
{
System.out.println ("Log successful");
}
Enjoy!
Note: To see how to get the guid 0x8b979f96520ee725L see my next post.
(Blackberry)
long appId = 0x8b979f96520ee725L;
EventLogger.register (appId, myApp, EventLogger.VIEWER_STRING);
String logMessage = "This is a test";
if (EventLogger.logEvent (appId, logMessage.getBytes()))
{
System.out.println ("Log successful");
}
Enjoy!
Note: To see how to get the guid 0x8b979f96520ee725L see my next post.
(Blackberry)
BB : Getting selected RadioButton option
RadioButtonGroup rbg = new RadioButtonGroup ();
rbA = new RadioButtonField ("A", rbg, true); // Selected by default
rbB = new RadioButtonField ("B", rbg, false);
add (rbA);
add (rbB);
boolean isA = rbA.isSelected ();
Enjoy!
(Blackberry)
rbA = new RadioButtonField ("A", rbg, true); // Selected by default
rbB = new RadioButtonField ("B", rbg, false);
add (rbA);
add (rbB);
boolean isA = rbA.isSelected ();
Enjoy!
(Blackberry)
BB : Getting selected item in ObjectChoiceField
String [] choices = {"A", "B", "C"};
ocfChoice = new ObjectChoiceField ("Select choice", choices, 0) ;
add (ocfChoice);
int index = ocfChoice.getSelectedIndex();
String selectedChoice = choices [index];
Enjoy!
(Blackberry)
ocfChoice = new ObjectChoiceField ("Select choice", choices, 0) ;
add (ocfChoice);
int index = ocfChoice.getSelectedIndex();
String selectedChoice = choices [index];
Enjoy!
(Blackberry)
Subscribe to:
Posts (Atom)