Porting lwuit app to Blackberry: Bold 9900 - blackberry

I have been working on porting my lwuit app to Blackberry. It works fine except that when tested in Bold 9900 Blackberry, touch event is not happening. The buttons, list etc gets focus but touch event is not triggered. I am using Blackberry JDE 5.0 and LWUIT 1.5-->UI_RIM_Touch.jar from the SVN to deploy my app. Where am I going wrong?

You need to work with preprocessor statements - this code work with simulator.
In additional you need to do two things:
press right click on your project->Properties->Ablities->Add-> in ability name insert name like touch.
in code, in case that you want that your device react specific to touch you need to do something like that:
//#ifdef touch
.....
//#else
//# .....
//#endif

Related

emulating touch events for Chrome - is there a better way?

I'm using Chrome with source maps for debugging a GWT-based app. It's very nice. What I want to do now is have Chrome pretend to be a mobile device. I turned on "emulate touch events", but it seems that the mouse events are still being generated as well. What I was hoping for would be that the browser would act more or less exactly like a mobile browser. I can run my code in XCode's iOS simulator, but can't debug it easily. Thoughts? Thanks.
Are you sure that a real touch device doesn't also send mouse events when a touch occurs?
If you test this, I'm certain you'll find that a real touch device actually generates some mouse events when a tap or touch start/move/end occurs. Take a look at https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Events/Touch_events to see how to avoid generating mouse events, at least on real touch devices... it may not work in chrome, but you have to at least start there.

Blackberry Disappearing Icon

Has anyone experienced this before?
Whenever I install my app in a 9900 device, the icon appears to be fine, but after a while (it happens in random), the icon just turns into a blank question mark icon (like I never added an icon when I built the app). I've tested it on a 9700 device and it appears to be okay, I've installed it in the 9700 for several days now and the icon doesn't disappear.
I wrote my BlackBerry Java app using Eclipse Indigo with the Blackberry plugin, and added my icon using the BlackBerry App Descriptor editor. I followed the usual step of adding the icon by clicking the "Add" in the Icon Files section and browse my PNG file in res/img/icon.png. I have a 64x48 png file. I'm building it using the Eclipse BB 5.0 plugin.
I don't know what I'm doing wrong.
Thanks in advance.
I had a similar problem, whenever I load a project on my device for testing (my simulator doesn't work for some reason) my icon goes back to the default one instead of using my own icon. I saw from a another post that if you refresh the img folder under res, and then load the project onto your device, it will appear (although this did not work for me, but it may for you).
I just reset my device by pulling out the battery and my custom icon appears.
Seems that it is a bug in the particular RIM OS version. To overcome this, use application descriptor with icon set as you do and set the icon explicitly in your application.
There's a HomeScreen class in RIM API. Use it and invoke its method:
public static final void updateIcon(Bitmap newIcon)
to set the icon again when your application starts. To access correctly the icon file included to your project, check this post. I described there how does blackberry work with embedded files.
To avoid UI event locking upon setting application icon, use invokeLater() approach, like that:
UiApplication.
getUiApplication().
invokeLater(
new Runnable() {
public void run() {
// set app icon here
}
});

Flex 4.6 TextInput Keyboard on iOS

I have migrated my app from Flex 4.5.1 to Flex 4.6 and the TextInput click event was broken so I do this « skinClass="spark.skins.mobile.TextInputSkin" » (like was suggest here http://help.adobe.com/en_US/flex/mobileapps/WS82181550ec4a666a39bafe0312d9a274c00-8000.html) and all seems work (tested in my Android and seems ok) but one user with iOS 5.1 complained that now the keyboard dont popup ?
Also complained for the TextArea that I dont have code in my extended component but also use the skin spark.skins.mobile.TextAreaSkin so the layout became similiar in my textinputs.
TextInput is broken in Flex 4.6
It doesn't scroll properly when default TextStageSkin is used
It causes some ugly artifacts when the TextStageSkin is used and keyboard resizes the view:
ugly flex TextInput bugs
It doesn't show proper keyboard type when TextInputSkin is used and softKeyboardType is set to something...
My guess this is a bug in AIR SDK, as there is noting in Flex SDK source which looks like it can be corrected. They gave us an SDK where none of the skins works properly. I hope Apache Flex will be much more mature. But again, this looks like an AIR issue to me.
GL.
Well, I had the opportunity to test a iPad 2 and using the TextInput with skin spark.skins.mobile.TextInputSkin, the events of flex works but does not open the keypad in iOS and with skin (stagetext new skin), keypad open in iOS (and with native access to spell check, etc ...) but do not run flex events. Since we do not need both situations simultaneously works (which fortunately it's my case for now).

BlackBerry issue with Textfields in OS6

I'm developing a BlackBerry app and using J2ME Polish to do the styling. So, I'm using TextFields with styling from Polish to get user input.
The TextFields work fine in OS versions other than 6. But when testing on devices running OS 6, the Textfields break.
Basically in other versions of the OS, when focus is on a TextField then the left and right buttons move the cursor around in the TextField and up and down moves focus to the next/previous item. However, in OS6 up and down instead navigate to the beginning and end of the TextField respectively and focus gets stuck so I'm not able to move focus to the next item.
As a workaround I tried to capture the down button using handleKeyReleased, but when focus is on the TextField the down button isn't even being captured.
Does anyone know of any other way to solve this?
Issue resolved by explicitly using the BlackBerry JDE version 6 to build the app.

Using MIDP Canvas keyPressed / keyCode on BlackBerry to get Canvas.FIRE for trackball click

I have a MIDP application that I would like to run on BlackBerry devices. It's quite generic, the one gotcha is that when I override the Canvas keyPressed(int keyCode) method, I'm not capturing the trackpad click events.
Normally you would use getGameAction(keyCode) == FIRE to capture the center of the navigation pad button on MIDP devices, but in this case no luck. I've done extensive searching of blackberry forums and I can't find any clear solution. Is they keyPressed method even called when the trackball button is clicked? What is the appropriate keyCode?
I know that if I move over the BlackBerry SDK I can use key listeners and trackpad clicked type events, but I would like to first attempt to find a solution that is pure MIDP and does not require multiple builds.
According to the RIM javadoc for the Canvas class the trackball keycode is -8. That's a JDE 4.5 link, but it's the same in 4.3, 4.6 and 4.7. So you could put in some conditional behaviour for BlackBerry handsets that would look for that code.

Resources