BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-18-2009, 10:49 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2009
Location: Belarus, Minsk
Model: none
PIN: N/A
Carrier: none
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with System.out.println()

Please Login to Remove!

I want to see some messages in console while my application works. But System.out.println(); has no effect. Not right command? Or maybe i have to set console as output stream?

P.S. Sorry for grammar errors)
Offline  
Old 06-18-2009, 11:22 AM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

I can vouch for System.out.println - it works on the JDE with the simulator, or attached to the device in debug mode.

Can you give some more info?
Offline  
Old 06-18-2009, 11:32 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: Feb 2009
Location: CANADA
Model: 9000
PIN: N/A
Carrier: Rogers
Posts: 64
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Morion View Post
...System.out.println(); has no effect...
Did you try debug it and absolutely sure that println() was executed?
...
P.S. no excuse for grammar errors in spell checkers era
Offline  
Old 06-18-2009, 11:38 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2009
Location: Belarus, Minsk
Model: none
PIN: N/A
Carrier: none
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

My application connects to the site, dowloads info, parses it. But i cannot show this info on the screen of simulator. So i want to see some messages in console. But in debug mode strings with System.out.println(); are ignored. Debugger skips them.
Offline  
Old 06-18-2009, 12:08 PM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Sorry, but I use this all the time for debugging on-device. The System.out.println() messages are not skipped. You've got something else going on there.

Follow these steps:

1. Build the app
2. Sign the app
3. Upload to the device using javaloader -u load [myprogram.cod]
4. In the JDE, select Debug / Attach to Handheld

If you do another build after uploading to the device, the debugger can get out of sync with the code on the device and you'll have all sorts of issues.

If you follow these steps, your println() statements will show up in the JDE output console window.
Offline  
Old 06-18-2009, 12:40 PM   #6 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2009
Location: Belarus, Minsk
Model: none
PIN: N/A
Carrier: none
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mmm... Simple example. Here's my main class.
Code:
public class ReadWebPageContents extends UiApplication 
{
	public static void main(String [] args)
	{
		System.out.println("Start!!!!!");
		ReadWebPageContents newApp = new ReadWebPageContents();
		newApp.enterEventDispatcher();
	}
	
	public ReadWebPageContents()
	{
		ReadWebPageContentsScreen readWebPageContentsScreen = new ReadWebPageContentsScreen();
		pushScreen(readWebPageContentsScreen);
	}
}
There is a breakpoint on string System.out.println("Start!!!!!");
I start debugger. It stops and points to this string. I press "Step over" button. Pointer moves to the next line. But there is no changes in console. But at the same time in the window with variables appears newApp as the line with creating newApp was execute instead.
Offline  
Old 06-18-2009, 01:24 PM   #7 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Simulator, or device?

Eclipse, or JDE?
Offline  
Old 06-19-2009, 12:22 AM   #8 (permalink)
New Member
 
Join Date: Jan 2008
Model: 9530
PIN: N/A
Carrier: Verizon
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

wow, println has always helped me out. are you consulting to output window, or are you looking for statements on the actual device? println by no means will print to the devices screen.
__________________
My Dev Site: Roboconn.com Get my new OTA apps and games, some free -some not. BB friendly.
Offline  
Old 06-22-2009, 02:57 AM   #9 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2009
Location: Belarus, Minsk
Model: none
PIN: N/A
Carrier: none
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Dougsg38p View Post
Simulator, or device?

Eclipse, or JDE?
Simulator. Eclipse.
Offline  
Old 06-22-2009, 03:13 AM   #10 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2009
Location: Belarus, Minsk
Model: none
PIN: N/A
Carrier: none
Posts: 17
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am shocked... I've just create new project... Insert my classes... And program works correctly now... I tried to find any bug for a few days(
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.