IntelliJ Java IDE
The moose likes Android and the fly likes It doesn't provide me expected output Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Mobile » Android
Reply Bookmark "It doesn Watch "It doesn New topic
Author

It doesn't provide me expected output

sameera liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 597
this is my main.xml file


this is string.xml



below is screenshot of my project
[Thumb - project.jpg]
 Filename project.jpg [Disk] Download
 Description
 Filesize 263 Kbytes
 Downloaded:  4 time(s)

sameera liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 597
this is the output i am getting.but i am expecting a screen with some buttons.where is the error?
[Thumb - output.jpg]
 Filename output.jpg [Disk] Download
 Description
 Filesize 251 Kbytes
 Downloaded:  4 time(s)

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 32769
That's the emulator home screen; how are you trying to run the application? What's in the logcat output while you do that?


Android appsImageJ pluginsJava web charts
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 7602

I remember getting goofed up with this.
Notice the "Lock" icon. You need to drag it to the right hand side to "unlock" the phone. If coded correctly, you will see your app there


[Donate a pint, save a life!] [How to ask questions]
sameera liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 597
I select Sudoko java file & select Run from drop down.
below are the screenshots.
[Thumb - SelectSudoku.jpg]
 Filename SelectSudoku.jpg [Disk] Download
 Description
 Filesize 269 Kbytes
 Downloaded:  4 time(s)

[Thumb - Run.jpg]
 Filename Run.jpg [Disk] Download
 Description
 Filesize 271 Kbytes
 Downloaded:  4 time(s)

sameera liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 597
here is the consol output
sameera liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 597
"Maneesh " what do you mean lock icon ?
can you explain ?
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 7602

The android emulator screenshot you provided. At the bottom you can see two icons. One is the "lock". The second is the "volume". Slide the lock icon to the right using your mouse to unlock the phone
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 623

As Maneesh told drag it to the right hand side to "unlock" the phone. After unlocking phone you can see the output. Or you can press Menu button to unlock the phone.

And what you had posted is not Logcat output it is consol output. To see console output click on DDMS which is located at top right of eclipse.


Life is easy because we write the source code.....
sameera liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 597
thanks all .it is working now.Anyway what is logcat ?

I have attached a screenshot.can you show me where to click?
[Thumb - logcat.jpg]
 Filename logcat.jpg [Disk] Download
 Description
 Filesize 277 Kbytes
 Downloaded:  3 time(s)

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 7602

Window->Show View->Other->Android->LogCat
sameera liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 597
i run the project again.but logcat doesn't show anything ?
[Thumb - ok.jpg]
 Filename ok.jpg [Disk] Download
 Description
 Filesize 220 Kbytes
 Downloaded:  3 time(s)

[Thumb - no.jpg]
 Filename no.jpg [Disk] Download
 Description
 Filesize 248 Kbytes
 Downloaded:  4 time(s)

Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 623

Ok. Do one thing on the top right side of eclipse there is icon of "open perspective" (to the just left of Java) Click on that. Then select DDMS. Then If device contain your emulator name then click on that (just one click) If focus come on that then again look at Logcat you will get Logcat output.

To go to the .java files then click on Java (again top right of eclipse )
sameera liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 597
ya,i got it.anyway what can we get from these thisng
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 623

At last you got it

Using logcat output you can trace flow of your application by inserting System.out.println (""); statement.

Try inserting some statement in onCreate () method and in some other method. so you know that first onCreate statement execute first when you run your application. You can also use it for checking variables value at runtime.
 
 
subject: It doesn't provide me expected output
 
Threads others viewed
list view problem
ListView textColor
when i change android:orientation to horizontal it shows blank screen
how to add a scrollbar to a view
Layouts, bottom position
developer file tools