Programming/Non programming

Sunday, February 21, 2010

Android: How do we see logs in Eclipse?

Android:
How do we see logs in Eclipse?

1. We need to add Log.d or Log.v etc to the source code to print the logs.

For ex:
Log.d("Portfolio:", "getParsedOutput:" + getParsedOutput); // here getParsedOutput is a string.

2. Go to Eclipse "Window (menu)->Show View->choose Other -> Android -> LogCat.

You can see the LogCat added in your project now in the bottom.
Otherwise Choose DDMS, where-in you choose Simulator/Device where you can see the logs printed.


Thank you for followers!

Cheers,

M.P.Prabakar
Senior Systems Analyst.

Have fun and be addictive by playing "TossRing" marvelous iPhone game. Link is below..

Android: Source not found problem?

Android:

When you debug your code, you may find "Source not found" (or) 'The JAR of this class file belongs to 'Android 1.1 which does not allow modifications to source attachments on its entities' etc. message.
Basically this problem is due to Android sources are not included in Eclipse.

To resolve it,

1. Easy method would be following the below link:

http://android.opensourceror.org/2010/01/18/android-source/

i) Download which version of SDK that you have. For ex: Donut means Android 1.6
ii) Create a folder called "source" For ex: sdk/platforms/android-1.5/sources
iii) Right click and refresh your project in Eclipse.
iv) click Run-Debug History
You will find still the same problem..like you will see message as 'Source not found' with Edit source path button.
v) Click on Edit source path button and click 'Add' button.
vi) Choose 'library system path' and choose your 'source' folder there.

Now go ahead and debug again.


Thank you for followers!

Cheers,

M.P.Prabakar
Senior Systems Analyst.

Have fun and be addictive by playing "TossRing" marvelous iPhone game. Link is below..

How to debug Android projects in Eclipse?

How to debug Android projects in Eclipse?

Mac OS X eclipse setup:

It is very simple. But why i write and keep like this is because when i'm new to Android project development using Eclipse, i didn't know how to debug the code. I searched for sometime and found that, "Run -> Debug History -> " is the best one to debug the code in Eclipse.

Windows eclipse setup:

If you want to Debugging on Windows environment, you need to add the following line in AndroidManifest file for application.
android:debuggable="true" to the element

Thank you for followers!

Cheers,

M.P.Prabakar
Senior Systems Analyst.

Have fun and be addictive by playing "TossRing" marvelous iPhone game. Link is below..