Android :: How To Reach The Sub Activity Code In Debug Mode
Jul 25, 2010
I have a activity B that is called by activity A, I want to debug the code in B. I have set the breakpoint, however the debug control never enters B.
When I debug in eclipse, although the class B is called from class A, the debbugger pointer never enters the new window, where I have placed a debug point in Class B. I am not able to take the pointer control to class B and stop at a specific point, which will help me verify certain variable values.
I have a ZEN ultrafone 701 HD (MTK 6589) device with HD screen.
Things were going fine when this Fine day I got a bright idea to change ROM.
I have a rooted Phone with working CWM, so went into recovery and cleared data/cache/dalvik cache,battery log etc.
Then I did a epic goof up by clicking on the ROM file of a different device to install as ZIP from CWM . by the time i realized, it was too late Now the phone boots up, shows logo and reboots,again and again. a previously working key combination to bring diagnostic mode is now not working.
The phone starts up and reboots so fast the PC cannot detect the device in adb mode. perfect aint it ?
I've got some trouble with the media backend (mostly Stagefrightplayer) in Android, and I'd like to understand why it throws the errors it does. The errors are usually device spesific, so debugging on an emulator wouldn't be sufficient.
I've also gotten the player to bork completely and spit out a traces.txt.
Is there a way to debug what's happening, just like I debug Java code?
I am programming Android applications, and the best way here may or may not be the same as Java in general.I simply want to be able to set a debug flag that will only execute certain portions of code when it's set to true equiv to C++ setting a preprocessor #define DEBUG and using #ifdef DEBUG.Is there an accepted or best way to accomplish this in Java?
Right now I'm just going to set a variable in my Application object, but I don't imagine this is the best way.
I have a brand new Galaxy Tab that I am trying to use for some development. However, the usual method of installing the ADB driver isn't working on my Win 7 x64 version. (I have even tried the USBDeview method of deleting everything that looks like an Android device.)
Has anyone out there gotten this to work? If so, what did you have to do?
I'm trying to figure out a way to programmatically determine if my build was built in debug mode vs. release mode. I'd like to hide some items in my settings screen if it's release. When I build my app in Eclipse I'm building by default in Debug mode. However, when I build the app using the command line, I build it in release mode and sign the app using the jarsigner tool.
I've tried using: PackageInfo appInfo = manager.getPackageInfo("com.adobe.psmobile", PackageManager.GET_SIGNATURES); to test if appInfo.signatures.toCharsString() matches my debug signature and that didn't seem to work.
I'm now trying to see if I can introspect the app's KeyStore, to match the default debug alias described here: http://developer.android.com/guide/publishing/app-signing.html of "androiddebugkey" but I haven't figured out how to retrieve the app's KeyStore yet.
my android application runs in debug mode only even if i click the run button of the eclipse or run it by touching on its icon on the device. what will be reason for this?? anybody has any idea about it?
When I debug android app, if I work with Java, I can use Log.d("TAG", "xxxx", new Throwable()) to print backtrace of Java code. This is really handy for me to find bugs. But when I work with native library (e.g. libwebcore.so), there seems no way to print backtrace in runtime. The only way to debug native code is use gdbserver.
I have a question: Is there any way to print backtrace in C/C++?
Fellow droid incredible users, I am trying to root my phone with unprovoked and i have the 2.2 system on my htc incredible. I'm unable to find "debug mode" in the settings and i need it on to apply the unprovoked root. Please help me find debug mode.
In Ubuntu, I have double checked the udev rules. They all look perfect. (I cross checked using another phone too). The USB debug mode doesn't show up no matter what. And I have the adb_usb.ini in the right place. I have tried running all possible combinations of running adb, adb start-server as root. But
adb devices shows no devices at all.
However, with the USB debugging option enabled on phone, it worked on Win7 after windows installed a Common handset driver.
If I go back to Ubuntu without disconnecting the cable and do
Code: $ adb devices * daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attached 1234567890ABCDEFdevice
The product id is 1234567890ABCDEF and I am able to see it and everthing works fine!!But the moment I disconnect the USB cable, its gone.
So I guess it's not the development machine that is at fault. The device seems to be setting a property while in Windows which stays latched till the usb connection goes off.
Btw the Code:
/data/property/persist.service.adb.enable is 1 too.
I have an android application that parses some HTML, downloads an image, and displays it. I'm using an AsyncTask to do the HTML parsing and image downloading, but that shouldn't be relevant. I never have a problem when I'm on WiFi on my phone, when I'm using the Eclipse debugger on my phone, or when I'm using the emulator. When I have my phone on the cell network (even with pretty good reception), the image sometimes fails to display. I'm having a hard time figuring out what is wrong, since the problem cannot be reproduced in the debugger. Does anyone have any idea what could be wrong?
Update: I have narrowed it down to the image downloading function. This way my original code:.......................
I am trying to following this documentation 'http://source.android.com/using-eclipse' to debug android Launcher Activity in eclipse.
It said' You may need to open the Debug perspective (next to the "Java" perspective icon in the upper-right, click the small "Open Perspective" icon and select "Debug"). Once you do, you should see a list of threads; if you select one and break it (by clicking the "pause" icon), it should show the stack trace, source file, and line where execution is at. Breakpoints and whatnot should all work.
My question is which threads I need to select in order to debug Launcher Activity? I don't see a thread name Launcher.
I have a completely broken screen/lcd/digitizer on my Samsung Galaxy S3, debug mode was not on. The phone works as it will still vibrate when turned on and the LED / Menu / Back buttons light up during a boot. USB connector works as well. The phone was not previously rooted.
I had most important data on the sd card and I've already wrote off any other data on the phone as I've since moved on to a GN2. I would like to make use of the S3 (not necessarily as a phone but a server, security camera, etc.). I've read several posts here about my options and looked at numerous google articles, all seem to require debug mode being on or assume/require the data/OS must remain as this is what the user is trying to recover. I do not care if all data is lost on the phone, I just want to make the device useful again.
Am I out of luck if debug mode was not enabled or can I flash through adb via some obscure mechanism? Also note that fastboot is not an option here as the S3 (samsung) does not have it enabled. I am unable to get into "Download Mode" as I cannot see info on the screen.
I have a problem to start/create Activity in landscape mode. My Activity need to start in landscape mode and be used in landscape mode by users. So far, I used setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) to force screen orientation of my Activity to landscape mode in onCreate() method.
In addition to this screen mode requirement, my application need to start another background thread in onResume() method, and this thread takes some seconds in order to finish an initialization process, and it is not desirable to to stop/restart this thread's service during the initialization process.
However setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) forces my Activity restart in a very little while (means onCreate->onResume->onPause->onStop are executed twice at the first place). As a result, my background thread be stopped/restarted during the initialization process, and this makes me a mess at this moment.
I enabled debug mode in the native browser to change the UA String. I typed in "about:debug" in the address bar. I then went into settings and changed the UAString to 'Desktop.' Now, every time I open the browser = force close. Yes, I tried rebooting. What are my options?
I have a brand new Nexus One. I'm trying to follow the directions for installing the USB driver. When I plug in the device, it doesn't start the New Hardware Wizard, as the documentation suggests. I can run hdwwiz.exe to launch it and manually install the driver, but when I do, Device Manager says: "This device cannot start. (Code 10)"
I'm trying to debug my native JNI code located on a shared library. I have been trying to debug using gdb/gdbserver.
Here is how I go about, trying to debug:
How to debug JNI native code on the Android emulator I'm using gdb/gdbserver I do this at the emulator terminal gdbserver localhost:
when I step on the Android Java code so the function Java_testJNI_printHello is called, I get this error on the server side gdb: Unable to get location for thread creation breakpoint: requested event is not supported
Is there a good way (proper way, or effective way) to debug slow running code? I have a thread which runs multiple loops and then recurses and my code is running very slow. Is there a good way to debug different loops or sections of code to find out which is running slowest?