Search Results

Search found 3 results on 1 pages for 'skrud'.

Page 1/1 | 1 

  • Code Coverage tool for BlackBerry

    - by Skrud
    I'm looking for a code coverage tool that I can use with a BlackBerry application. I'm using J2ME-Unit for Unit Testing and I want to see how much of my code is being covered by my tests. I've tried using Cobertura for J2ME but after days of wrestling with it I failed to get any results from it. (I believe that the instrumentation is un-done by the RAPC compilation). And despite this message, the project seems to be dead. I've looked at JInjector but the project seems very incomplete. There is little (if any) documentation and although it claims to be able to work with BlackBerry projects, I haven't seen any places where it has been used for that purpose. I've played with the project quite a bit but to no avail. I've also tried the "Coverage" view in the BlackBerry JDE, even though I use Eclipse for development. The view stays permanently blank, regardless of clicking "Refresh" and running the application from the JDE. I've looked at most of the tools on this SO thread, but they won't work with J2ME/BlackBerry projects. Has anyone had any success with any code coverage tools on the BlackBerry? If so, what tools have you used? How have you used them? If anyone has managed to get JInjector or Cobertura for J2ME to work with a BlackBerry project, what did you have to do to get it working?

    Read the article

  • How to figure out which key was pressed on a BlackBerry

    - by Skrud
    What I want: To know when the user has pressed the button that has the number '2' on it, for example. I don't care whether "Alt" or "Shift" has been pressed. The user has pressed a button, and I want to evaluate whether this button has '2' printed on it. Naturally, if I switch devices this key will change. On a Bold 9700/9500 this is the 'E' key. On a Pearl, this is the 'T'/'Y' key. I've managed to get this working in what appears to be a roundabout way, by looking up the keycode of the '2' character with the ALT button enabled and using Keypad.key() to get the actual button: // figure out which key the '2' is on: final int BUTTON_2_KEY = Keypad.key(KeypadUtil.getKeyCode('2', KeypadListener.STATUS_ALT, KeypadUtil.MODE_EN_LOCALE)); protected boolean keyDown(int keycode, int time) { int key = Keypad.key(keycode); if ( key == BUTTON_2_KEY ) { // do something return true; } return super.keyDown(keycode,time); } I can't help but wonder if there is a better way to do this. I've looked at the constants defined in KeypadListener and Keypad but I can't find any constants mapped to the actual buttons on the device. Would any more experienced BlackBerry devs care to lend a helping hand? Thanks!

    Read the article

  • How do I ignore the UTF-8 Byte Order Marker in String comparisons?

    - by Skrud
    I'm having a problem comparing strings in a Unit Test in C# 4.0 using Visual Studio 2010. This same test case works properly in Visual Studio 2008 (with C# 3.5). Here's the relevant code snippet: byte[] rawData = GetData(); string data = Encoding.UTF8.GetString(rawData); Assert.AreEqual("Constant", data, false, CultureInfo.InvariantCulture); While debugging this test, the data string appears to the naked eye to contain exactly the same string as the literal. When I called data.ToCharArray(), I noticed that the first byte of the string data is the value 65279 which is the UTF-8 Byte Order Marker. What I don't understand is why Encoding.UTF8.GetString() keeps this byte around. How do I get Encoding.UTF8.GetString() to not put the Byte Order Marker in the resulting string?

    Read the article

1