HI,
According to
http://developer.android.com/intl/fr/guide/developing/debug-tasks.html#DebuggingWebPages
when I use console.log in javascript I should see messages in the adb
logcat log .
This isn't working for me. I don't see anything from the browser in
the log.
Here's the log
------------------------------------------------------
I/ActivityManager( 55): Starting activity: Intent { flg=0x10000000
cmp=com.funambol.test/.test }
I/ActivityManager( 55): Start proc com.funambol.test for activity
com.funambol.test/.test: pid=525 uid=10027 gids={}
D/AndroidRuntime( 519): Shutting down VM
D/dalvikvm( 519): DestroyJavaVM waiting for non-daemon threads to
exit
D/dalvikvm( 519): DestroyJavaVM shutting VM down
D/dalvikvm( 519): HeapWorker thread shutting down
D/dalvikvm( 519): HeapWorker thread has shut down
D/jdwp ( 519): JDWP shutting down net...
I/dalvikvm( 519): Debugger has detached; object registry had 1
entries
E/AndroidRuntime( 519): ERROR: thread attach failed
D/dalvikvm( 519): VM cleaning up
D/dalvikvm( 519): LinearAlloc 0x0 used 636716 of 5242880 (12%)
D/ddm-heap( 525): Got feature list request
D/MyApplication( 525): Loading Test
D/dalvikvm( 525): GC freed 855 objects / 61064 bytes in 110ms
D/MyApplication( 525): Done Loading Test
I/ActivityManager( 55): Displayed activity com.funambol.test/.test:
1680 ms (total 1680 ms)
E/gralloc ( 55): [unregister] handle 0x47efd0 still locked
(state=40000001)
------------------------------------------------------
Here's the Java code
------------------------------------------------------
package com.funambol.test;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.webkit.WebSettings;
import android.webkit.WebView;
public class test extends Activity {
/** Called when the activity is first created. */
WebView webview;
private static WebView webView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d("MyApplication", "Loading Test");
// setContentView(R.layout.main);
webView = new WebView(this);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
webView.loadUrl("file:///android_asset/index.html");
setContentView(webView);
Log.d("MyApplication", "Done Loading Test");
}
}
------------------------------------------------------
And here's the javascript code
------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<title> Test Page</title>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=iso-8859-1">
</head>
<body>
<script>
document.write("javascript is working<br/>");
window.console.log("1234567");
console.log("foobar");
</script>
this is a test
</body>
</html>
------------------------------------------------------
Thanks,
Dror
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en