移动应用程序开发中的一个新功能,但是尝试使用Android Studio开发在线广播应用程序,但是当该应用程序播放Icecast中的声音时,它会在手机处于锁定和睡眠状态时停止播放.
am new in mobile app development, but have try do develop online radio app using Android Studio, but when the app is playing the sound from Icecast it use to stop when the phone is lock and sleep.
我还发现很难设置可以前进的任何应用的精确宽度,我设置的宽度仅适用于Small Android Screen.该代码充满了具有android 4.0的小型android手机的宽度,但是在大屏幕android手机上,我可以在屏幕的旁边和底部看到一些空间.
Also i find it difficult to set the accurate width that can march any app, the one that i set only work for Small Android Screen. The code full the width of small android phone with android 4.0 but on large screen android phone i can see some space beside and at the bottom of the screen.
主XML代码
推荐答案您应使用 MediaSession ,因为它旨在帮助您控制媒体播放和控制媒体播放.检查参考,并按照步骤使用MediaSession.
You should use MediaSession since its designed to help you control Media playing and controlling media playback. Check the reference and follow steps for using MediaSession.
更多推荐
Android即使手机处于锁定和睡眠状态也如何保持音乐播放
发布评论