Hi, I am now developing an application under BlackBerry. I want to customize the user interface of the program as follow:
-----------------------------
| status bar |
-----------------------------
| |
| |
| the map |
| |
| |
-----------------------------
| banner |
-----------------------------
Since I am building native BlackBerry applications, I can only use MapComponent of BasicMapComponent to display the map.
I have tried several methods but I can't build the user interface as this way.
Anyone can help? Thank you very much.
Hi jaak, thanks for your help.
By the way, i have two new questions, hope you can spend some time to take a look.
1. If i use the MapComponent, can I add some pictures or icons above the map area?
2. Can I change the orientation of the map? (i.e. rotate the map 90 degrees clockwise)
Thanks.
1. Yes. If these are on map locations, then you can add Places to mapComponent. If these are UI buttons, then you should paint as overlay to the canvas, without involving MapComponent to it directly. But I'm not sure if overlapping UI elements are possible with custom Fields and FieldManager in Blackberry high-level UI.
2. Not inside MapComponent. However, some devices rotate whole application screen based on phone sensors automatically (e.g. Android, Nokia N95). Also map is rotated, and then you do not need to rotate map manually. Only thing to be checked is change of map size.
There are two ways: one is to use low-level graphics APIs and draw everything on the screen, and take care of locations and handling of all the different elements. More complex apps may require this approach. In this terms map is just a graphics object.
Another way is to use high-level UI API of Blackberry: Fields and FieldManager. See e.g. tutorial A11 from http://na.blackberry.com/eng/developers/resources/tutorials.jsp . Map could be defined as a custom Field and you can use this MapField custom field definition: MapField.java
It can be used in your app like that :
MapField _map = new MapField("Map", "abcdtrial", "RIMFieldUIDemo", "Vendor", 320, 150, new WgsPoint(24.764580, 59.437420),12); _fieldManagerMiddle.add(_map); _map.setDownloadStreamOpener(new DefaultDownloadStreamOpener( ";deviceside=true")); _map.startMapping();/JaakL