Android Open Source - SQLDroid Debug Printer






From Project

Back to project page SQLDroid.

License

The source code is released under:

MIT License

If you think the Android project SQLDroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.sqldroid;
//from   w w  w  .jav a2s .  com
/**
 * thanks to 
 * http://blog.taragana.com/index.php/archive/core-java-how-to-get-java-source-code-line-number-file-name-in-code/!
 * 
 * @author klm
 *
 */
public class DebugPrinter {

  // original tutorial suggests items [2]
  // from arrays, but [3] works for android.
  // there you go..
  
  /** Get the current line number.
   * @return int - Current line number.
   */
  public static int getLineNumber() {
      return Thread.currentThread().getStackTrace()[3].getLineNumber();
  }

  public static String getFileName() {
    return  Thread.currentThread().getStackTrace()[3].getClassName() 
     + " (" + Thread.currentThread().getStackTrace()[3].getMethodName() + ")";
  }
  
}




Java Source Code List

android.content.ContentValues.java
android.database.AbstractCursor.java
android.database.Cursor.java
android.database.MatrixCursor.java
android.database.MergeCursor.java
android.database.SQLException.java
android.database.SQLite.java
android.database.sqlite.SQLiteDatabaseLockedException.java
android.database.sqlite.SQLiteDatabase.java
android.database.sqlite.SQLiteException.java
android.util.Log.java
org.sqldroid.DebugPrinter.java
org.sqldroid.DroidDataSource.java
org.sqldroid.Log.java
org.sqldroid.SQLDroidBlob.java
org.sqldroid.SQLDroidClob.java
org.sqldroid.SQLDroidConnection.java
org.sqldroid.SQLDroidDatabaseMetaData.java
org.sqldroid.SQLDroidDriver.java
org.sqldroid.SQLDroidPreparedStatement.java
org.sqldroid.SQLDroidResultSetMetaData.java
org.sqldroid.SQLDroidResultSet.java
org.sqldroid.SQLDroidSQLException.java
org.sqldroid.SQLDroidStatement.java
org.sqldroid.SQLiteDatabase.java