On a BlackBerry, the indication panel at the top of the display can be used to display alerts to the user.
Typically this is used to display status changes such as new email messages, new facebook messages or new news feed items etc.
Since OS 4.6, BlackBerrys have had the ability to easily add entries to the notification area. The image on the left shows a BlackBerry Torch with 2 indicators.
To add an indicator into the notification area, requires that an icon be loaded and stored in the ApplicationIndicatorRegistry and then displayed with an optional numeric value next to it.
To register the indicator icon, use the following code:
This piece of code loads the image indicator.png from the application and stores it in the ApplicationIndicatorRegistry. The parameters to the register() method are:
- The ApplicationIcon to register
- Boolean flag indicating whether to display an icon only or whether to display a numeric value alongside the icon.
- Boolean flag indicating whether the application indicator is visible when first created.
Once the icon has been loaded and stored in the registry, it can be updated easily in the notification area:
Sometimes it can be useful to flush the DNS cache held on your computer. The DNS cache maintains a local cache of mappings between hostnames and ip addresses. So, if either of those change, for example if you change hosting providers, your local DNS cache can get out of date. The DNS cache will flush itself automatically, but if you need to flush it immediately, open a terminal shell and enter the following:
~ $> dscacheutil -flushcache
This command works on Leopard (10.5) and Snow Leopard (10.6). To flush the cache on Tiger (10.4), open a terminal and execute the following command:
~ $> lookupd -flushcache
I've recently been attempting to back up my Mac (Snow Leopard) to a network drive but keep getting an error 45 saying that the "Time Machine could not complete the backup".
The problem seems to be that, for some reason, Time Machine cannot create the relevant sparsebundle file on the network drive to allow the backup to be made. The solution is therefore to create the sparsebundle file yourself rather than letting Time Machine create it.
The trick to creating the sparsebundle file is to give it the appropriate name for your computer. The file must be called machinename_macaddress.sparsebundle
To get these pieces of information, open up a terminal shell and type "hostname". This will give you the name of your computer.
~ $> hostname
To get the mac address of your computer, type "ifconfig en0 | grep ether" into a terminal shell.
~ $> ifconfig en0 | grep ether
ether xx:xx:xx:xx:xx:xx (I've replaced the actual values with x's)
Now that we've got the machine name and the ethernet address, open up Disk Utility and select the button to create a "New Image".
Enter the name of the disk image as machinename_macaddress.sparsebundle and ensure that the Image Format field is set to "sparse bundle disk image" and the Partitions field is set to "Hard disk".
When you've entered the information, press the create button. Depending upon the size of the disk you have created this should take a relatively short time.
Finally, after creating the sparsebundle file, copy it to your network drive, open up Time Machine and select the drive containing the sparsebundle file as the backup drive.
Time Machine should now be able to perform backups to your network drive.
Installing the BlackBerry PlayBook SDK will fail on Windows 7 if a 64-bit JVM is installed on the system with an error saying “Win64 not supported”.
An easy way to get the SDK to install is to force the installer to use a 32-bit JDK. This can be done by unzipping the installer. When unzipped, there are two folders (InstallerData and Windows) that are extracted. Inside the Windows folder, edit the file BlackBerryTabletSDK-Air-Installer-0.9.0.201010221500.lax Inside this file is a line that reads:
Edit this line to point to the javaw.exe executable in a 32-bit JVM you have installed. e.g.
Once you have done that, run the installer (BlackBerryTabletSDK-Air-Installer-0.9.0.201010221500.exe) from the Windows directory and the SDK will install correctly on 64-bit Windows.
If you’ve written more than a very simple BlackBerry application, you’ll know that you need to sign most applications with keys obtained from RIM. Getting keys from RIM and signing applications within Eclipse is an easy process and well documented on the BlackBerry web site.
If however you change computers, its a bit more difficult. Depending on what you read you’ll see that the signing keys are tied to a single computer, or you need to request new keys from RIM, or you can just copy keys between computers.
The latter of these is the closest to the truth, but there is still a sting in the tail.
When you move development computers, to move the code signing keys with you, you need to copy the following directory to the new computer.
Once you’ve copied the keys over, you need to import them into Eclipse using the “Import Existing Keys” option on the “Window | Preferences” dialog as shown below.
That appears to be everything you need to do, however if you try to sign some code now, you will get an error back:
The private key is not located in the sigtool.csk file
To overcome this issue, you need to copy the sigtool.csk and sigtool.db files that were copied above into the vmTools folder.
Having followed these steps, you should be able to sign applications on a new computer.
I’ve recently been looking into NoSQL databases and found this poll
over at JavaLobby
According to the poll, the top 3 NoSQL databases are:
- Apache Cassandra - 33%
- Apache CouchDB - 21%
- MongoDB - 15%
Out of these top 3, MongoDB seems to be the one that most fits my needs. Its a scalable document centric database that has a simple Java API. Getting up and running with MongoDB is a very simple process and to easy to start writing apps against it.
If I had time to spend looking at Cassandra and CouchDB, I’d probably find them very similar, but for the moment I’m concentrating on MongoDB.
I’d be interested in others thoughts about these 3 NoSQL databases (or indeed any other NoSQL database).
OS 6 is expected to be released in the next calendar quarter.
I like the look of the new OS – RIM seem to have freshened it up nicely, particularly for touch devices, whilst retaining that BlackBerry look and feel.
I recently posted
on how to programatically set the background color using Java within a BlackBerry app.
This technique works fine if you are using Field Managers to add components on to the screen.
If however, your user interface is drawn within the paint(Graphics g) mehod, this technique does not work. In this case, you need to override the paintBackground(Graphics g) method to set the background color.
After installing updates to Windows Vista and rebooting, I got the new “Browser Choice” screen displayed. This allows European Windows users to choose a browser(s) to install.
After confirming you’re connected to the internet, you can choose which browsers to install. There’s also a shortcut on the desktop in case you want to run this again at a later date.
Setting the background color on a BlackBerry screen is fairly easy. Since JDE 4.6.0, the BackgroundFactory class can be used to accomplish this.