blackberry

Blackberry Field alignment in a VerticalFieldManager

别来无恙 提交于 2019-12-13 18:06:43
问题 I want to add two fields in a vertical field manager. I want the first one to be align on the left and the second one (on the second line) on the right. 回答1: You can use the style argument of the field constructor to specify alignment, both horizontal and vertical. VerticalFieldManager titlevfm = new VerticalFieldManager(); LabelField leftField = new LabelField("my label", Field.FIELD_LEFT); LabelField rightField = new LabelField("right field", Field.FIELD_RIGHT); titlevfm.add(leftField);

Layout a Manager with USE_ALL_HEIGHT style without overriding sublayout() in BlackBerry

左心房为你撑大大i 提交于 2019-12-13 17:48:04
问题 I want to layout three VerticalFieldManager in a screen with NO_VERTICAL_SCROLL . One manager should be aligned to TOP, one should be aligned to BOTTOM and the last one should consume the rest of the height between the former two. Can it be achieved without overriding sublaout() for any Manager? The result I want to achieve is: I layouted this screen with the following code. The problem is that I wasn't able to do it without overriding sublayout(). public class LayoutSandboxScreen extends

Blackberry - getLocation() method cannot be called from event thread

守給你的承諾、 提交于 2019-12-13 16:14:30
问题 I want to get the longitude and latitude of device. I used location api to get the longtitude and latitude the problem now I am facing is that I could not call the getLocation() method inside button click event. It throws an error as getLocation() method cannot be called from event thread.Can any one tell me how to solve this problem? 回答1: You simply create another thread and call getLocation() from that thread. See the documentation for java.lang.Thread in the API documentation. 来源: https:/

Eclipse Blackberry Preprocessor Not Working?

为君一笑 提交于 2019-12-13 14:17:57
问题 I've already followed the directions @ Using preprocessor directives in BlackBerry JDE plugin for eclipse? for making sure the blackberry plugin preprocessing hook is (theoretically) enabled. I'm using Eclipse 3.5.1 with Blackberry Plugin 1.1 with BB SDKs 4.7.0 and 4.6.0. I have my preprocessor defines set (and I've tried in both the Project's Blackberry Properties as well as the Workspace Blackberry Build settings), and checked their capitalization and spelling carefully too. I'm fairly

Blackberry HTTP Connection Issue

▼魔方 西西 提交于 2019-12-13 12:50:39
问题 I have a simple app written the connects to web service (restful). The app works fine on the blackberry simulator however I'm having problems using it on a blackberry 9300. I keep getting the error "java.io.ioexception: tunnel down" when the apps attempts to call the web service. The service I am calling is a simple HTTP post and I'm trying to run this over WIFI (the WIFI connection is working fine for browsing the internet). I'm using a connection string of "http://127.0.0.1:8080/test/restws

BouncyCastle J2ME RSA using custom keys

梦想的初衷 提交于 2019-12-13 12:42:34
问题 I would like to use BouncyCastle J2ME/RIM Crypto in my Blackberry Application. The issue i'm having is that I would like to generate the public key for encryption from a C#.NET program that sends the key to the BlackBerry. Is it possible to encrypt a message using a raw string? Also, do I need to know other common variable such as modulo etc? Apologies but i'm completely new to cryptography algorithms. Do I need BouncyCastle for this or can the above be done with RIM Crypto? Thanks, Conor 回答1

@ validation for email in BlackBerry

徘徊边缘 提交于 2019-12-13 10:52:37
问题 I am developing a form where the user needs to enter a valid email. He/she will use it as a loginid to play the game.I want to know how can I validate the username containing @, similar to string.contains function. I learnt we can use string.indexOf() but it is not supporting "@". Kindly suggest how do I carry out this validation. When the email editfield loses focus, the username must be checked to see if it contains "@" or not. 回答1: Use EmailAddressEditField.. here is the way

Number format exception while parsing the date to long

依然范特西╮ 提交于 2019-12-13 10:45:34
问题 I'm getting a NumberFormatException while executing the below statements. Calendar cal = Calendar.getInstance(); int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONTH); int day_of_month = 15; long m_time = Long.parseLong((month + 1) + "/" + day_of_month + "/" + year); and long m_time = Long.parseLong(String.valueOf((month + 1) + "/" + day_of_month + "/" + year)); 回答1: The reason for the NumberFormatException is cause you are trying to parseLong a String that is not a valid

Blackberry json parser

心不动则不痛 提交于 2019-12-13 08:26:14
问题 I want to create a simple json parser for BlackBerry to test. I found this example, and implement my code as follows import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.util.Vector; import javax.microedition.io.Connector; import javax.microedition.io.HttpConnection; import org.json.me.JSONArray; import org.json.me.JSONObject; import net.rim.device.api.ui.component.Dialog; import net.rim.device.api.ui.container.MainScreen; public final class MyScreen extends

Why i got net.rim.device.api.system.ControlledAccessException in blackberry os 5?

徘徊边缘 提交于 2019-12-13 08:01:53
问题 I am using ToDo List in my app.It is working fine in simulator but it gives me error in blackberry Strom 9550 like this : net.rim.device.api.system.ControlledAccessException Plz help me to solve this error. 回答1: Have you checked the app permissions? The simulator gives access to most by default, actual devices do not. I've also ran into a problem in the past where you might get past it by redeploying a couple times (while the app is running), and occasionally had to uninstall and reboot. 来源: