Re: [android-developers] Re: My BroadcastReceiver receiver not getting called after phone boots, any ideas?

2013-03-08 Thread Mark Murphy
You do not hold the RECEIVE_BOOT_COMPLETED permission. Instead, you
are trying to hold the RECEVIE_BOOT_COMPLETED permission, which does
not exist.

On Fri, Mar 8, 2013 at 11:12 AM, pawpaw17 georgefraz...@yahoo.com wrote:
 Here is most of my manifest file. I changed things around so I'm trying to
 get .MyBootAlarmReceiver to get called both when boot completes and when the
 SD card is finished loading, but my onReceive() method doesn't seem to be
 getting called. Any ideas?

 I suspect some simple goofup:

 ?xml version=1.0 encoding=utf-8?
 manifest xmlns:android=http://schemas.android.com/apk/res/android;
 package=x.x.x
 android:installLocation=auto
 android:versionCode=1
 android:versionName=1.0.0 

 supports-screens
 android:anyDensity=false
 android:largeScreens=true
 android:normalScreens=true
 android:smallScreens=true /

 uses-permission android:name=android.permission.WAKE_LOCK /
 uses-permission android:name=android.permission.INTERNET /
 uses-permission android:name=android.permission.BOOT_COMPLETED /
 uses-permission
 android:name=android.permission.RECEVIE_BOOT_COMPLETED /
 uses-permission
 android:name=android.permission.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE /

 application
 android:icon=@drawable/iconmain
 android:label=@string/app_name 
 uses-library android:name=com.google.android.maps /

 activity
 android:name=.Landing
 android:label=@string/app_name
 android:screenOrientation=portrait
 android:theme=@android:style/Theme.NoTitleBar 
 intent-filter
 action android:name=android.intent.action.MAIN /

 category android:name=android.intent.category.LAUNCHER /
 /intent-filter
 /activity
 activity
 android:name=.Products
 android:label=@string/prod_name 
 intent-filter
 action android:name=android.intent.action.ALTERNATIVE /

 category android:name=android.intent.category.ALTERNATIVE
 /
 /intent-filter
 /activity
 activity
 android:name=.SpecialEvents
 android:label=@string/specialevents 
 intent-filter
 action android:name=android.intent.action.ALTERNATIVE /

 category android:name=android.intent.category.ALTERNATIVE
 /
 /intent-filter
 /activity
 activity
 android:name=.Calories
 android:label=@string/cal_list 
 intent-filter
 action android:name=android.intent.action.ALTERNATIVE /

 category android:name=android.intent.category.ALTERNATIVE
 /
 /intent-filter
 /activity
 activity
 android:name=.coupon
 android:label=@string/coupon
 android:theme=@android:style/Theme.NoTitleBar 
 intent-filter
 action android:name=android.intent.action.ALTERNATIVE /

 category android:name=android.intent.category.ALTERNATIVE
 /
 /intent-filter
 /activity

 receiver
 android:name=.MyAlarmReceiver
 android:label=Notifications 
 intent-filter
 action android:name=android.intent.action.ALTERNATIVE /

 category android:name=android.intent.category.ALTERNATIVE
 /
 /intent-filter
 /receiver
 receiver
 android:name=.MyBootAlarmReceiver
 android:enabled=true
 android:exported=true
 android:label=Notifications 
 intent-filter
 action android:name=android.intent.action.BOOT_COMPLETED
 /
 action
 android:name=android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE
 /
 /intent-filter
 /receiver

 activity
 android:name=.BrowseByType
 android:label=@string/BrowseByType 
 intent-filter
 action android:name=android.intent.action.ALTERNATIVE /

 category android:name=android.intent.category.ALTERNATIVE
 /
 /intent-filter
 /activity

 /application

 uses-sdk
 android:minSdkVersion=3
 android:targetSdkVersion=14 
 /uses-sdk

 /manifest

 my class

 public class MyBootAlarmReceiver extends BroadcastReceiver {


 @Override
 public void onReceive(Context context, Intent intent) {

 try{
 Log.w(DEBUG, got the receiver);
Intent launchIntent = new Intent(context, MyAlarmReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0,
 launchIntent, 0);

AlarmManager alarmManager = (AlarmManager)
 context.getSystemService(context.ALARM_SERVICE);
long interval = 8640; // the interval is one day
long firstTime = 0;

// create a Calendar object to 

Re: [android-developers] Re: My BroadcastReceiver receiver not getting called after phone boots, any ideas?

2013-03-08 Thread bob
Also, shouldn't the broadcast receiver be for *ACTION_BOOT_COMPLETED* and 
not BOOT_COMPLETED?



On Friday, March 8, 2013 10:58:10 AM UTC-6, Mark Murphy (a Commons Guy) 
wrote:

 You do not hold the RECEIVE_BOOT_COMPLETED permission. Instead, you 
 are trying to hold the RECEVIE_BOOT_COMPLETED permission, which does 
 not exist. 

 On Fri, Mar 8, 2013 at 11:12 AM, pawpaw17 george...@yahoo.comjavascript: 
 wrote: 
  Here is most of my manifest file. I changed things around so I'm trying 
 to 
  get .MyBootAlarmReceiver to get called both when boot completes and when 
 the 
  SD card is finished loading, but my onReceive() method doesn't seem to 
 be 
  getting called. Any ideas? 
  
  I suspect some simple goofup: 
  
  ?xml version=1.0 encoding=utf-8? 
  manifest xmlns:android=http://schemas.android.com/apk/res/android; 
  package=x.x.x 
  android:installLocation=auto 
  android:versionCode=1 
  android:versionName=1.0.0  
  
  supports-screens 
  android:anyDensity=false 
  android:largeScreens=true 
  android:normalScreens=true 
  android:smallScreens=true / 
  
  uses-permission android:name=android.permission.WAKE_LOCK / 
  uses-permission android:name=android.permission.INTERNET / 
  uses-permission android:name=android.permission.BOOT_COMPLETED / 
  uses-permission 
  android:name=android.permission.RECEVIE_BOOT_COMPLETED / 
  uses-permission 
  android:name=android.permission.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE 
 / 
  
  application 
  android:icon=@drawable/iconmain 
  android:label=@string/app_name  
  uses-library android:name=com.google.android.maps / 
  
  activity 
  android:name=.Landing 
  android:label=@string/app_name 
  android:screenOrientation=portrait 
  android:theme=@android:style/Theme.NoTitleBar  
  intent-filter 
  action android:name=android.intent.action.MAIN / 
  
  category 
 android:name=android.intent.category.LAUNCHER / 
  /intent-filter 
  /activity 
  activity 
  android:name=.Products 
  android:label=@string/prod_name  
  intent-filter 
  action android:name=android.intent.action.ALTERNATIVE 
 / 
  
  category 
 android:name=android.intent.category.ALTERNATIVE 
  / 
  /intent-filter 
  /activity 
  activity 
  android:name=.SpecialEvents 
  android:label=@string/specialevents  
  intent-filter 
  action android:name=android.intent.action.ALTERNATIVE 
 / 
  
  category 
 android:name=android.intent.category.ALTERNATIVE 
  / 
  /intent-filter 
  /activity 
  activity 
  android:name=.Calories 
  android:label=@string/cal_list  
  intent-filter 
  action android:name=android.intent.action.ALTERNATIVE 
 / 
  
  category 
 android:name=android.intent.category.ALTERNATIVE 
  / 
  /intent-filter 
  /activity 
  activity 
  android:name=.coupon 
  android:label=@string/coupon 
  android:theme=@android:style/Theme.NoTitleBar  
  intent-filter 
  action android:name=android.intent.action.ALTERNATIVE 
 / 
  
  category 
 android:name=android.intent.category.ALTERNATIVE 
  / 
  /intent-filter 
  /activity 
  
  receiver 
  android:name=.MyAlarmReceiver 
  android:label=Notifications  
  intent-filter 
  action android:name=android.intent.action.ALTERNATIVE 
 / 
  
  category 
 android:name=android.intent.category.ALTERNATIVE 
  / 
  /intent-filter 
  /receiver 
  receiver 
  android:name=.MyBootAlarmReceiver 
  android:enabled=true 
  android:exported=true 
  android:label=Notifications  
  intent-filter 
  action 
 android:name=android.intent.action.BOOT_COMPLETED 
  / 
  action 
  
 android:name=android.intent.action.ACTION_EXTERNAL_APPLICATIONS_AVAILABLE 
  / 
  /intent-filter 
  /receiver 
  
  activity 
  android:name=.BrowseByType 
  android:label=@string/BrowseByType  
  intent-filter 
  action android:name=android.intent.action.ALTERNATIVE 
 / 
  
  category 
 android:name=android.intent.category.ALTERNATIVE 
  / 
  /intent-filter 
  /activity 
  
  /application 
  
  uses-sdk 
  android:minSdkVersion=3 
  android:targetSdkVersion=14  
  /uses-sdk 
  
  /manifest 
  
  my class 
  
  public class MyBootAlarmReceiver extends 

Re: [android-developers] Re: My BroadcastReceiver receiver not getting called after phone boots, any ideas?

2013-03-08 Thread Mark Murphy
On Fri, Mar 8, 2013 at 3:11 PM, bob b...@coolfone.comze.com wrote:
 Also, shouldn't the broadcast receiver be for ACTION_BOOT_COMPLETED and not
 BOOT_COMPLETED?

No. In Java, we refer to it as Intent.ACTION_BOOT_COMPLETED. The
string value associated with that public static final data member is
android.intent.action.BOOT_COMPLETED.

That's not to say that the manifest has no other issues. For example,
the ALTERNATIVE stuff is downright bizarre.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 4.6 Available!

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.