How to debug a blackberry widget? - blackberry

I'm trying to debug a blackberry widget with eclipse but the solution described in this blackberry pdf does not work.
Has anybody debugged a widget for blackberry yet?

Yes I've debugged a complex widget.
One thing I noticed is that to place breakpoints i had to use the default eclipse JavaScript editor. Using JSEclipse editor it didn't work.

Related

debugging rubymotion wrapped web view

I'm trying to debug the webview wrapped by a "native" iOS rubymotion app, but I'm not sure what tools exist to do this. Specifically, I'm trying to debug the CSS and HTML of the application. Is there a way to do this using rubymotion or some other toolkit?
Here is how to do it for Android : https://developer.chrome.com/devtools/docs/remote-debugging#debugging-webviews
I would look for similar on iOS, or perhaps you can use Android for development then convert to iOS.

how to identify path for android using appium

This is for iOS to find all the elements:
driver.findElementsByXPath("//UIAApplication[1]/UIAWindow[1]/UIACollectionView[1]/UIACollectionCell");
I need the similar path for android, I tried:
driver.findElementsByXPath("//android.view.View[1]/android.widget.GridView[1]")
But it's not working. Please help
Please post the log from Appium console, so that we will be able to find out the exact issue.
From :
//android.view.View[1]/android.widget.GridView[1]
It seems there are multiple GridViews are available on that particular screen. Please try to put some constraints.
e.g
//android.view.View[#id='Id_of_the_View']/android.widget.GridView[#something here too]
If you are on a native application, just use the inspector or hierarchy viewer to get the Xpath but I would advise you use driver.findElement(s)ById to get specific elements. Hope this helps.
If you could give a bit more detail maybe I could help.
If you are using Eclipse as editor, then you can open an emulator where you have the app installed, then open DDMS perspective from Eclipse.
Go into your app at the view you want to inspect, and then click the button Dump View Hierarchy for UI Automator in the DDMS perspective.
This will give you a snapshot and you can hover over elements and find their properties.

Disable orientation change for only specific page

I am developing an application with jquerymobile. I want to disable my landscape orientation for only main page not for others. Are there any commands to do this for pages separately instead of manifest file?
For Android, you can use this screen orientation Phonegap plugin in your main page. I've updated the code to be compatible with Phonegap 2.8.0 - you can find the source code in my answer to this question as well my Eclipse project and resulting APK.
There's an equivalent iOS plugin here but I haven't used it and it may need updating for use with the most recent versions of Phonegap.

LWUIT app doesn't start in a Blackberry device

I'm desperate.
I'm developing an app in LWUIT, using the Resource editor. My project works fine in MIDP version, both in simulator and on devices. But when I find my issue when I start to test my app in Blackberry. The app works perfectly in the simulator but doesn't start in the devices. It doesn't give an error message, doesn't say anything. I try to change the UI_RIM.jar with the jars from LWUIT SVN or with the other jar generated from the Resource editor (UI_RIM_Touch.jar), but nothing changes. I don't know if the htttpConnections or FileConnections could be responsible of this issue. I have 2 Blackberry models, Torch and Bold. Does not work on either.
For developing this app, I'm using Netbeans and LWUIT 1.5
If you need to see some code, tell me what you want and I will post it
Thanks
EDIT
Sometimes, I start the app and 30/45 min after appears the next message "uncaught exception thrown in midlet constructor: userclasses.MainMIDlet". I don't know what is the problem.
RIM is hell to work with, I feel your pain... Codename One will help on that regard.
In general this sounds like one of the following:
You created a MIDlet instead of a UiApplication. Make sure your class derives UiApplication and has a public static void main(String[] args) method which initializes the class. Also make sure that the class is public!
During compilation you didn't define the application as a cldc application and left it as a MIDlet. We edited the build.xml in the resource editor generated files to invoke the proper version.
You compiled with a JDE that is newer than the target device.
Check in the alt-lglg log to see if you have any errors or messages.

BlackBerry on-device debugging does not show string values

On simple button click in BlackBerry I am writing this:
String str = "xyz";
labelField.setText(str);
When I debug the code, under the "Variables" window I cannot see value of 'str' as 'xyz' -- it is showing value of str equal to null and when I click over it, it is showing this message:
Method "toString" with signature "()Ljava/lang/String; is not applicable on this object
though the code is working fine.
What is the problem in debug mode?
Hey guys I think I have the solution for you.
Since I was having the same problem and was looking arround to find some answers (and didn't find any) I tried to just solve it by the trial-error method.
To cut the long story short: Check if you accidently have deleted your emulator *.debug files. For example I've had deleted mine (don't ask why :) ), so after I restored the whole simulator folder within the RIM JDE I've tried to debug again and voila - I could now see the values of the variables.
This is the location of the simulator folder within my BB JDE Eclipse Plugin (The standalone version that contains eclipse itself). The used BB JDE is 4.5.0 but the same folder structure is found on any JDE version.
C:\Users\GDimitrov\Documents\programs\bb_jde_plugin\plugins\net.rim.ejde.componentpack4.5.0_4.5.0.28\components\simulator
And this is the location of the simulator folder for the BB JDE 4.5.0 installed additionally through the BB installer.
C:\Program Files (x86)\RIM\BlackBerry_JDE_4.5.0\simulator
Cheers
Simply add System.out.Println statement there to display message you want.

Resources