android Programming Glossary: receiver
Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4) http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4 class. To receive SMS messages I had to register a receiver in the AndroidMainfest.xml file. Then I had to override the.. Activity 2 ... activity More acitivies ... SMS Receiver receiver android name com.myexample.receivers.SMSReceiver intent filter.. ... SMS Receiver receiver android name com.myexample.receivers.SMSReceiver intent filter action android name android.provider.Telephony.SMS_RECEIVED..
How can I check the current status of the GPS receiver? http://stackoverflow.com/questions/2021176/how-can-i-check-the-current-status-of-the-gps-receiver can I check the current status of the GPS receiver How can I check the current status of the GPS receiver I already.. receiver How can I check the current status of the GPS receiver I already checked the LocationListener onStatusChanged method..
Trying to start a service on boot on Android http://stackoverflow.com/questions/2784441/trying-to-start-a-service-on-boot-on-android is working. Am I forgetting something AndroidManifest.xml receiver android name .StartServiceAtBootReceiver android enabled true.. name android.intent.action._BOOT_COMPLETED intent filter receiver service android name com.test.RunService android enabled true.. Service loaded at start Thanks android service broadcastreceiver share improve this question The other answers look good but..
Download a file with Android, and showing the progress in a ProgressDialog http://stackoverflow.com/questions/3028306/download-a-file-with-android-and-showing-the-progress-in-a-progressdialog urlToDownload intent.getStringExtra url ResultReceiver receiver ResultReceiver intent.getParcelableExtra receiver try URL url.. receiver ResultReceiver intent.getParcelableExtra receiver try URL url new URL urlToDownload URLConnection connection url.openConnection.. resultData.putInt progress int total 100 fileLength receiver.send UPDATE_PROGRESS resultData output.write data 0 count ..
Restful API service http://stackoverflow.com/questions/3197335/restful-api-service null this QueryService.class intent.putExtra receiver mReceiver intent.putExtra command query startService intent.. public void onPause mReceiver.setReceiver null clear receiver so no leaks. public void onReceiveResult int resultCode Bundle.. void onHandleIntent Intent intent final ResultReceiver receiver intent.getParcelableExtra receiver String command intent.getStringExtra..
Alarm Manager Example http://stackoverflow.com/questions/4459058/alarm-manager-example name android.permission.WAKE_LOCK uses permission ... receiver android process remote android name Alarm receiver ... Code.. ... receiver android process remote android name Alarm receiver ... Code package YourPackage import android.app.AlarmManager.. uses permission ... receiver android name .AutoStart intent filter action android name android.intent.action.BOOT_COMPLETED..
How to Autostart an Android Application? http://stackoverflow.com/questions/1056570/how-to-autostart-an-android-application permissions that your app uses . Then implement BroadcastReceiver class it should be simple and fast executable. The best approach.. running ale the time as Prahast wrote . public class BootUpReceiver extends BroadcastReceiver @Override public void onReceive Context.. wrote . public class BootUpReceiver extends BroadcastReceiver @Override public void onReceive Context context Intent intent..
Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4) http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4 I had to override the onReceive method of the BroadcastReceiver . I have included examples below. MainActivity.java public class.. piSent piDelivered More methods of MainActivity ... SMSReceiver.java public class SMSReceiver extends BroadcastReceiver private.. of MainActivity ... SMSReceiver.java public class SMSReceiver extends BroadcastReceiver private final String DEBUG_TAG getClass..
Android PendingIntent extras, not received by BroadcastReceiver http://stackoverflow.com/questions/14571564/android-pendingintent-extras-not-received-by-broadcastreceiver PendingIntent extras not received by BroadcastReceiver When I pass extras to a PendingIntent the message is never.. the message is never received by the sendBroadcastReceiver because the onReceive method of this BroadcastReceiver is never.. because the onReceive method of this BroadcastReceiver is never called. Why is this happening public class MainActivity..
Restful API service http://stackoverflow.com/questions/3197335/restful-api-service data from a RESTful Web Service you should look into ResultReceiver and IntentService . This Service ResultReceiver pattern works.. into ResultReceiver and IntentService . This Service ResultReceiver pattern works by starting or binding to the service with startService.. specify the operation to perform and pass in your ResultReceiver the activity through the extras in the Intent. In the service..
Get referrer after installing app from Android Market http://stackoverflow.com/questions/4093150/get-referrer-after-installing-app-from-android-market from Android Market I am trying to register a Broadcast Receiver that catches com.android.vending.INSTALL_REFERRER intents launched.. to my manifest file receiver android name com.test.Receiver android exported true intent filter action android name com.android.vending.INSTALL_REFERRER.. intent filter receiver and created a basic BroadcastReceiver class public class Receiver extends BroadcastReceiver @Override..
Enable and disable a Broadcast Receiver http://stackoverflow.com/questions/5624470/enable-and-disable-a-broadcast-receiver and disable a Broadcast Receiver I try to enable and disable a broadcast receiver by using this.. com.app .broadcast_receivers.OnNetworkChangedReceiver pm.setComponentEnabledSetting componentName PackageManager.COMPONENT_ENABLED_STATE_DISABLED.. receiver android name .broadcast_receivers.OnNetworkChangedReceiver android enabled true intent filter action android name android.net.conn.CONNECTIVITY_CHANGE..
How to test android referral tracking? http://stackoverflow.com/questions/5890914/how-to-test-android-referral-tracking n your.package . path.up.until.your.BroadcastReceiver es referrer utm_source test_source utm_medium test_medium utm_term.. .util.broadcast_receivers.FacadeBroadcastReceiver es referrer utm_source test_source utm_medium test_medium utm_term.. test_content utm_campaign test_name But your BroadcastReceiver may need to be the AnalyticsReceiver i.e. your.package com.google.android.apps.analytics.AnalyticsReceiver..
How to set Alarm in Android? http://stackoverflow.com/questions/6520403/how-to-set-alarm-in-android this Alarm worked. Toast.LENGTH_LONG .show and my Receiver class is import android.app.Notification import android.app.NotificationManager.. android.app.PendingIntent import android.content.BroadcastReceiver import android.content.Context import android.content.Intent.. android.widget.Toast public class Mote extends BroadcastReceiver public void onReceive Context context Intent intent TODO Auto..
Get GPS Location in a Broadcast Receiver/or Service to Broadcast Receiver data transfer http://stackoverflow.com/questions/7709030/get-gps-location-in-a-broadcast-receiver-or-service-to-broadcast-receiver-data-t GPS Location in a Broadcast Receiver or Service to Broadcast Receiver data transfer I am new to.. Location in a Broadcast Receiver or Service to Broadcast Receiver data transfer I am new to android. I want to get GPS Location.. share improve this question From BroadcastReceiver I could not start Location Manager as well. So I started a service..
How to run a service every day at noon, and on every boot http://stackoverflow.com/questions/7845660/how-to-run-a-service-every-day-at-noon-and-on-every-boot inside a method Intent intent new Intent context AlarmReceiver.class intent.setAction packagename.ACTION PendingIntent pendingIntent.. AlarmManager.INTERVAL_DAY pendingIntent Receiver for your interval public class AlarmReceiver extends BroadcastReceiver.. pendingIntent Receiver for your interval public class AlarmReceiver extends BroadcastReceiver private final String SOMEACTION packagename.ACTION..
Android Broadcast Receiver for Sent SMS messages? http://stackoverflow.com/questions/990558/android-broadcast-receiver-for-sent-sms-messages Broadcast Receiver for Sent SMS messages I created a BroadcastReceiver and configured.. Receiver for Sent SMS messages I created a BroadcastReceiver and configured it with an android.provider.Telephony.SMS_RECEIVED.. there is currently no way to implement a BroadcastReceiver because the standard sms application uses a SmsManger to send..
Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4) http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4 and sendMultipartTextMessage methods of the SmsManager class. To receive SMS messages I had to register a receiver in the AndroidMainfest.xml file. Then I had to override the onReceive method of the BroadcastReceiver . I have included.. intent filter activity activity Activity 2 ... activity More acitivies ... SMS Receiver receiver android name com.myexample.receivers.SMSReceiver intent filter action android name android.provider.Telephony.SMS_RECEIVED.. filter activity activity Activity 2 ... activity More acitivies ... SMS Receiver receiver android name com.myexample.receivers.SMSReceiver intent filter action android name android.provider.Telephony.SMS_RECEIVED intent filter receiver application..
How can I check the current status of the GPS receiver? http://stackoverflow.com/questions/2021176/how-can-i-check-the-current-status-of-the-gps-receiver can I check the current status of the GPS receiver How can I check the current status of the GPS receiver I already checked the LocationListener onStatusChanged method but.. can I check the current status of the GPS receiver How can I check the current status of the GPS receiver I already checked the LocationListener onStatusChanged method but somehow it seems that is not working or just the wrong..
Trying to start a service on boot on Android http://stackoverflow.com/questions/2784441/trying-to-start-a-service-on-boot-on-android I've looked a number of links online but none of the code is working. Am I forgetting something AndroidManifest.xml receiver android name .StartServiceAtBootReceiver android enabled true android exported false android label StartServiceAtBootReceiver.. label StartServiceAtBootReceiver intent filter action android name android.intent.action._BOOT_COMPLETED intent filter receiver service android name com.test.RunService android enabled true BroadcastReceiver public void onReceive Context context Intent.. context.startService serviceLauncher Log.v TEST Service loaded at start Thanks android service broadcastreceiver share improve this question The other answers look good but I thought I'd wrap everything up into one complete answer...
Download a file with Android, and showing the progress in a ProgressDialog http://stackoverflow.com/questions/3028306/download-a-file-with-android-and-showing-the-progress-in-a-progressdialog @Override protected void onHandleIntent Intent intent String urlToDownload intent.getStringExtra url ResultReceiver receiver ResultReceiver intent.getParcelableExtra receiver try URL url new URL urlToDownload URLConnection connection url.openConnection.. intent String urlToDownload intent.getStringExtra url ResultReceiver receiver ResultReceiver intent.getParcelableExtra receiver try URL url new URL urlToDownload URLConnection connection url.openConnection connection.connect this will be useful so.. count publishing the progress.... Bundle resultData new Bundle resultData.putInt progress int total 100 fileLength receiver.send UPDATE_PROGRESS resultData output.write data 0 count output.flush output.close input.close catch IOException e..
Restful API service http://stackoverflow.com/questions/3197335/restful-api-service this ... final Intent intent new Intent Intent.ACTION_SYNC null this QueryService.class intent.putExtra receiver mReceiver intent.putExtra command query startService intent public void onPause mReceiver.setReceiver null clear receiver.. mReceiver intent.putExtra command query startService intent public void onPause mReceiver.setReceiver null clear receiver so no leaks. public void onReceiveResult int resultCode Bundle resultData switch resultCode case RUNNING show progress.. public class QueryService extends IntentService protected void onHandleIntent Intent intent final ResultReceiver receiver intent.getParcelableExtra receiver String command intent.getStringExtra command Bundle b new Bundle if command.equals query..
Alarm Manager Example http://stackoverflow.com/questions/4459058/alarm-manager-example phone turns off. Add to Manifest.xml ... uses permission android name android.permission.WAKE_LOCK uses permission ... receiver android process remote android name Alarm receiver ... Code package YourPackage import android.app.AlarmManager import android.app.PendingIntent.. android name android.permission.WAKE_LOCK uses permission ... receiver android process remote android name Alarm receiver ... Code package YourPackage import android.app.AlarmManager import android.app.PendingIntent import android.content.BroadcastReceiver.. permission to Manifest.xml uses permission android name android.permission.RECEIVE_BOOT_COMPLETED uses permission ... receiver android name .AutoStart intent filter action android name android.intent.action.BOOT_COMPLETED action intent filter receiver..
How to Autostart an Android Application? http://stackoverflow.com/questions/1056570/how-to-autostart-an-android-application of course you should list all other permissions that your app uses . Then implement BroadcastReceiver class it should be simple and fast executable. The best approach is to set an alarm in this receiver to wake up your service.. to wake up your service if it's not necessary to keep it running ale the time as Prahast wrote . public class BootUpReceiver extends BroadcastReceiver @Override public void onReceive Context context Intent intent AlarmManager am AlarmManager context.getSystemService.. if it's not necessary to keep it running ale the time as Prahast wrote . public class BootUpReceiver extends BroadcastReceiver @Override public void onReceive Context context Intent intent AlarmManager am AlarmManager context.getSystemService Context.ALARM_SERVICE..
Sending and Receiving SMS and MMS in Android (pre Kit Kat Android 4.4) http://stackoverflow.com/questions/14452808/sending-and-receiving-sms-and-mms-in-android-pre-kit-kat-android-4-4 to register a receiver in the AndroidMainfest.xml file. Then I had to override the onReceive method of the BroadcastReceiver . I have included examples below. MainActivity.java public class MainActivity extends Activity private static String SENT.. null else smsManager.sendTextMessage phoneNumber null message piSent piDelivered More methods of MainActivity ... SMSReceiver.java public class SMSReceiver extends BroadcastReceiver private final String DEBUG_TAG getClass .getSimpleName .toString.. phoneNumber null message piSent piDelivered More methods of MainActivity ... SMSReceiver.java public class SMSReceiver extends BroadcastReceiver private final String DEBUG_TAG getClass .getSimpleName .toString private static final String ACTION_SMS_RECEIVED..
Android PendingIntent extras, not received by BroadcastReceiver http://stackoverflow.com/questions/14571564/android-pendingintent-extras-not-received-by-broadcastreceiver PendingIntent extras not received by BroadcastReceiver When I pass extras to a PendingIntent the message is never received by the sendBroadcastReceiver because the onReceive.. received by BroadcastReceiver When I pass extras to a PendingIntent the message is never received by the sendBroadcastReceiver because the onReceive method of this BroadcastReceiver is never called. Why is this happening public class MainActivity.. PendingIntent the message is never received by the sendBroadcastReceiver because the onReceive method of this BroadcastReceiver is never called. Why is this happening public class MainActivity extends Activity private static String SENT SMS_SENT private..
Restful API service http://stackoverflow.com/questions/3197335/restful-api-service to be. Since you have a simple use case of getting some data from a RESTful Web Service you should look into ResultReceiver and IntentService . This Service ResultReceiver pattern works by starting or binding to the service with startService when.. some data from a RESTful Web Service you should look into ResultReceiver and IntentService . This Service ResultReceiver pattern works by starting or binding to the service with startService when you want to do some action. You can specify the.. with startService when you want to do some action. You can specify the operation to perform and pass in your ResultReceiver the activity through the extras in the Intent. In the service you implement onHandleIntent to do the operation that is specified..
Get referrer after installing app from Android Market http://stackoverflow.com/questions/4093150/get-referrer-after-installing-app-from-android-market referrer after installing app from Android Market I am trying to register a Broadcast Receiver that catches com.android.vending.INSTALL_REFERRER intents launched by Android after an app is installed from the Market... so I have created my own solution. I have added the following to my manifest file receiver android name com.test.Receiver android exported true intent filter action android name com.android.vending.INSTALL_REFERRER intent filter receiver and.. filter action android name com.android.vending.INSTALL_REFERRER intent filter receiver and created a basic BroadcastReceiver class public class Receiver extends BroadcastReceiver @Override public void onReceive Context context Intent intent Bundle..
Enable and disable a Broadcast Receiver http://stackoverflow.com/questions/5624470/enable-and-disable-a-broadcast-receiver and disable a Broadcast Receiver I try to enable and disable a broadcast receiver by using this PackageManager method setComponentEnabledSetting componentName.. .getPackageManager ComponentName componentName new ComponentName com.app .broadcast_receivers.OnNetworkChangedReceiver pm.setComponentEnabledSetting componentName PackageManager.COMPONENT_ENABLED_STATE_DISABLED PackageManager.DONT_KILL_APP.. PackageManager.DONT_KILL_APP Android manifest receiver android name .broadcast_receivers.OnNetworkChangedReceiver android enabled true intent filter action android name android.net.conn.CONNECTIVITY_CHANGE intent filter receiver The..
How to test android referral tracking? http://stackoverflow.com/questions/5890914/how-to-test-android-referral-tracking a terminal adb shell am broadcast a com.android.vending.INSTALL_REFERRER n your.package . path.up.until.your.BroadcastReceiver es referrer utm_source test_source utm_medium test_medium utm_term test_term utm_content test_content utm_campaign test_name.. am broadcast a com.android.vending.INSTALL_REFERRER n net.lp.collectionista .util.broadcast_receivers.FacadeBroadcastReceiver es referrer utm_source test_source utm_medium test_medium utm_term test_term utm_content test_content utm_campaign test_name.. utm_medium test_medium utm_term test_term utm_content test_content utm_campaign test_name But your BroadcastReceiver may need to be the AnalyticsReceiver i.e. your.package com.google.android.apps.analytics.AnalyticsReceiver . As Luigi said..
How to set Alarm in Android? http://stackoverflow.com/questions/6520403/how-to-set-alarm-in-android cal.getTimeInMillis pendingIntent Toast.makeText this Alarm worked. Toast.LENGTH_LONG .show and my Receiver class is import android.app.Notification import android.app.NotificationManager import android.app.PendingIntent import.. import android.app.NotificationManager import android.app.PendingIntent import android.content.BroadcastReceiver import android.content.Context import android.content.Intent import android.widget.Toast public class Mote extends BroadcastReceiver.. android.content.Context import android.content.Intent import android.widget.Toast public class Mote extends BroadcastReceiver public void onReceive Context context Intent intent TODO Auto generated method stub Toast.makeText context Alarm worked...
Get GPS Location in a Broadcast Receiver/or Service to Broadcast Receiver data transfer http://stackoverflow.com/questions/7709030/get-gps-location-in-a-broadcast-receiver-or-service-to-broadcast-receiver-data-t GPS Location in a Broadcast Receiver or Service to Broadcast Receiver data transfer I am new to android. I want to get GPS Location in a broadcast receiver.. GPS Location in a Broadcast Receiver or Service to Broadcast Receiver data transfer I am new to android. I want to get GPS Location in a broadcast receiver but it shows an error. My code is.. I get it in the Broadcast receiver android service broadcastreceiver share improve this question From BroadcastReceiver I could not start Location Manager as well. So I started a service on BroadcastReceiver and in that service I manipulated..
How to run a service every day at noon, and on every boot http://stackoverflow.com/questions/7845660/how-to-run-a-service-every-day-at-noon-and-on-every-boot the alarms on phone wake. Now with code example Setting alarm inside a method Intent intent new Intent context AlarmReceiver.class intent.setAction packagename.ACTION PendingIntent pendingIntent PendingIntent.getBroadcast context 0 intent PendingIntent.FLAG_CANCEL_CURRENT.. alarm.setRepeating AlarmManager.RTC_WAKEUP calendar.getTimeInMillis AlarmManager.INTERVAL_DAY pendingIntent Receiver for your interval public class AlarmReceiver extends BroadcastReceiver private final String SOMEACTION packagename.ACTION.. calendar.getTimeInMillis AlarmManager.INTERVAL_DAY pendingIntent Receiver for your interval public class AlarmReceiver extends BroadcastReceiver private final String SOMEACTION packagename.ACTION packagename is com.whatever.www @Override public..
Android Broadcast Receiver for Sent SMS messages? http://stackoverflow.com/questions/990558/android-broadcast-receiver-for-sent-sms-messages Broadcast Receiver for Sent SMS messages I created a BroadcastReceiver and configured it with an android.provider.Telephony.SMS_RECEIVED action.. Broadcast Receiver for Sent SMS messages I created a BroadcastReceiver and configured it with an android.provider.Telephony.SMS_RECEIVED action filter so it is called everytime the phone receives.. sms broadcastreceiver share improve this question Unfortunately there is currently no way to implement a BroadcastReceiver because the standard sms application uses a SmsManger to send the messages but specifies concrete internal classes for the..
|