• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

AutoStart App on Device BootUP

 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I guess I beter ask a question..

I am developing a system o bring non web widgets to android using two components, A Modified HomeScreenApp and the Widget itself.
Is there a specific Android Manifest attribute that allows an app to AutoStart on device bootup?
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think you can use BroadcastReceiver
 
Fred Grott
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was under the impression that BroadCast receiver is once the app has started
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you need to request for permission android.permission.RECEIVE_BOOT_COMPLETED , you have to declare it outside the <application> node of Android Manifest file as,

When the phone boots, an Intent is broadcasted to all apps who have registered to receive this Intent. To register for this Intent, like Imran said, you have to use BroadcastReceiver, first declare a receiver inside the <application> node as,

MyReceiver.java is the class that will receive the Intent. You will handle the Intent in the onReceive() method of BroadcastReceiver class. You get approx. 5 secs to do what you want inside onReceive(), after that the system will show 'App not responding' dialog to the user, so make sure you don't do any heavy processing inside that method.
 
Imran Mohd
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
and than you have to start your Activity form the onReceive() method of BroadcastReceiver class
i.e

i don't know how much it is reliable..... but generally i use this...!!!
 
Fred Grott
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you both
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic