a minha rotina que utilizo o wakelock esta assim
protected void onMessage(Context context, Intent data) {
{
try{
// Wake Android Device when notification received
PowerManager pm = (PowerManager) context
.getSystemService(Context.POWER_SERVICE);
final PowerManager.WakeLock mWakelock = pm.newWakeLock(
PowerManager.FULL_WAKE_LOCK
| PowerManager.ACQUIRE_CAUSES_WAKEUP, "GCM_PUSH");
mWakelock.acquire();
// Timer before putting Android Device to sleep mode.
mWakelock.release();
}catch(Exception e){
e.printStackTrace();
}
}
}
Em 4 de fevereiro de 2014 09:53, Pedro Subutzki <Pepeu> <falecompepeu@gmail.com> escreveu:
Manoel,Você deve estar fazendo alguma coisa errada então.
Abraços,
Pedro Subutzki
__________________________________________HADI - Makes SQLite in Android easy and simple
https://github.com/PepeuCps/HadiEm 3 de fevereiro de 2014 16:44, Manoel Canhos <manoel.canhos@gmail.com> escreveu:utilizando isso que me passou eu iria ter que usar o BroadcastReceiver, eu já tentei com ele tbm só que ele não aceita minha rotina que pega a localização do GPS.Em 3 de fevereiro de 2014 16:20, Santhyago Gallão <santhyago@gmail.com> escreveu:Boa tarde,Veja se a classe AlarmManager te ajuda.Abraços,--Santhyago Gallao
Porta-voz da Comunidade Android Brasil
Organizador do Google Developer Group Santa Catarina
@_Santhyago | +Santhyago | Skype: santhyago.gallao2014-02-03 Manoel Canhos <manoel.canhos@gmail.com>:--Olá boa tarde, gostaria que vcs me ajudassem eu preciso criar um serviço que ele fique sempre em execução executando uma rotina de tempos em tempos.tipo a cada 1 min ele pega a posicao GPS atual do celular e me envia para o web service, a rotina de capturar o GPS e enviar para o web service esta funcionando normal,o problema é meu serviço ele começa a funcionar normal e envia normalmente de 1 em 1 min só que quando a tela do celular apaga ele para de enviar.Alguém poderia me ajudar.
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.--
You received this message because you are subscribed to a topic in the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/androidbrasil-dev/f1IKcJzeN_s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.--
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/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/androidbrasil-dev/f1IKcJzeN_s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
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/groups/opt_out.






0 comentários:
Postar um comentário