O'Reilly logo

BlackBerry Java Application Development by Bill Foust

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - using a resource in your code

  1. First, it is good practice to rebuild your project before starting to work with a new resource file. Do this by selecting Project | Build All.
  2. You need to add the new keys and values that you will be using to the resource files. Add a new key named SCREEN_NO_GPS_SUPPORT to the resources files and set the value to "No GPS Support is available".
  3. The next step is to add an interface to the HanselMainScreen class where you will be using resources. Add the interface named HanselResource to the implements list in the class declaration next to the LocationListener so that the code looks like the following code.
    public class HanselMainScreen extends MainScreen implements LocationListener,HanselResource
    
  4. Add ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required