Android Open Source - Tweety Boot Receiver






From Project

Back to project page Tweety.

License

The source code is released under:

Apache License

If you think the Android project Tweety listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/* ========================================================================
 * Copyright 2010, Handy Codeworks LLC// w w w. j av a 2 s  .c  o  m
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ========================================================================
 */
package com.handycodeworks.tweety;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class BootReceiver extends BroadcastReceiver{
    private static final String TAG = "BootReceiver";
    @Override
    public void onReceive(Context context, Intent intent) {
  
  // Only start service is preference enabled
  SharedPreferences prefs = context.getSharedPreferences("prefs", context.MODE_PRIVATE);
  if(prefs.getBoolean("boot", false))
      context.startService(new Intent(context,UpdateService.class));
    }

}




Java Source Code List

com.handycodeworks.tweety.About.java
com.handycodeworks.tweety.BootReceiver.java
com.handycodeworks.tweety.DatabaseOpenHelper.java
com.handycodeworks.tweety.LocationHelper.java
com.handycodeworks.tweety.Prefs.java
com.handycodeworks.tweety.TimelineAdapter.java
com.handycodeworks.tweety.Timeline.java
com.handycodeworks.tweety.Tweety.java
com.handycodeworks.tweety.UpdateService.java
com.handycodeworks.tweety.WebViewActivity.java