Find Jobs
Hire Freelancers

Move MediaPlayer to a Service. Troubleshoot issues surrounding loops when phone sleeping.

£10-20 GBP

Terminado
Publicado hace alrededor de 10 años

£10-20 GBP

Pagado a la entrega
I already have a fully functioning application that plays sounds when the user presses buttons on the MainActivity. There are around 15 sounds that loop continuously and 15 buttons. I need to move the MediaPlayer from MainActivity into a Service and to only have ONE general MediaPlayer Service for every single sound that needs to be played. Currently the buttons on click associate a resId that the MediaPlayer uses to play the correct sound. An example of this is: public void onClick(View v) { int resId; switch ([login to view URL]()) { case R.id.button_1: resId = [login to view URL]; break; case R.id.button_2: resId = R.raw.brown_noise; break; default: resId = [login to view URL]; break; } // Release any resources from previous MediaPlayer if (mp != null) { [login to view URL](); } // Create a new MediaPlayer to play this sound mp = [login to view URL](this, resId); [login to view URL](true); [login to view URL](); The MediaPlayer service needs to be able to listen for the resId and to play the correct sound accordingly. ONE MediaPlayer Service needs to be able to play ALL sounds and to play the correct sound depending on button press. As well as this, the developer needs to rewrite sections of code such as: PhoneStateListener phoneStateListener = new PhoneStateListener() { @Override public void onCallStateChanged(int state, String incomingNumber) { if ([login to view URL]() && state == TelephonyManager.CALL_STATE_RINGING) { [login to view URL](0,0); } else if([login to view URL]() && state == TelephonyManager.CALL_STATE_IDLE) { [login to view URL](1,1); } else if([login to view URL]() && state == TelephonyManager.CALL_STATE_OFFHOOK) { [login to view URL](0,0); } [login to view URL](state, incomingNumber); } }; TelephonyManager mgr = (TelephonyManager) getSystemService(TELEPHONY_SERVICE); if(mgr != null) { [login to view URL](phoneStateListener, PhoneStateListener.LISTEN_CALL_STATE); } To work with the MediaPlayer Service as MainActivity will no longer be able to determine isPlaying() and will not be able to set the MediaPlayer volume as the MediaPlayer is outside of it, and is instead inside the Service. This section will need writting also: [login to view URL](new [login to view URL]() { public void onClick(View v) { if(null!=mp){ [login to view URL](); [login to view URL](R.drawable.ic_action_volume_muted); } To ensure that the STOP button on the MainActivity will be able to tell the MediaPlayer Service to release() the MediaPlayer. Additionally the developer will need to troubleshoot issues surrounding the MediaPlayer loops having a 0.5 second gap between them when the phone goes to sleep (Is locked or the screen dims). The sounds should loop continuously and seamlessly until the STOP button is called.
ID del proyecto: 5503667

Información sobre el proyecto

6 propuestas
Proyecto remoto
Activo hace 10 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
Hi. I have lots of experience in android development and I have worked with playing sounds in android on button click. let me try it
£23 GBP en 2 días
5,0 (154 comentarios)
6,6
6,6
6 freelancers están ofertando un promedio de £42 GBP por este trabajo
Avatar del usuario
Hi sir i want to work on your project. Please message me your project's Download link so we can start working on it. Waiting for your response. :)
£30 GBP en 3 días
5,0 (26 comentarios)
4,1
4,1
Avatar del usuario
Hi Dear I'm an Android Expert. I can help you. Please let's discuss in more detail. Best Regards
£33 GBP en 1 día
5,0 (3 comentarios)
2,9
2,9
Avatar del usuario
Đề xuất vẫn chưa được gửi
£20 GBP en 3 días
5,0 (1 comentario)
0,0
0,0
Avatar del usuario
Hey This one if fairly simple. I have done the same thing in the past. If you send me a document with all the requirements and accept my off then I'll get started right away. I'm looking forward to workig on this project. Kinds regards Christophe
£133 GBP en 3 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED KINGDOM
Towcester, United Kingdom
5,0
1
Forma de pago verificada
Miembro desde mar 1, 2014

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.