Tecnologia do Blogger.
RSS

Re: [androidbrasil-dev] Problemas com BroadcastReceiver


Em qui, 21 de mai de 2015 às 13:36, Gink Labrev <gink.labrev@gmail.com> escreveu:
O Broadcast Receiver tem um tempo máximo de execução (não lembro qual, mas está na documentação).
É bem pouco. O melhor é instanciar um Service a partir dele e aí fazer o que tem que fazer.

Em 21 de maio de 2015 12:19, Jonas Alves <jonasfa@gmail.com> escreveu:

Um Handler não garante que o processo continuará em execução por tempo o bastante pra terminar a tarefa.
Concordo com a recomendação do Marcelo de criar um Service, visto que o tempo do I/O pode ser mais longo do que o BroadcastReceiver garante executar.


Em qui, 21 de mai de 2015 08:51, Carlos Eduardo <carloseduardopelegrin@gmail.com> escreveu:
Se for pouca coisa, você também pode enviar uma mensagem para um Handler! mais simples.

Att.


--
Carlos Eduardo Simões Pelegrin

Em 21 de maio de 2015 07:14, Marcelo Alves <malves.info@gmail.com> escreveu:

Oi Amanda,
   Você instanciou teu stream? Outra coisa, é aconselhável q no broadcast o onreceiver seja executado o mais rápido possível, se você tem um código onde executa um processo mais demorado q é o seu caso, e melhor vc colocar esse código para ser executado dentro de um serviço, assim, na execução do receiver vc inicia esse serviço.
Abs


Em qui, 21 de mai de 2015 00:11, Amanda Oliveira <amandaellenoliveira@gmail.com> escreveu:
Boa noite,

Estou fazendo um app de despertador.
Estou usando uma classe BroadcastReceiver para implementar o agendamento do horário estipulado pelo usuário, até então, sem problemas.
Acontece que eu preciso mandar um serial via bluetooth e não consigo implementar a minha função dentro desse BroadcastReceiver.

A função seria essa :

private OutputStream outStream;

private void sendData(String message) {
        byte[] msgBuffer = message.getBytes();

        try {
            outStream.write(msgBuffer);
        } catch (IOException e) {
            //erro
        }
    }

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário