# CreateJNIArgArray

> Creates the parameter array to be used as argument list when invoking Java code through CallMethod() in AndroidJNI.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/7000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AndroidJNIModule

## CreateJNIArgArray(Object\[])

Creates the parameter array to be used as argument list when invoking Java code through CallMethod() in AndroidJNI.

```csharp
public static jvalue[] CreateJNIArgArray(object[] args)
```

### Parameters

**** (\[Object\[]]\(https\://learn.microsoft.com/dotnet/api/system.object)): An array of objects that should be converted to Call parameters.

### Returns

| Type      | Description                                              |
| --------- | -------------------------------------------------------- |
| jvalue\[] | The converted arguments, ready to pass to a Call method. |

## CreateJNIArgArray(Object\[], Span\<jvalue>)

Creates the parameter array to be used as argument list when invoking Java code through CallMethod() in AndroidJNI, writing into the given buffer instead of allocating a new array.

```csharp
public static void CreateJNIArgArray(object[] args, Span<jvalue> jniArgs)
```

### Parameters

**** (\[Object\[]]\(https\://learn.microsoft.com/dotnet/api/system.object)): An array of objects to convert to Call parameters.**** (\[Span\<jvalue>]\(https\://learn.microsoft.com/dotnet/api/system.span-1)): The buffer to write the converted arguments into.
