blackberry-storm

How to save & delete a Bitmap image in Blackberry Storm?

我只是一个虾纸丫 提交于 2019-12-08 05:30:03
问题 I have a ready Bitmap image. Now I want to save & delete it. I m doing it like.. FileConnection fconn = (FileConnection)Connector.open("file:///store/home/user/StoredBitmap/"+picIndex+".bmp",Connector.READ_WRITE); if(!fconn.exists()) fconn.create(); OutputStream out = fconn.openOutputStream(); if(image == null) System.out.println(" image null "); else { out.write(byte[]); out.close(); } fconn.close(); For Blackberry Storm device & simulator, which path to give instead of "file:///store/home

Blackberry Storm Emulator - TouchGesture events not firing, how to get a Swipe to work?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 14:00:04
问题 Been playing with the Storm Emulator and the 4.7 JDE, for the life of me I can't figure out how to fire gesture events in the emulator. Below is the touch event code for the RIM sample app EmbeddedMapDemo. It seems straightforward enough, but touchGesture.getEvent() == TouchGesture.SWIPE never seems to register to true. How can I register swipes in the Emulator? With my mouse I try doing left-click and drag but that does not seem to work. /** * @see Field#touchEvent(TouchEvent) */ protected

Current latitude and longitude in a BlackBerry app

烈酒焚心 提交于 2019-12-06 11:31:57
问题 I want to get the user's latitude and longitude in my BlackBerry app, and then generate the maps according to it. How can I do that? my code is: import java.util.Timer; import java.util.TimerTask; import javax.microedition.location.Criteria; import javax.microedition.location.Location; import javax.microedition.location.LocationListener; import javax.microedition.location.LocationProvider; import javax.microedition.location.QualifiedCoordinates; import net.rim.device.api.system.Application;

How to set Anti Aliasing in Blackberry Storm?

一世执手 提交于 2019-12-06 05:29:26
I m drawing in a bitmap like.. bitmap[i] = new Bitmap(60, 60); Graphics g = new Graphics(bitmap[i]); g.setColor(Color.BLACK); g.drawLine(....); Now how to set Anti-Aliasing on before g.drawLine()? For antialiasing mode use public void setDrawingStyle(int drawStyle, boolean on) For lines use graphics.setDrawingStyle(Graphics.DRAWSTYLE_AALINES, true); graphics.drawLine(x1, y1, x2, y2); graphics.setDrawingStyle(Graphics.DRAWSTYLE_AALINES, false); For poligons use graphics.setDrawingStyle(Graphics.DRAWSTYLE_AAPOLYGONS, true); graphics.drawRect(x, y, width, height); graphics.setDrawingStyle

How to access image stored in Blackberry using Bitmap.getBitmapResource()?

落花浮王杯 提交于 2019-12-06 03:15:36
I want to access an image stored in Blackberry, say at location "store/home/user/image.png" . Now can i access this image as, String filePath = "file:///store/home/user/image.png; Bitmap image = Bitmap.getBitmapResource(filePath); BitmapField bitmapField = new BitmapField(image, BitmapField.FOCUSABLE); OR I have to access it as, String filePath = "file:///store/home/user/image.png; FileConnection fconn = (FileConnection)Connector.open(filePath, Connector.READ); if (fconn.exists()) { ........ ........ input.close(); fconn.close(); } I am able to access the image using the second way but I want

Current latitude and longitude in a BlackBerry app

☆樱花仙子☆ 提交于 2019-12-04 15:23:31
I want to get the user's latitude and longitude in my BlackBerry app, and then generate the maps according to it. How can I do that? my code is: import java.util.Timer; import java.util.TimerTask; import javax.microedition.location.Criteria; import javax.microedition.location.Location; import javax.microedition.location.LocationListener; import javax.microedition.location.LocationProvider; import javax.microedition.location.QualifiedCoordinates; import net.rim.device.api.system.Application; public class GPS_Location { private String log; double longi; double lati; public GPS_Location() { new

How to handle ButtonField & BitmapField Click (Touch) events in Blackberry Storm?

佐手、 提交于 2019-12-03 16:43:58
I have created a ButtonField & a BitmapField like.. public class MyCanvas extends MainScreen implements FieldChangeListener { HorizontalFieldManager hfm; private Bitmap startBitmap; private BitmapField startBitmapField; private ButtonField okButton; MyCanvas() { hfm = new HorizontalFIeldManager(); startBitmap = Bitmap.getBitmapResource("start.png"); startBitmapField = new BitmapField(startBitmap); startBitmapField.setChangeListener(this); hfm.add(startBitmapField); okButton = new ButtonField("Ok", ButtonField.CONSUME_CLICK | ButtonField.NEVER_DIRTY); okButton.setChangeListener(this); hfm.add

What image format is fastest for BlackBerry?

大城市里の小女人 提交于 2019-12-02 00:47:08
问题 I'm trying to load some images using Bitmap.getBitmapResource() , but it takes about 2 or 3 seconds per image to load. I'm testing on the Storm, specifically. The odd thing is, when I install OS 5.0, the loading goes in a snap, no delay at all. Should I be looking at the format used? Or where the files are stored? I've tried both 24- and 8-bit PNGs, with transparency. The files are stored in a subdirectory in the COD, so getBitmapResource is passed a path, like "images/img1.png" instead of

What image format is fastest for BlackBerry?

陌路散爱 提交于 2019-12-01 22:11:11
I'm trying to load some images using Bitmap.getBitmapResource() , but it takes about 2 or 3 seconds per image to load. I'm testing on the Storm, specifically. The odd thing is, when I install OS 5.0, the loading goes in a snap, no delay at all. Should I be looking at the format used? Or where the files are stored? I've tried both 24- and 8-bit PNGs, with transparency. The files are stored in a subdirectory in the COD, so getBitmapResource is passed a path, like "images/img1.png" instead of just "img1.png". Is any of this making things slower? If you're looking for the most efficient format for

Blackberry - how to start my own service at phone boot-up?

不羁岁月 提交于 2019-11-29 15:52:11
问题 I want to start my own service implementation when the phone starts? How to achieve it? 回答1: You just need to set the "System Module" and "Auto Start" options in the project properties in the blackberry JDE. This will start your app on phone boot. 回答2: Quote from How To - Write safe initialization code An application may need to run once automatically during system start-up to perform initialization routines such as registering listeners and retrieving information from persistent storage.