public static WritableNativeArray makeNativeArray(List objects){
  WritableNativeArray nativeArray=new WritableNativeArray();
  if (objects == null) {
    return nativeArray;
  }
  for (  Object elem : objects) {
    elem=makeNativeObject(elem);
    if (elem == null) {
      nativeArray.pushNull();
    }
 else     if (elem instanceof Boolean) {
      nativeArray.pushBoolean((Boolean)elem);
    }
 else     if (elem instanceof Integer) {
      nativeArray.pushInt((Integer)elem);
    }
 else     if (elem instanceof Double) {
      nativeArray.pushDouble((Double)elem);
    }
 else     if (elem instanceof String) {
      nativeArray.pushString((String)elem);
    }
 else     if (elem instanceof WritableNativeArray) {
      nativeArray.pushArray((WritableNativeArray)elem);
    }
 else     if (elem instanceof WritableNativeMap) {
      nativeArray.pushMap((WritableNativeMap)elem);
    }
 else {
      throw new IllegalArgumentException("Could not convert " + elem.getClass());
    }
  }
  return nativeArray;
}

public static WritableNativeArray makeNativeArray ( List objects ) { WritableNativeArray nativeArray = new WritableNativeArray ( ) ; if ( objects == null ) { return nativeArray ; } for ( Object elem : objects ) { elem = makeNativeObject ( elem ) ; if ( elem == null ) { nativeArray . pushNull ( ) ; } else if ( elem instanceof Boolean ) { nativeArray . pushBoolean ( ( Boolean ) elem ) ; } else if ( elem instanceof Integer ) { nativeArray . pushInt ( ( Integer ) elem ) ; } else if ( elem instanceof Double ) { nativeArray . pushDouble ( ( Double ) elem ) ; } else if ( elem instanceof String ) { nativeArray . pushString ( ( String ) elem ) ; } else if ( elem instanceof WritableNativeArray ) { nativeArray . pushArray ( ( WritableNativeArray ) elem ) ; } else if ( elem instanceof WritableNativeMap ) { nativeArray . pushMap ( ( WritableNativeMap ) elem ) ; } else { throw new IllegalArgumentException ( "Could not convert " + elem . getClass ( ) ) ; } } return nativeArray ; }
this method converts a list into a nativearray . the data types supported are boolean , int , float , double , and string . list , map , and bundle objects , as well as arrays , containing values of the above types and / or null , or any recursive arrangement of these , are also supported . the best way to think of this is a way to generate a java representation of a json list , from java types which have a natural representation in json .
