# Debug

Artifact: [androidx.constraintlayout:constraintlayout](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/motion/widget/Debug.java+class:androidx.constraintlayout.motion.widget.Debug) Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

*** ** * ** ***


```
public class Debug
```

<br />

*** ** * ** ***

Utilities useful for debugging

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#Debug()()` |

| ### Public methods |
|---|---|
| `static void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#dumpLayoutParams(android.view.ViewGroup,java.lang.String)(https://developer.android.com/reference/android/view/ViewGroup.html layout, https://developer.android.com/reference/java/lang/String.html str)` |
| `static void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#dumpLayoutParams(android.view.ViewGroup.LayoutParams,java.lang.String)(https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html param, https://developer.android.com/reference/java/lang/String.html str)` |
| `static void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#dumpPoc(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html obj)` |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#getActionType(android.view.MotionEvent)(https://developer.android.com/reference/android/view/MotionEvent.html event)` Convert a motion event action to a string |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#getCallFrom(int)(int n)` Get file name and location where this method is called. |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#getLoc()()` Get file name and location where this method is called. |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#getLocation()()` Get file name and location where this method is called. |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#getLocation2()()` Get file name and location where this method is called. |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#getName(android.view.View)(https://developer.android.com/reference/android/view/View.html view)` This provides return the name of a view |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#getName(android.content.Context,int[])(https://developer.android.com/reference/android/content/Context.html context, int[] id)` This returns the name of a view given its id |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#getName(android.content.Context,int)(https://developer.android.com/reference/android/content/Context.html context, int id)` This returns the name of a view given its id |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#getState(androidx.constraintlayout.motion.widget.MotionLayout,int)(https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout layout, int stateId)` convert an id number to an id String useful in debugging |
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#getState(androidx.constraintlayout.motion.widget.MotionLayout,int,int)(https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout layout, int stateId, int len)` convert an id number to an id String useful in debugging |
| `static void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#logStack(java.lang.String,java.lang.String,int)(https://developer.android.com/reference/java/lang/String.html tag, https://developer.android.com/reference/java/lang/String.html msg, int n)` This logs n elements in the stack |
| `static void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/Debug#printStack(java.lang.String,int)(https://developer.android.com/reference/java/lang/String.html msg, int n)` This logs n elements in the stack |

## Public constructors

### Debug

Added in 2.2.2

```
public Debug()
```

## Public methods

### dumpLayoutParams

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static void dumpLayoutParams(ViewGroup layout, String str)
```

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/view/ViewGroup.html layout` |   |
| `https://developer.android.com/reference/java/lang/String.html str` |   |

### dumpLayoutParams

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static void dumpLayoutParams(ViewGroup.LayoutParams param, String str)
```

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html param` |   |
| `https://developer.android.com/reference/java/lang/String.html str` |   |

### dumpPoc

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static void dumpPoc(Object obj)
```

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/Object.html obj` |   |

### getActionType

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static String getActionType(MotionEvent event)
```

Convert a motion event action to a string

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/view/MotionEvent.html event` |   |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` |   |

### getCallFrom

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static String getCallFrom(int n)
```

Get file name and location where this method is called. Formatting it such that it is clickable by Intellij

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | (filename : line_no) |

### getLoc

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static String getLoc()
```

Get file name and location where this method is called. Formatting it such that it is clickable by Intellij

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | (filename : line_no) |

### getLocation

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static String getLocation()
```

Get file name and location where this method is called. Formatting it such that it is clickable by Intellij

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | (filename : line_no) |

### getLocation2

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static String getLocation2()
```

Get file name and location where this method is called. Formatting it such that it is clickable by Intellij

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | (filename : line_no) |

### getName

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static String getName(View view)
```

This provides return the name of a view

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/view/View.html view` |   |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | name of view |

### getName

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static String getName(Context context, int[] id)
```

This returns the name of a view given its id

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` |   |
| `int[] id` |   |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | name of view |

### getName

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static String getName(Context context, int id)
```

This returns the name of a view given its id

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` |   |
| `int id` |   |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` | name of view |

### getState

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static String getState(MotionLayout layout, int stateId)
```

convert an id number to an id String useful in debugging

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout layout` |   |
| `int stateId` |   |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` |   |

### getState

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static String getState(MotionLayout layout, int stateId, int len)
```

convert an id number to an id String useful in debugging

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/MotionLayout layout` |   |
| `int stateId` |   |
| `int len` | trim if string \>len |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` |   |

### logStack

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static void logStack(String tag, String msg, int n)
```

This logs n elements in the stack

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html tag` |   |
| `https://developer.android.com/reference/java/lang/String.html msg` |   |
| `int n` |   |

### printStack

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public static void printStack(String msg, int n)
```

This logs n elements in the stack

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html msg` |   |
| `int n` |   |