automatic start using Alaram Manager problem

by Honest » Fri, 23 Jan 2009 12:53:59 GMT

Sponsored Links
 I created one application to start application After particular time
interval. My application working fine but it does not do particular
after particular time. I mean it does not used to start automatically
after the time which i set in AlaramManager.

My coding and xml file is as below.

The following is the code of my mail class which extends Activity. I
have done following thing in it


Intent intent = new Intent(Lalu_Android.this, OneShotAlarm.class);
PendingIntent sender = PendingIntent.getBroadcast(Lalu_Android.this,
0, intent, 0);

// We want the alarm to go off 30 seconds from now.
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.SECOND, 15);

// Schedule the alarm!
AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);

catch(Exception e)

tv.setText("Url not called successfully");


The following is a class which extends BroadcastReceiver . Which
be invoked after particular time.

public class OneShotAlarm extends BroadcastReceiver
//Lalu_Android la=new Lalu_Android();
CallUrl ca;

//TextView tv = new TextView();
public void onReceive(Context context, Intent intent)
System.out.println("In one shot alaram");
Toast.makeText(context, "Alaram", Toast.LENGTH_SHORT).show();
ca=new CallUrl();
//Toast.makeText(context, R.string.one_shot_received,
/*Intent smsIntent = new Intent();
//la. */

The CallUrl is a another class which i want to execute its method
onCreate() when application starts by AlaramManager so i create the
object of it in the OneShotAlaram.

The following my xml file.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="" ;
<application android:icon="@drawable/icon"
<activity android:name=".Lalu_Android"
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<receiver android:name=".OneShotAlarm" />


I am in the big trouble i hope some one will reply me as early as

automatic start using Alaram Manager problem

by Honest » Fri, 23 Jan 2009 19:00:32 GMT

 I hope some one will reply me as early as possible.

Sponsored Links

automatic start using Alaram Manager problem

by AlexeyB » Sat, 24 Jan 2009 08:20:29 GMT

 Try to move your service declaration in the manifest under application
tag. Regards.


automatic start using Alaram Manager problem

by Honest » Mon, 26 Jan 2009 14:21:14 GMT


Actually i did not declare any <service> there so can you tell me what
i am missing there ? Sorry if am asking you basic question but i am
just newbie in android.


automatic start using Alaram Manager problem

by AlexeyMot » Tue, 27 Jan 2009 04:27:40 GMT

 Move "<receiver android:name=".OneShotAlarm" /> " declaration under


Other Threads

1. Query 1:

Could you please tell me how to use notification code inside Broadcast


2. Sending custom headers in WebView

I've found some information about this topic, but I was curious as to
whether anyone has had any success loading webpages in a WebView with
custom headers.  There doesn't seem to be any simple way of doing
this.  I've seen an implementation that involved downloading the
webpage and separately loading the data into the WebView.  While this
is not difficult, the WebView then demonstrated problems with relative
URLs and downloading images.

Has anyone come up with a clean way to get this done?  Thanks in



3. GDC 2010 Presentations

4. Customize SDK to Measure Tx Power

5. help regarding deploying my app

6. How invoke voice input from InputMethodService and get result?

7. Bluetooth headset muted when playing FM Radio