How to convert depth frame to grey image?

I believe the Linux version is only using the lower 8 bits from the raw 16-bit depth data, while the Android version is using treating the data as full 16-bit grayscale.

To get Android to show the image so it appears as it does in Linux, covert the short[] data into byte[] data, keeping only the lower 8 bits.

Conversely, to show the Android-style image on Linux you’d need to create a 16-bit grayscale image using the raw depth data from the camera.