Context from which to initiate Service via Alarm Manager; Application Model Questions

by 3D » Fri, 31 Oct 2008 07:44:37 GMT


Sponsored Links
 I've created a simple app. to help me better understand a few key
components in the real app I'm making.  A snippet of what I've done:

- an Activity is launched (lets call it the Home Activity) -> from
here I schedule an alarm -> the alarm sets off a Pending Intent that
starts a Service.

- the above steps appear to do what I want them to do.

My questions:

- is a scheduled alarm persistent with respect to its creating process
(I believe so) ?  If the Home Activity is destroyed, the alarm still
goes off, correct?

- the PendingIntent that the alarm calls as well as the Intent nestled
within both have a Context of the Home Activity.  Is this a problem?
Does the system launch the Home Activity again (if it has been
destroyed since scheduling the alarm) just to launch the Service?

- the Service does its task (some networking which will take a couple
seconds) and then possibly creates a notification before killing
itself (the alarm is repeating so it will get called again later).
Does the Service need to make a new Thread to do its work in?  The
user is not interacting with the Home Activity at this point so I
don't think a new Thread is needed.

I think that sums up my questions for now.  Advice will be greatly
appreciated!

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



Other Threads

1. Struggling -- Getting exception when clicked on HelloItemizedOverlay

Per your stack trace, you have a problem on line 284 of
MyLocations.java.

Balwinder Kaur
Open Source Development Center
T  Mobile stick together

The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.



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

2. New Screen

I know this is probably a really stupid question but have tried for
ages and searched but cant get it to work. I'm trying to create a new
screen when an item in a list in my first screen is selected.  i use
the code
Intent intent = new Intent();
         intent.setClass(this, Ingredients.class);
         startActivity(intent);}

to try get the Ingredients.java file to run the file looks like this

package com.example.easychef;
import android.app.Activity;
import android.os.Bundle;

public class Ingredients extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle circl) {
        super.onCreate(circl);
        setContentView(R.layout.layout_i);
    }
}

and i added this line to the manifest
<activity android:name="com.example.easychef"
android:label="com.example.easychef.Ingredients"></activity>

The program just crashes as i select an item in the list. Please can
someone tell me what im doing wrong.
thank you

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

3. Persistent setRepeating

4. UI surface Pixel Format inside surface flinger is RGBA_8888, Can this be changed to ARGB_8888.

5. UI surface Pixel Format inside surface flinger is RGBA_8888, Can this be changed to ARGB_8888?

6. Android App with Analytics like Flurry

7. cant know whats problem with the content provider in my code ... Plz help