(Implementation example of virtual keyboard in Android, source code download of VirtualKeyboard, creation of pole coordinate data buffer, vertices.length
4 is because an integer has four bytes: ByteBuffervbb=ByteBuffer. allocateDirect (vertices. length
4); vbb.order(ByteOrder.nativeOrder());// Set byte order. mVertexBuffer=vbb.asFloatBuffer();// Convert to int buffer mVertexBuffer. put (vertices)// Put pole coordinate data mVertexBuffer into the buffer position(0);// Set the starting position of the buffer.//Special tips: because the byte order of different platforms and the data units that are not bytes must be converted through ByteBuffer//, the key is to set nativeOrder() through ByteOrder, otherwise there may be problems.//The initialization of pole coordinate data. For more code comments, refer to the code file. This document includes the following annexes:)