Code Camp was absolutely incredible! We had a great turn out. I had a great time, learned some stuff, taught some stuff, and generally enjoyed the entire experience. I had the honor of attending the "How to Start Writing Your Own Games on XNA" Lab, taught by Alberto Botero. As, someone who has written games the hard way, I was blown away with how easy it was to get really nice results.
A couple of our presenters didn't make it to code camp, one because he was involved in a car accident. So, we found ourselves with a full classroom and no presenter. Farhad Javidi stepped in to keep the crowd entertained while we scrambled to figure out what to do. I offered to do "BlackBerry Jam for Beginners" early, and was a little surprised when the folks, who were gathered for an iPhone presentation, took me up on it. Since we got a late start, I ran long and wasn't able to spend enough time on web services, stub generation, or threading. I hope the folks who attended will download the sample code and slides, which I think contain enough information to explain what must be done when calling web services.
My second session, in my scheduled time slot, went much, much better. I had time to get through everything, and there were some really good questions. Some people, who attended the first session, returned for the second session, which I was very glad to see. It gave me a chance to redeem myself a bit. I hope everyone enjoyed it, I know I did.
Bill Bird attended both sessions and had some additional insights to offer. He suggested that we form some sort of Charlotte area BlackBerry developer's group. I suggested that for now we could put together a discussion forum on a website. If I get time I'll look into doing that.
Many thanks to everyone who chose to attend my sessions, I really appreciate the support.
Saturday, March 28, 2009
Thursday, March 26, 2009
BlackBerry Jam for Beginners
Over the past several weeks I have been teaching myself BlackBerry development. I'm doing this for two reasons. First, I volunteered myself to present at Microsoft Code Camp, which I mentioned in an earlier blog entry. Second, I believe there is money to be made in the world of mobile applications. I have an idea that I would like to develop into an application for sale to the general public. Volunteering to present at Code Camp forced me to spend the time it took to learn this new set of skills.
Knowing absolutely nothing about Java or BlackBerry made my journey into the world of BlackBerry development quite a challenge. After some initial investigation I discovered that there were two different platforms for developing BB applications. MDS (Mobile Data System) applications, which require the BlackBerry Enterprise Server (BES), and CLDC/MIDP applications. MDS applications appear to be easier to design and write, based on information I have read on the BlackBerry site. However, BES is expensive and not available to your everyday BB user. So CLDC/MIDP was my only choice.
After more investigation I discovered that there is more than one development environment for creating CLDC applications. RIM provides the BlackBerry JDE and also a plug-in for Eclipse, which seems to be very popular among Java developers. I did some reading on various Blogs and forums and discovered that, although Eclipse is very popular, it does provide some additional challenges, especially around debugging and use of simulators. I really wanted to keep my learning curve to a minimum, so I chose to use the BlackBerry JDE, even though Eclipse may have provided some very nice editing features.
One of my main goals was to be able to call web services from the BlackBerry. For the application I intend to build, eventually, it will be required, so I decided to make that the goal for my Code Camp presentation. After many long hours of investigation, and many false leads, I discovered that JSR-172 had been implemented in the BlackBerry OS beginning with version 4.3. JSR-172 is a Java standard for accessing web services. I also found an Open Source project called K-SOAP. K-SOAP was built as a way call web services before JSR-172 had been implemented. K-SOAP 2 is supposed to be much easier to use than the original version and also easier than JSR-172. However, since I own a Curve with OS version 4.3 I decided to keep it "all in the family" and go with the built-in JSR-172 implementation.
I have built three sample applications, which demonstrate various facets of BlackBerry development. These are not intended to be an exhaustive demonstration of BlackBerry capabilities, but just to break the ice for those folks out there who are in the same boat I was, with little to no experience on this platform. The first example is a pretty simple application that just shows the basic layout of a BB Java app. The second example, shows how to incorporate localization through the use of resource files. Still, not a big jump ahead, but most mobile applications sold to the general public are sold on websites, which are available anywhere in the world, so... localization may eventually be needed. Also, by using resource files, you gain the ability to set the application title, which is displayed on the BB desktop. The third example makes a pretty big jump, since it incorporates both web service calls, via JSR-172, and also some simple threading. It turns out that threading is required because you can't call a web service using the same thread the processes events for your application. It really makes sense if you think about it, but it was a bit of a surprise when I first ran into it. Also, this is a good place to point out that it works fine without threading when using the simulator. The simulator also allows applications to run without code signing, where certain restricted APIs can only be used, on a real device, after the code is signed. Signing is also required, on a real device, in order to avoid warning messages to users when trying to call web services, something I didn't discover until after I had deployed the application to my Curve.
I'm a big SuperCross fan, and a play-school level, non-competitive, Moto-X rider. So, my sample code may seem a little unusual. No Northwind or Pubs database here. This calls a web service that provides the ability to look up a SuperCross rider by his number. It isn't very sophisticated and the data returned is minimal, but I think it is a good demonstration of the techniques required for mobile applications, and its more fun that Northwind.
I have uploaded my presentation slides and my sample code to my company site. Here's a link to the zip file. I have left the web service running, so anyone who downloads the sample code can see it run. Have fun!
Knowing absolutely nothing about Java or BlackBerry made my journey into the world of BlackBerry development quite a challenge. After some initial investigation I discovered that there were two different platforms for developing BB applications. MDS (Mobile Data System) applications, which require the BlackBerry Enterprise Server (BES), and CLDC/MIDP applications. MDS applications appear to be easier to design and write, based on information I have read on the BlackBerry site. However, BES is expensive and not available to your everyday BB user. So CLDC/MIDP was my only choice.
After more investigation I discovered that there is more than one development environment for creating CLDC applications. RIM provides the BlackBerry JDE and also a plug-in for Eclipse, which seems to be very popular among Java developers. I did some reading on various Blogs and forums and discovered that, although Eclipse is very popular, it does provide some additional challenges, especially around debugging and use of simulators. I really wanted to keep my learning curve to a minimum, so I chose to use the BlackBerry JDE, even though Eclipse may have provided some very nice editing features.
One of my main goals was to be able to call web services from the BlackBerry. For the application I intend to build, eventually, it will be required, so I decided to make that the goal for my Code Camp presentation. After many long hours of investigation, and many false leads, I discovered that JSR-172 had been implemented in the BlackBerry OS beginning with version 4.3. JSR-172 is a Java standard for accessing web services. I also found an Open Source project called K-SOAP. K-SOAP was built as a way call web services before JSR-172 had been implemented. K-SOAP 2 is supposed to be much easier to use than the original version and also easier than JSR-172. However, since I own a Curve with OS version 4.3 I decided to keep it "all in the family" and go with the built-in JSR-172 implementation.
I have built three sample applications, which demonstrate various facets of BlackBerry development. These are not intended to be an exhaustive demonstration of BlackBerry capabilities, but just to break the ice for those folks out there who are in the same boat I was, with little to no experience on this platform. The first example is a pretty simple application that just shows the basic layout of a BB Java app. The second example, shows how to incorporate localization through the use of resource files. Still, not a big jump ahead, but most mobile applications sold to the general public are sold on websites, which are available anywhere in the world, so... localization may eventually be needed. Also, by using resource files, you gain the ability to set the application title, which is displayed on the BB desktop. The third example makes a pretty big jump, since it incorporates both web service calls, via JSR-172, and also some simple threading. It turns out that threading is required because you can't call a web service using the same thread the processes events for your application. It really makes sense if you think about it, but it was a bit of a surprise when I first ran into it. Also, this is a good place to point out that it works fine without threading when using the simulator. The simulator also allows applications to run without code signing, where certain restricted APIs can only be used, on a real device, after the code is signed. Signing is also required, on a real device, in order to avoid warning messages to users when trying to call web services, something I didn't discover until after I had deployed the application to my Curve.
I'm a big SuperCross fan, and a play-school level, non-competitive, Moto-X rider. So, my sample code may seem a little unusual. No Northwind or Pubs database here. This calls a web service that provides the ability to look up a SuperCross rider by his number. It isn't very sophisticated and the data returned is minimal, but I think it is a good demonstration of the techniques required for mobile applications, and its more fun that Northwind.
I have uploaded my presentation slides and my sample code to my company site. Here's a link to the zip file. I have left the web service running, so anyone who downloads the sample code can see it run. Have fun!
Labels:
BlackBerry,
BlackBerry JDE,
CLDC,
Code Camp,
JSR-172,
Web Service,
webservice
Saturday, March 21, 2009
BlackBerry Jam @ Charlotte Code Camp
On March 28th I will be speaking at a Microsoft Code Camp hosted by The Charlotte Area Enterprise Developer's Guild at Central Piedmont Community College. My presentation will be called "BlackBerry Jam for Beginners" and will provide some much needed information for programmers who would like to build applications for BlackBerry. When I decided to do this presentation I knew absolutely nothing about BlackBerry or Java. Finding resources was difficult to say the least. There are no books, that I could find, that explain how to build BlackBerry applications, and information found via Google was spotty and required many, many hours to locate and sift. The presentation will introduce students to the tools required to build applications for BlackBerry and will also involve a sample application, which calls a web service to retrieve data. I plan to blog this presentation as soon as I have time.
Well, here I go...
People have been telling me for the last couple of years that I need a blog. I lead a very busy life, with my family, church, and professional commitments and really never thought I would have time for a blog. However, I think the time has come, so here I go...
Subscribe to:
Posts (Atom)