How to debug web page on device?

by Jonas Bengtsson » Wed, 08 Sep 2010 08:54:14 GMT


Sponsored Links
 Hi all,

There's a third party web page which renders fine in the emulator and 
some Android devices. However, it doesn't look as intended on my Galaxy 
S. The page is almost only JavaScript so it's hard to know what's going 
wrong by just looking at the source. I get the same error in the browser 
as I get in a WebView in my app. I haven't been able to reproduce the 
error in any other environment than on my phone.


How do people debug these kind of things? I'm looking for something 
similar to "Developer Tools" in Chrome. If I at least could dump the 
state of the DOM that would help a lot.


Apparently getting access to a WebView's DOM from Java isn't currently 
supported [1], otherwise that would do.


Any suggestions out there?

Thanks in advance,
 Jonas


[1]  http://code.google.com/p/android/issues/detail?id=368 

--



How to debug web page on device?

by Jonas Bengtsson » Thu, 09 Sep 2010 08:12:28 GMT


 (Tried to post this yesterday, but don't think it made it. Apologies
if you get it twice!)


Hi all,

There's a third party web page which renders fine in the emulator and
some Android devices. However, it doesn't look as intended on my
Galaxy S. The page is almost only JavaScript so it's hard to know
what's going wrong by just looking at the source. I get the same error
in the browser as I get in a WebView in my app. I haven't been able to
reproduce the error in any other environment than on my phone.

How do people debug these kind of things? I'm looking for something
similar to "Developer Tools" in Chrome. If I at least could dump the
state of the DOM that would help a lot.

Apparently getting access to a WebView's DOM from Java isn't currently
supported [1], otherwise that would do.

Any suggestions out there?

Thanks in advance,
 Jonas


[1]  http://code.google.com/p/android/issues/detail?id=368 

--


Sponsored Links


How to debug web page on device?

by Maps.Huge.Info (Maps API Guru) » Thu, 09 Sep 2010 11:44:40 GMT


 Debugging webview can be tricky. A lot of the errors print in the
console. Mostly the problems aren't going to be actual JavaScript
errors if it renders fine in other devices but will be due to some
oddity in the way a particular manufacturer implemented webkit. I've
seen lots of differences in the devices. HTC is particularly odd.
Motorola is particularly good. I haven't dealt with the Samsung
variants yet but I hope they are closer to Motorola than HTC.

One way you can debug webview is to put a function in your app that
logs messages from the webview with JavaScript calls. Then sprinkle
those calls liberally throughout the JavaScript and just monitor what
happens. Look for differences in the way the devices render things.

I use this method and have found it cumbersome but effective. I use a
lot of webview stuff so if someone else knows a better way, I'm all
ears.

-John Coryat

--



How to debug web page on device?

by Ken Perry » Fri, 10 Sep 2010 00:22:15 GMT


 I think you're doing it the same way I am.  I use addJavascriptInterface to
add logging class to any JavaScript I write.  Then I can use the Android
Java log class to write to the log cat.  I tag the logs with the keyword
"javascript" so I get a nice neat list of whatever I want to see.

Ken  

-----Original Message-----
From: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] On Behalf Of Maps.Huge.Info
(Maps API Guru)
Sent: Wednesday, September 08, 2010 11:44 PM
To: Android Developers
Subject: [android-developers] Re: How to debug web page on device?

Debugging webview can be tricky. A lot of the errors print in the
console. Mostly the problems aren't going to be actual JavaScript
errors if it renders fine in other devices but will be due to some
oddity in the way a particular manufacturer implemented webkit. I've
seen lots of differences in the devices. HTC is particularly odd.
Motorola is particularly good. I haven't dealt with the Samsung
variants yet but I hope they are closer to Motorola than HTC.

One way you can debug webview is to put a function in your app that
logs messages from the webview with JavaScript calls. Then sprinkle
those calls liberally throughout the JavaScript and just monitor what
happens. Look for differences in the way the devices render things.

I use this method and have found it cumbersome but effective. I use a
lot of webview stuff so if someone else knows a better way, I'm all
ears.

-John Coryat

--



Other Threads

1. Anyone able to get streetview working?

Is anyone able to get streetview working?

i was able to start the streetview map but the map wont display and
gave an error that says 'invalid panorama'

The only documentation about street view i can found is
http://code.google.com/android/reference/available-intents.html

    private static final String STREET_VIEW_FORMAT =
"google.streetview:cbll={0},{1}&cbp=1,0,-20,1.0&mz=test";

            GeoPoint pt = listing.getGeopoint();
            Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(
                    MessageFormat.format(STREET_VIEW_FORMAT,
pt.getLatitudeE6()/1000000f, pt.getLongitudeE6()/1000000f)));
            startActivityForResult(i, RESULT_OK);
--~--~---------~--~----~------------~-------~--~----~

2. ArrayAdapter

How does the ArrayAdapter know when the array has been modified? I am
using my own adapter, and I want to add items as they come in while
asynchronously updating the ListView displaying them.
--~--~---------~--~----~------------~-------~--~----~

3. How to measure the Bytes sent and received through the 3G network

4. get position of cursor in EditText

5. commons logging - android logging

6. Do you know the Android Developers

7. Extract some information from an APK file