How-to start service automatically on system startup and on installation

by Dianne Hackborn » Tue, 14 Apr 2009 07:33:07 GMT


Sponsored Links
 To amplify -- just starting your service at boot and leaving it running all
of the time is NOT recommended.  It consumes a lot of resources, if nothing
else a whole process sitting there doing nothing (presumably) most of the
time, when that memory could be used for other things.







-- 
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.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Scrolling in HorizontalScrollView

Greetings,

I have a linear layout inside a horizontal scroll view.  linear layout
has n number of images.

I am facing problem with horizontal scrolling, As soon as the user
flings, depending upon the velocity the scroll view scrolls. But my
requirement differs with the default horizontal scroll view
scrolling.  My requirement is "whatever may be the fling velocity"
user has to be shown the next three images depending upon the fling
direction

Hence I have extended Horizontal scroll view and override fling, such
that I can scroll to the next three images, by specifying the number
of pixels it should move horizontally using scrollTo(px,px);

The above operation is not giving the expected behavior. Any thoughts
on this would be really helpful.

Thanks,
Arjun.

-- 

2. Debugging a Widget causes ANR

Hi all :)
I'm trying to debug an AppWidget but I incurred in a problem :D If not
setting the breakpoint the widget works good without ANR and the
commands Log.v are executed flawlessly. Then I placed a breakpoint on
the top of the following method:

    public void onReceive(Context context, Intent intent) {
    Log.v(TAG, "onReceive 1"); // BP on this line
    super.onReceive(context, intent);
    String action = intent.getAction();

    // Checks on action and computations ...

    Log.v(TAG, "onReceive 2");
    updateWidget(context);
    Log.v(TAG, "onReceive 3");
}

The breakpoint stops the execution as expected but then the process
dies. The problem is that the breakpoint ( I guess xD ) cause an ANR
and the ActivityManager kills the process. That's the Log:

01-07 14:32:38.886: ERROR/ActivityManager(72): ANR in
com.salvo.wifiwidget
01-07 14:32:38.886: INFO/Process(72): Sending signal. PID: 475 SIG: 9
......
......
01-07 14:32:38.906: INFO/ActivityManager(72): Process
com.salvo.wifiwidget (pid   475) has died.

This cause the debug to stop. So the question is: there's a way to
debug the widget without incurring in the ANR?? thanks in advance for
the answers

-- 

3. Another SMS Android problem

4. Need help for Bluetooth Opp transfer broadcast messages

5. Accesing RILD without recompiling the whole Framework and OS image

6. how to access certificate from inside app

7. Can I play a AAC strem which is in a FLV container?