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. Help hero ngehang

Sent from my BlackBerry
powered by Sinyal Kuat INDOSAT

-- 
"Indonesian Android Community [id-android]" 

2. is there a way to get a view to the front?

Hi,

I have a root view (LinearLayout) and a bunch of views placed on top
of it. Now, I would like to change the brightness of all views, let's
say to 50%.

Instead of changing the color of each view individually, it would be
so much nicer if I could just place a view on top of all views,
covering the whole screen and acting like a filter. If this top-view
is black, I can control the brightness of all the views underneath it
by adjusting the alpha value.

For this to work, I would need to tell Android to render the root view
in front of all the other views but I can't find a way to do this. Any
ideas?

The actual reason for this weird request is that I want to be able to
dim the screen. There's some functionality to turn the brightness of
the screen down but the lowest setting is still too bright. The only
way to get the views darker seems to be to change the colors of the
views themselves. Rather than changing 50 items, it would be great to
put just one view on top of the whole tree, like a pair of sunglasses.

Or is there a better way?

thanks for your time,
Martin

-- 

3. Kartu Indosat dgn nomer 0814 yg kemarin beli di Expo

4. Batteray Original Nexus One

5. Ganti microsd pada nexus

6. MicroSD 32 GB - MicroSD 16 GB class 6

7. Get item selected from spinner