how to debug android sdk code while debugging my app? - android

I am developing android app for a a couple of months and still in the learning process.
I often feel the need to drill down deeper into code for certain issues that don't make sense to me. For example when I see crashes in apps and the stack trace is shown,, containing SDK classes Looper etc...
So I was wondering if it is possible to debug through sdk code while debugging ?
currently I am writting for platform API 7 and 8. when we download the SDK is the source code SDK source accessible as well ? and if so can we debug it ??
Thanks,

Vogella gives a tutorial on how to do this. It is a plugin. So just click the link.
It is the number 2 in the article.
Let me know if it helped. =)

Related

Simple Android Debug tool

I'm not a developer, so i apologize if I don't phrase the question effectively.
I'm looking for a tool that will help show me what code is being executed as I step through the program. i am not looking to much more than take look under the hood as I test new features & uncover bugs for the new Android app my company is making.
Are there any specific emulators or tools that I could use for this simplistic purpose?
Thanks!
Android Studio has a built-in debugger. See here
There are many ways for to make a debug inside Android Studio.
1-Debug using Logs
2-With logs lines and see on Logcat tool
3-With Breakpoints
and others.
This link its useful for you:
Here

problems in the helloworld app in Eclipse

I am new in developing apps for Android with Java Eclipse.
I get a simple problem: after following the procedure explained here:
http://www.tutorialspoint.com/android/android_hello_world_example.htm
I tried to push the "Finish" button to create my first app, but it doesn't work: the wizard remains open and nothing happens.
Also, I have several problems in the Demo apps, errors like:
'<>' source operator is not allowed for source level
and many more.
I guess I created problems with the configurations.
Thanks if you can help me to create my first app for Android and to load
the demos.
It is really had to tell what is the problem, but as Abdullah advised to use android studio because it is well designed to develop android applications. and most of the company's now days use android studio as there IDE preference, but still its developer's choice. Eclipse ADT plugin is buggy

Many many issues, eclipse, android MediaPlayer, etc

I've recently started android programming, and I'm extremely frustrated to say the least with a lot of things that to me seem simple but are totally holding me back from making any progress. The first of which is the "my first app" hello world that I started a tutorial from http://developer.android.com/training/basics/firstapp/creating-project.html
This tutorial worked fine when I was originally looking into android a while ago. Then when I came back after learning a bunch of java this program will no longer work unless I change the target-sdk to version 10 (I found that solution after extensive searching on this site).
Then I moved on to starting tutorials by thenewboston
All of these work fine as long as I didn't use any new targetsdkversion, so I'm wondering what happened that everywhere I go looking for tutorials I can't find anything that will actually work on the current ADT(4.4W and L are what my eclipse automatically set up) and eclipse (indigo). I'll also get issues saying lint isn't working, or trouble with android SDK content loader when I'm not even doing anything.
I've also found snippets of code example on the developer website that I linked earlier that don't work when implemented either
So, am I missing something, is that just old documentation, or is something up with eclipse and ADT? I'm just so frustrated that everything wants to bug out on me when I'm just trying to follow simple introductory tutorials and I don't even know where to turn for tutorials that I can trust to work..
edit:removed code because it wasn't needed.
To not get blocked What you can do is continue to set "targetVersion as '19'" instead of setting it to 20 or so. Ensure that you've downloaded API19 through SDK Manager and create the AVDs with that targetSDK version for checking you apps.
That way you can proceed ahead with your coding and later when things get resolved by google for API20...you can always comeback to that new version. This way you can follow 'TheNewBoston' and start coding in Android.
I also recommend 'Slidenerd' tutorials over youtube as well for the beginner.
BTW, I've also selected 'Blank Activity / Empty Activity" during the project creation with API19 and been able to move ahead with my coding.
The Google Bug thread about this latest version issue can be tracked here : The google bug
As a beginning developer, I suggest you use API 19. It has been out for a while and is more stable than L or Google Wear.

Show "All Instances" missing in eclipse debug view

few days ago, when I was debugging an Android project under eclipse I've found some great functionality: "All instances..." and "Instance count". I wanted to share my findings with rest of my colleagues, but none of them had this functionality in their eclipse install (we all use eclipse 3.7).
What's even more weird now I'm also missing this functionality.
As far as I can tell this functionality is build within eclipse from version 3.3 and available to projects using Java 1.6 and above as mentioned here and here (we're using 1.6).
See bottom of this link to see what functionality I'm talking about. It even has it's own shortcut in options (ctrl+shift+n) so I think there must be a way to use it again.
I was looking for it while debugging and while the debugger was in "stopped" state.
Anyone can help me put eclipse in right view/perspective/state to see this functionality again?
EDIT
Here is the documentation entry from eclipse help page: link
Thanks for any suggestions,
kajman
After some more digging I came to following conclusion:
DalvikVM does not support "instance retrieval".
On eclipse help page mentioned in EDIT section it written:
This command is only available if the Java virtual machine you are currently using supports instance retrieval.
Maybe there is an option to enable this option in DalvikVM, but I doubt it unfortunately.
Also when debugging on phone "Drop to frame" functionality is missing.

How does android source code work?

I have download a set of android source code, which has folders such as "bionic, bootable, build, dalvik, development, frameworks, hadware, packages, prebuilt" and so on. When I browse the whole code, wonder how "import android.preference.PreferenceActivity;" works in Settings.java(D:\android-srce\Google-source\packages\apps\Settings\src\com\android\settings\Settings.java). I guess there is a android.jar file somewhere after compilation. But how does Settings.java import PreferenceActivity correctly?? I'm a beginner in Android, please help me.
Sounds like you have downloaded the source code to the Android OS. If you want to build your own ROMS then you need to study about building the OS for a particular hardware platform. This is not trivial.
If you want to build an Android app that runs on an Android device then you want to download the SDK instead - start at Android SDK and follow your nose, buy a book, read the sample code.
There is not a lot of information how to change parts of Android. However, you can read information that is connected with the aosp tag. The first cite is source.android.com After the installation of android build system you can see video from marakana group. You'll find a lot of valuable information there.

Categories

Resources