android: play media in app

During my research in the possibilities of playing audio and video from app, I found several ways of playing media.
The simplest one is to use external player. It was described in the post “Android: how to play audio and video from app“.

Here are some examples how to play media in app.

Then you need to add xml layout file audio_player.xml

Video can be played in the following Activity:

Layout video_player.xml