Android ConsoleMessage - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ConsoleMessage class.

This code example shows how to use the following methods:lineNumber, message, messageLevel, sourceId
	} 
 
	@Override 
	public boolean onConsoleMessage(ConsoleMessage message)
	{ 
		switch (message.messageLevel()) {
			case DEBUG:
				Log.d(CONSOLE_TAG, message.message() + " (" + message.lineNumber() + ":" + message.sourceId() + ")");
				break; 
			default: 
				Log.i(CONSOLE_TAG, message.message() + " (" + message.lineNumber() + ":"+ message.sourceId() + ")");
				break; 
		} 
		return true; 
	} 
 
	public boolean onJsAlert(WebView view, String url, String message, final android.webkit.JsResult result)
	{ 
		TiUIHelper.doOkDialog("Alert", message, new OnClickListener() {
			public void onClick(DialogInterface dialog, int which) {
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:lineNumber, message, messageLevel, sourceId
                    view = convertView;
                } 
 
                TextView headline = (TextView) view.findViewById(android.R.id.text1);
                TextView subText = (TextView) view.findViewById(android.R.id.text2);
                headline.setText(error.sourceId() + ":" + error.lineNumber());
                subText.setText(error.message());
                switch (error.messageLevel()) {
                    case ERROR:
                        subText.setTextColor(Color.RED);
                        break; 
                    case WARNING:
                        // Orange 
                        subText.setTextColor(Color.rgb(255,192,0));
                        break; 
                    case TIP:
                        subText.setTextColor(Color.BLUE);
                        break; 
                    default: 
                        subText.setTextColor(Color.LTGRAY);
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:lineNumber, message, sourceId
			activity.setTitle(title);
	} 
 
	@Override 
	public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
		Log.v(TAG, consoleMessage.sourceId() + ':' + consoleMessage.lineNumber() + " " + consoleMessage.message());
		return true; 
	} 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:lineNumber, message, sourceId
 
    private final static String TAG = TomahawkWebChromeClient.class.getName();
 
    @Override 
    public boolean onConsoleMessage(ConsoleMessage cm) {
        Log.d(TAG, cm.message() + " -- From line " + cm.lineNumber() + " of " + cm.sourceId());
        return true; 
    } 
 
    @Override 
    public void onConsoleMessage(String message, int lineNumber, String sourceID) {
        Log.d(TAG,
                "invoked: onConsoleMessage() - " + sourceID + ":" + lineNumber + " - " + message);
        super.onConsoleMessage(message, lineNumber, sourceID);
    } 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:lineNumber, message, sourceId
      viewClient_.onReceivedLoginRequest(view_, realm, account,
          args);
    } 
  } 
   
  // DownloadListener proxy methods. 
  @Override 
  public void onDownloadStart(String url, String userAgent,
      String contentDisposition, String mimeType, long contentLength) {
    if (downloadListener_ != null) {
      downloadListener_.onDownloadStart(url, userAgent, contentDisposition,
          mimeType, contentLength);
    } 
  } 
   
  // FindListener proxy methods. 
  @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
  @Override 
  public void onFindResultReceived(int activeMatchOrdinal,
      int numberOfMatches, boolean isDoneCounting) {
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:lineNumber, message, sourceId
   * @param consoleMessage Object containing details of the console message. 
   * @return true if the message is handled by the client. 
   */ 
  public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
      // Call the old version of this function for backwards compatability. 
      onConsoleMessage(consoleMessage.message(), consoleMessage.lineNumber(),
              consoleMessage.sourceId());
      return false; 
  } 
 
  /** 
   * When not playing, video elements are represented by a 'poster' image. The 
   * image to use can be specified by the poster attribute of the video tag in 
   * HTML. If the attribute is absent, then a default poster will be used. This 
   * method allows the ChromeClient to provide that default image. 
   * 
   * @return Bitmap The image to use as a default poster, or null if no such image is 
   * available. 
   */ 
  public Bitmap getDefaultVideoPoster() {
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:lineNumber, message, messageLevel, sourceId
    } 
 
    private class HelloWebChromeClient extends WebChromeClient {
        @Override 
        public boolean onConsoleMessage(ConsoleMessage cm) {
            Log.d(TAG, cm.message()
                    + " -- " + cm.messageLevel()
                    + " From line " + cm.lineNumber()
                    + " of " + cm.sourceId() );
            return true; 
        } 
    } 
 
    @Override 
    public void onCreate(Bundle savedInstanceState)
    { 
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
 
        mWebView = (WebView) findViewById(R.id.webview);
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:lineNumber, message, sourceId
      Activity activity, String token, MessageHandler handler) {
    webView = new WebView(activity);
    webView.getSettings().setJavaScriptEnabled(true);
    webView.setWebChromeClient(new WebChromeClient() {  // Purely for debugging.
        public boolean onConsoleMessage (ConsoleMessage msg) {
          Log.d(TAG, "console: " + msg.message() + " at " +
              msg.sourceId() + ":" + msg.lineNumber());
          return false; 
        } 
      }); 
    webView.setWebViewClient(new WebViewClient() {  // Purely for debugging.
        public void onReceivedError( 
            WebView view, int errorCode, String description,
            String failingUrl) {
          Log.e(TAG, "JS error: " + errorCode + " in " + failingUrl +
              ", desc: " + description);
        } 
      }); 
    proxyingMessageHandler = new ProxyingMessageHandler(activity, handler);
    webView.addJavascriptInterface(
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:message, messageLevel
        } 
    } 
 
    @Override 
    public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
        switch (consoleMessage.messageLevel()) {
        case ERROR:
            Log.e(TAG, consoleMessage.message());
            break; 
        case WARNING:
            Log.w(TAG, consoleMessage.message());
            break; 
        case DEBUG:
            Log.d(TAG, consoleMessage.message());
            break; 
        case TIP:
        case LOG:
        default: 
            Log.i(TAG, consoleMessage.message());
        } 

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:lineNumber, message, sourceId
	private static final String LOGTAG = "OpenXAd";
	 
	@Override 
	public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
		Log.d(LOGTAG,
				consoleMessage.message() + " -- From line "
						+ consoleMessage.lineNumber() + " of "
						+ consoleMessage.sourceId());
	    return true; 
	} 
} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Android ConsoleMessage Questions & Answers:

See Code Examples for Android ConsoleMessage Methods: