blackberry

Blackberry: how to convert time from String in “hhhh:mm:ss.ss” to “mm:ss” formate

元气小坏坏 提交于 2019-12-25 08:05:57
问题 I have a String with time and I want to convert it to other format. I try several soulutions and some of them was a ridiculous as convert string to char array and find numbers to colons etc. But I fail in that and I haven't enough time to found way by themselves. Can you give me a solution? This convertaion not usual but probably you have got a solution. Thanks. 回答1: The format "hhhh:mm:ss.ss" seems unusual. But if you use any standard date format then you can use following code segments:

Two titile bars on a single screen in BlackBerry

為{幸葍}努か 提交于 2019-12-25 07:59:06
问题 I am trying to build a screen in BlackBerry. In which there should be a second title bar just below the original title bar. Also the second title bar should be fixed and it should not be scrolled with vertical scroll. Need some advice on this issue. 回答1: You can add the second title and the original title bar on a VerticalFieldManager. Then just set that VerticalFieldManager as title, as it's possible to set any Field , Manager instance as title. Check public void setTitle(Field title) and

Blackberry development UI

时光毁灭记忆、已成空白 提交于 2019-12-25 07:47:13
问题 I am new to Blackberry dev, I want to port my android app to BB, but I found out it wont be possible for BB 7 Dev. So I've decided to create a simple app. However, I am having problems with the mainscreen, I do not know how to invoke the bitmapbuttons layout at app startup in the emulator. Any tutorials will be appreciated. 回答1: GridFieldManager will do this sort of layout for you, but I have problems using it, so I always end up using the TablelayoutManager code that you can find in this

How to prevent a List Field from showing duplicate data after auto-refresh

前提是你 提交于 2019-12-25 07:37:50
问题 I used the code below to refresh a List Field with data returned from an xml web service every minute. But after first refresh, the data duplicates. How do I prevent it from duplicating? public final class MyScreen extends MainScreen implements ListFieldCallback { ResponseHandler handler = new ResponseHandler(); ListField listUsers = new ListField(handler.getItem().size()); Manager mainManager = getMainManager(); protected void onUiEngineAttached(boolean attached) { if (attached) { Timer

Bitmap Image not displaying from a URL link Blackberry

浪尽此生 提交于 2019-12-25 07:22:32
问题 For some reason my blackberry application crashes whenever i try to display a bitmap image from a URL using the internet. I found the downloadImage() function very easy to understand and to follow compared to others on stackoverflow. The others didnt have any examples on how to implement their function. I have have tested the function downloadImage many times and all failed. Please give explanation with code example. Thanks. Anyway, The compiler stops at this point here: g.drawBitmap(10, y +

Refresh Screen to Update ListField with new Data

为君一笑 提交于 2019-12-25 06:39:10
问题 I am using a ListField Control to display data returned from xml webservice. I want to refresh the ListField or the screen every minute to update the ListField with new records or data. I tried using the code below but it is not working properly (It is hanging). public MyApp() { // Push a screen onto the UI stack for rendering. UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { UiApplication.getUiApplication().pushScreen(new MyScreen()); } },5000,true); }

Blackberry add border to image when focus

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 06:39:08
问题 I'm trying to make touchable image which can focus when I scroll it by touchable button on device this is my code for touchable image: class TouchBitmapField extends BitmapField { Bitmap bitmap; boolean second; int width; public TouchBitmapField(Bitmap startBitmap, long style, int width, boolean second) { super(startBitmap, style); this.second = second; bitmap = startBitmap; this.width = width; } protected void drawFocus(Graphics g, boolean on){ g.setDrawingStyle(Graphics.DRAWSTYLE_FOCUS,

How to get package name using blackberry

﹥>﹥吖頭↗ 提交于 2019-12-25 05:25:45
问题 I am new to blackberry development, Is it possible to get package name of the application which is installed in device. I din't get any reference for this. int[] handle = codeModuleManager.getModuleHandles(); for(int i=0; i<handle.length; i++){ ApplicationDescriptor[] app_descriptors = CodeModuleManager.getApplicationDescriptors(handle[i]); if(app_descriptors != null){ System.out.println("app_descriptors length "+ app_descriptors.length); for(int j=0; j< app_descriptors.length; j++){ System

Blackberry UI showing images at bottom

别等时光非礼了梦想. 提交于 2019-12-25 05:09:49
问题 I want to add a bar at the bottom of the screen which has images and a string ,i wanted to have the spacing equally like img1 string img2|img3 ,this is how the bottom bar should look like,below code is not wroking properly i am gettign the alignment and the last iamge is getting disappeared. HorizontalFieldManager horizontalFieldManager = new HorizontalFieldManager( FIELD_BOTTOM) { public void paint(Graphics graphics) { graphics.setBackgroundColor(0x316AC5); graphics.clear(); super.paint

How to retrieve PIM contact's photo as Bitmap using RIM5.0?

时光怂恿深爱的人放手 提交于 2019-12-25 05:08:55
问题 I want to retrieve contacts' images and display them in BitmapField s. So I'm collecting Bitmap objects from contacts, using this code: Vector bitmaps = new Vector(); BlackBerryContactList contactList = (BlackBerryContactList)BlackBerryPIM.getInstance().openPIMList(BlackBerryPIM.CONTACT_LIST, BlackBerryPIM.READ_WRITE); Enumeration contactListItems = contactList.items(); int counter = 0; while (contactListItems.hasMoreElements()) { BlackBerryContact contact = (BlackBerryContact