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

try
{




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.setTimeInMillis(System.currentTimeMillis());
calendar.add(Calendar.SECOND, 15);

// Schedule the alarm!
AlarmManager am = (AlarmManager)getSystemService(ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), sender);
tv.setText("Successful");
setContentView(tv);
//finish();

}
catch(Exception e)
{

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

}


The following is a class which extends BroadcastReceiver . Which
should
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,
Toast.LENGTH_SHORT).show();
/*Intent smsIntent = new Intent();
smsIntent.setClassName("com.android.hello",
"com.android.hello.SendSms");
//startActivity(smsIntent);
//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=" http://schemas.android.com/apk/res/android" ;
package="com.saltriver.android"
android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name=".Lalu_Android"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission
android:name="android.permission.INTERNET"></uses-permission>
<receiver android:name=".OneShotAlarm" />

</manifest>


I am in the big trouble i hope some one will reply me as early as
possible.
--~--~---------~--~----~------------~-------~--~----~



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
<application></application>







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



Other Threads

1. (FaceDroid-id) WTI Dowload your Froyo

Mantab, cobain ah.
Ping2 pasti ngiler nih, sana angkat n1 dulu.
  ----- Original Message ----- 
  From: NURSAFRI 
  To: Id Android ; facedroid...@googlegroups.com 
  Sent: Sunday, May 23, 2010 3:41 AM
  Subject: (FaceDroid-id) WTI Dowload your Froyo


  As subject.

  BREAKING! Nexus One Users, Download Your Froyo Here! http://bit.ly/d5XE7l

  |SuperPhone from Google

  -- 
  "FaceDroid-id"
  To send email to facedroid...@googlegroups.com
  To subscribe to this group, send email to:
  facedroid-id+subscr...@googlegroups.com
  To unsubscribe from this group, send email to:
  facedroid-id+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.co.id/group/facedroid-id?hl=en
  and for blackberry related just subscribe to:
  faceberry-id-subscr...@yahoogroups.com

-- 
"Indonesian Android Community [id-android]" 

2. stuck di magic screen

baru flash rom cm507 test6..
pas reboot...stuck di logo htc magic...
sebelum2nya flash test3 dan test5 gak masalah...

ada clue harus ngapain?
masuk recovery masih bisa...
apa harus wipe?

thanks...

-- 
"Indonesian Android Community [id-android]" 

3. Launching another activity from my app.

4. Pilih Operator mana ya.....

5. Need some help understanding RelativeLayout

6. Get link on RSS feed from Android browser to my application

7. Java 6/Dalvik