broadcastreceiver

air native extension - possible to receive broadcast?

夙愿已清 提交于 2019-12-11 23:08:49
问题 I am developing application with Adobe Flex on AIR platform. Using native extension for Android, it is possible to send SMS from my Flex application. Would it also be possible to receive SMS with my application (receive Broadcast carrying information about incoming SMS)? More generally, is it possible to receive Android Broadcasts in my Flex application? 回答1: I found out this is possible. "The native implementation can dispatch events that the ActionScript extension code can listen for. This

Should an alarm be built with Service or BroadcastReceiver?

寵の児 提交于 2019-12-11 20:42:11
问题 I want to build an alarm application. I've seen some examples and some of them use Service and some use BroadcasterReceiver. The user will set the alarm and then when it goes off they'll have to do certain things like solve a mathematical equation or scan NFC tag before it turns off. Which one should I use? 回答1: If you are using AlarmManager with a _WAKEUP alarm, you must have the PendingIntent route to a BroadcastReceiver . The only thing Android guarantees with a _WAKEUP alarm is if you use

how to detect app launching event in android and start broadcast reciever

删除回忆录丶 提交于 2019-12-11 20:38:00
问题 I have to make a service which run in background with no icon of app and when any installed application is launched then my app detects and execute some functionality. How can I achieve that? Thanks in advance. 回答1: There is no broadcast to know when an app is launched. You can have a service running which has to periodically check the currently running tasks list to see if a particular app has been launched. You definitely can make the service run with no notification icon, but that will

Application is not receiving broadcast for camera being opened

本小妞迷上赌 提交于 2019-12-11 20:16:57
问题 I want to receive a broadcast for camera being opened. I want to block that process if some condition is true. I am not getting broadcast for camera being opened. (I can get broadcast for new picture taken, which is not what I want.) This is a piece of my manifest file: <receiver android:name=".HardwareActionListener" android:enabled="true" android:exported="true" > <intent-filter android:priority="1000" > <action android:name="android.intent.action.CAMERA_BUTTON" > </action> </intent-filter>

Why BluetoothAdapter.startDiscovery(..) require to get Bluetooth device broadcast?

半腔热情 提交于 2019-12-11 19:45:07
问题 Normally how Android Broadcast work is: app have to create BroadcastReceiver and have to register action intent for it want to get receive event. But in case of Bluetooth device discovery/scanning why it required request call through BluetoothAdapter.startDsiccovery() . Basically I want to dicover BLE device through long live Service running in Background. Any one have idea here? 回答1: private void listenPairedDevice() { Button listenBtn = (Button)findViewById(R.id.button_listen); listenBtn

Android Widget lose pending intent

旧城冷巷雨未停 提交于 2019-12-11 19:17:20
问题 I'm new on Android and I have a bit issue, I've already searched multiple forums and nothing.. I have a simple widget that shows the battery and on click it opens a activity with Popup Theme. So I have this too files, may be some method wrong? WidgetProvider: public class Widget extends AppWidgetProvider { @Override public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub super.onReceive(context, intent); context.startService(new Intent(context, Service.class

How to finish activity in broadcastreceiver onCallEnded()

亡梦爱人 提交于 2019-12-11 19:13:29
问题 I have a question, how to finish activity in brodcastreceiver onCallEnded (SIP) . There is a brodcastreceiver like this: public class IncomingCallReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { SipAudioCall incomingCall = null; try { SipAudioCall.Listener listener = new SipAudioCall.Listener() { ... @Override public void onCallEnded(SipAudioCall call) { // IncomingCallActivity.finish(); } }; Main mainActivity = (Main) context;

onReceive() method not opening application while device is in sleep mode..?

房东的猫 提交于 2019-12-11 18:56:10
问题 Hi friends i have a problem... Actually i use this code to open my application in certain time..the app is working fine but when the device is in sleep mode not working..?? public class MyBroadCastReceiver extends BroadcastReceiver { @Override public void onReceive(Context ctx, Intent intent) { Intent intent = new Intent(ctx, ActivityMain.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); ctx.startActivity(intent); } } ActivityMain.java

My AlarmManager not getting called

為{幸葍}努か 提交于 2019-12-11 18:28:50
问题 I try every code which I got from Stackoverflow or from anywhere, but not getting success in AlarmManager , my BroadcastReceiver not even getting called. Here is my code: //My AlarmManager is in MyDB.Class extends SQLiteOpenHelper{ System.out.println("Inside AlarmManager"); // Create alarm manager AlarmManager alarmMgr0 = (AlarmManager) mContext .getSystemService(Context.ALARM_SERVICE); System.out.println("Inside alarmMgr0 " + alarmMgr0); // Create pending intent & register it to your alarm

BroadcastReceiver to detect internet on background

耗尽温柔 提交于 2019-12-11 18:26:41
问题 I have a BroadcastReceiver that detects internet availablity changes. The code is working the app says online when internet is available and when I turn of WIFI or 4G it says offline. I have added this line of code to prevent the application from closing when back button is pressed: @Override public void onBackPressed() { this.moveTaskToBack(true); } When I press back button the application is put on background and the BroadcastReceiver says always offline even if internet is available. Why