this is my code for setting alarm:
public void SetAlarm(Context context, int tag, long time){
AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(context, Alarm.class);
i.putExtra("position", tag);
PendingIntent pi = PendingIntent.getBroadcast(context, tag, i, PendingIntent.FLAG_CANCEL_CURRENT);
am.set(AlarmManager.RTC_WAKE
I am working on a project about android and I am trying to set a connection between device and ADK my problem is .getAccessory(); method.
I am passing strings as intent extras, the following method is passed parameters containing the information I wish to pass via intent, I can see that the values in "mc" and "title" are as they should be in toasts:
private void addProximityAlert(int id, Double latitude, Double longitude, String title, String mc) {
Intent intent = new Intent(PROX_ALERT_INTENT);
intent.putExtra("id
I have a receiver that is called whenever an SMS is received
public class SMSReceiver extends BroadcastReceiver
{
private SharedPreferences prefs;
private String prefName = "MyPref";
private static final String NUMBER_KEY = "number";
@Override
public void onReceive(Context context, Intent intent)
{
//---get the SMS message passed in---
Bundle bundle = intent.getExtras();
SmsMessage
I make a simple Android Apps that will update its view when an SMS is received.
I am trying to setup a BroadcastReceiver to handle scheduled events. I have been following http://mobile.tutsplus.com/tutorials/android/android-fundamentals-schedu... , and had the feature working, or so I believed.
there is 3 classes.
service class,executing class, receiver class
fisrt, service class execute Amethod in "executing class"
the code in"executing class" is
Amethod(){
Intent intent = new Intent();
intent.setAction("MY_ACTION");
PendingIntent pi = PendingIntent.getBroadcast( context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT );
AlarmManager am = (AlarmM
I have an Activity Class that is calling an IntentService class to do some work
Intent intent = new Intent(this, NetworkHandler.class);
PendingIntent pendingIntent = createPendingResult(1, intent, PendingIntent.FLAG_ONE_SHOT);
intent.putExtra(NetworkHandler.REFRESH_CONTENT, NetworkHandler.GRO);
intent.putExtra("pendingIntent", pendingIntent);
startService(intent);
After the IntentService is d
I am following the code posted HERE on setting up an alarm manager but I can't get it to work at all.
This code is in a class called "Alarm":
package com.sjjgames.abortionapp;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.PowerMan