Both AVI and MKV files are
container formats not codecs. To play a video file you need
essentially:One, a software (video player) capable of
"uncompress" the container format.Two, a hardware capable of run (decode) the codecs inside the container. Most MKV (container) use H.264 (aka AVC) video codec and AAC sound format. You can also add subs (captioning) in many formats, as text based .sub files, .ssa files or even the very old .cc files.
Note:Android OS natively supports H.264 decoding by software.Most recent mobile phones (principally HTC phones) have hardware acceleration for H.264 decoding (id est, the video is decoded by hardware not by software or the OS).
Converting/Compiling a video you must select the container format mp4/mkv/avi and then select the coding format for video (H.264/H.262/Dvix), audio (AAC/MP3) and subs (if any).Sorry for my poor English. If you not understand something just tell me.