aspose file tools*
The moose likes Android and the fly likes It doesn't provide me expected output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "It doesn Watch "It doesn New topic
Author

It doesn't provide me expected output

sam liya
Ranch Hand

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


this is string.xml



below is screenshot of my project


[Thumbnail for project.jpg]

sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1223
this is the output i am getting.but i am expecting a screen with some buttons.where is the error?


[Thumbnail for output.jpg]

Ulf Dittmer
Marshal

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


Ping & DNS - my free Android networking tools app
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10523
    
    9

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


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1223
I select Sudoko java file & select Run from drop down.
below are the screenshots.


[Thumbnail for SelectSudoku.jpg]

[Thumbnail for Run.jpg]

sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1223
here is the consol output
sam liya
Ranch Hand

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

Joined: Jul 26, 2007
Posts: 10523
    
    9

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: 629

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.....
sam liya
Ranch Hand

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

I have attached a screenshot.can you show me where to click?


[Thumbnail for logcat.jpg]

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10523
    
    9

Window->Show View->Other->Android->LogCat
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1223
i run the project again.but logcat doesn't show anything ?


[Thumbnail for ok.jpg]

[Thumbnail for no.jpg]

Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

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 )
sam liya
Ranch Hand

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

Joined: Jul 15, 2008
Posts: 629

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