Run application during boot up(.apk file)

2,653 views
Skip to first unread message

Nilly

unread,
Jan 22, 2010, 11:53:18 PM1/22/10
to android-porting
HI All,

I want to run an application at startup.I have .apk file.
How can I run it at start up?

I have looked at the init.rc but it only shows how to run process.but
i have seen that dalvikvm & other process starts .apk file resides in /
system/app folder.

If I want to run application (using installing .apk file) at boot up
time how can i do that?

Rgrds,
Niral

Dianne Hackborn

unread,
Jan 23, 2010, 6:27:20 AM1/23/10
to android...@googlegroups.com
You can't.  You need to have the rest of the system running before you can run a .apk.




--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Nilly

unread,
Jan 23, 2010, 6:34:41 AM1/23/10
to android-porting
hmm,
If I have .apk installed already than is it possible to run it on boot
up time?

Regards,
Niral

On Jan 23, 4:27 pm, Dianne Hackborn <hack...@android.com> wrote:
> You can't.  You need to have the rest of the system running before you can
> run a .apk.
>
>
>
>
>
> On Fri, Jan 22, 2010 at 8:53 PM, Nilly <ni...@oriolesoftware.com> wrote:
> > HI All,
>
> > I want to run an application at startup.I have .apk file.
> > How can I run it at start up?
>
> > I have looked at the init.rc but it only shows how to run process.but
> > i have seen that dalvikvm & other process starts .apk file resides in /
> > system/app folder.
>
> > If I want to run application (using installing .apk file) at boot up
> > time how can i do that?
>
> > Rgrds,
> > Niral
>
> > --

> > unsubscribe: android-porti...@googlegroups.com<android-porting%2Bunsubscribe@­googlegroups.com>


> > website:http://groups.google.com/group/android-porting
>
> --
> Dianne Hackborn
> Android framework engineer

> hack...@android.com


>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and

> answer them.- Hide quoted text -
>
> - Show quoted text -

Anil Sasidharan

unread,
Jan 23, 2010, 10:36:04 AM1/23/10
to android...@googlegroups.com
Hi,

Try broadcast receiver or intent filter for "BOOTUP_COMPLETED" notification.

Warm Regards,
Anil

Nilly

unread,
Jan 26, 2010, 11:12:18 PM1/26/10
to android-porting

I have tried disabling zygote process in init.rc started the .apk
using am start.

e.g.
am start -a android.intent.action.MAIN -n com.iftitah.android.contact/
com.iftitah.android.contact.Contact

but it is not starting saying " IS SYSTEM RUNNING"
can not connect to activity manager....

I want to know if i want to start only single application than what
all process is requierd?

Regards,
Niral

> > website:http://groups.google.com/group/android-porting- Hide quoted text -

wang jintong

unread,
Jan 27, 2010, 12:05:24 AM1/27/10
to android...@googlegroups.com
I think you should use BOOTUP_COMPLETED intent too..

Dianne Hackborn

unread,
Jan 27, 2010, 3:39:41 AM1/27/10
to android...@googlegroups.com
The am command requires that the entire system be running, since it makes calls on the activity manager.

You are mixing two completely different levels of the system.  init is the very lowest-level user space code that runs, and zygote is the lowest-level dalkvik stuff.  An .apk is the highest-level application concept, and needs all of the other platform (system process with all of the system java code like the window manager) to be up and running for it to be able to do anything.




--
Dianne Hackborn
Android framework engineer

Nilly

unread,
Jan 27, 2010, 10:41:59 PM1/27/10
to android-porting
Yes, After starting Activity manager and zygote i am able to start
application.

I dont want to start other application(resides in system/app) but when
I simply delete that I am not able to start android so i think some
are mandatory.
dalkvik is taking time.
system manager is starting so many other services I just need activity
manager as it is require to start an application I want.

So I want as minimum as possible init and only required services to
start by system_server process.
So if I go to system server code and comment out the other services
and only keep activity manager will it do?

Actually my intention is to start only an application at boot up time
no other init.

Regards,
Niral

> > > > unsubscribe: android-porti...@googlegroups.com<android-porting%2Bunsubscribe@­googlegroups.com>
> > > > website:http://groups.google.com/group/android-porting-Hide quoted

Dianne Hackborn

unread,
Jan 28, 2011, 7:46:50 PM1/28/11
to android...@googlegroups.com
I don't have a recipe to give you.  You can look through SystemService.java to see things you may not want to run.  Pull out apps you don't want.




--
Dianne Hackborn
Android framework engineer
hac...@android.com

freakingtux

unread,
Jan 29, 2011, 4:14:04 AM1/29/11
to android...@googlegroups.com
Hi,


On Wednesday, January 27, 2010 9:39:41 AM UTC+1, hackbod wrote:
The am command requires that the entire system be running, since it makes calls on the activity manager.

You are mixing two completely different levels of the system.  init is the very lowest-level user space code that runs, and zygote is the lowest-level dalkvik stuff.  An .apk is the highest-level application concept, and needs all of the other platform (system process with all of the system java code like the window manager) to be up and running for it to be able to do anything.

Given this information should I consider it wrong to write services(bound to addons) and deploy them using apk's.?
Services provided by the SystemService are always available(you don't need to wait for the binding process to be done)

If I currently write services I rely on the boot completed  to start the services. This has as drawback that users of that service
also need deal with the asynchronous binding behavior. e.g. you can not use a method like Context.getSystemService and use the object directly so you have to deal with the Service connecting and disconnecting


Dianne Hackborn

unread,
Jan 29, 2011, 12:48:01 PM1/29/11
to kees.jon...@gmail.com, android...@googlegroups.com
The only time you can avoid asynchronous binding is if you can ensure the service is always running and never ever disappears, which means its interface published from an object in the system process.  Only core system services are in this category.

Reply all
Reply to author
Forward
0 new messages