broadcastreceiver

Exception when sending broadcast to ComponentInfo

十年热恋 提交于 2019-12-07 23:03:48
问题 I have a receiver for Google cloud message, it's registered in AndroidManifest.xml: <receiver android:name="com.app.android.push.HSPushReceiver" android:permission="com.google.android.c2dm.permission.SEND" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <action android:name="com.google.android.c2dm.intent.REGISTER" /> <category android:name=

update ui from broadcast receiver

雨燕双飞 提交于 2019-12-07 21:37:11
问题 I have a MainActivity where i want to update UI after a AlarmManager is called every 2 minutes.. Please help me how to do this This is my MainActivity public class MainActivity extends AppCompatActivity { private Toolbar toolbar; GPSTracker gps; TextView lat1, long1; Button exit, refresh; private PendingIntent pendingIntent; private static MainActivity mInst; double newLat, newLong; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Some devices does not receive GCM push eventhough all messages succeed from server

ε祈祈猫儿з 提交于 2019-12-07 19:01:17
问题 We're developing an application that uses GCM. It works fine on most phones, however, we have two phones (galaxy note 2 and galaxy s plus) which does not receive the messages. Or maybe it's just the broadcast receiver not being called. Server side push: $data = array( 'data' => array('message' => $messageData), 'delay_while_idle' => false, 'type' => 'New', 'flag' => 1, 'registration_ids' => $registrationIdsArray ); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt

Detect call state change in VOIP Android apps

谁都会走 提交于 2019-12-07 18:31:15
问题 Is there a way to detect the beginning/ending of voice calls in apps such as Google Hangouts / Skype? (I know this is a shot in the dark, but I was wondering if anyone researched this option). I'm interested in something like Android's receivers for the android.intent.action.PHONE_STATE and the android.intent.action.NEW_OUTGOING_CALL actions 回答1: Skype broadcast: com.skype.android.CONVERSATION_LIVE_STATE There u can read: com.skype.live_identity -> ur friend com.skype.live_status -> RINGING

Android BatteryManager Returns only 1

给你一囗甜甜゛ 提交于 2019-12-07 17:55:44
问题 I am attempting to read the state of the Android battery when my repeating alarm broadcaster is called I have the following setup: public class RepeatingAlarm extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { // Acquire the make of the device final String PhoneModel = android.os.Build.MODEL; final String AndroidVersion = android.os.Build.VERSION.RELEASE; // Grab the battery information int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);

Abort sms broadcast and/or delete received sms from inbox

半世苍凉 提交于 2019-12-07 17:53:52
问题 I am trying to write sms encryption tool. People using this tool will be able to chat without internet via sms and stay encrypted. The only thing I need is how to stop sms from particular number from getting into inbox folder, or delete sms notification and then delete sms from inbox. I googled a lot, but https://stackoverflow.com/a/3875736/705297 this is not working. Broadcast is working, I see the log message that broadcastreceiver is launched, but it doesn't abort broadcast. Also I found

Android, find the sender of an Intent for a monitoring application

一曲冷凌霜 提交于 2019-12-07 17:49:21
问题 I'm developing a monitoring application for Android listening for broadcast intents: whenever some suspicious intent pattern occurs a dialog alerting the users pops up. Indeed the intents must have been triggered by the same application, to avoid useless warnings. In general this seems not to be possible, for instance I found something here: How to find Intent source in Android? I'm asking if there is a workaround to this, for instance looking into the context or whatsoever . I really need

unregister BroadcastReceiver after app kill/crash

混江龙づ霸主 提交于 2019-12-07 17:48:45
问题 I register my custom BroadcastReceiver with registerReceiver() in onStart() and unregisterReceiver() in onStop() . Everything works fine, until someone kills the app during runtime. A new app start registered the BroadcastReceiver a second (or more) time. How can I be sure, that only one instance is registered? 来源: https://stackoverflow.com/questions/28045342/unregister-broadcastreceiver-after-app-kill-crash

Uninstall application uninstallreceiver not called

走远了吗. 提交于 2019-12-07 17:00:48
问题 After lots of google I have found some good solutions to find out uninstall receiver of application.I am referring First Link and Second Link. In Second link you can find source code of uninstalldetection created by dickfala.I have tried this code on my devices which has android 4.1.2 and 4.0.4 Os but whileing running the app on device I am not able to see logs of application in logcat and application just uninstalled from device. I know too much discussion already done on this topic but I am

How to get Call number as well as the duration of the call made by a user in Android?

拜拜、爱过 提交于 2019-12-07 15:03:42
问题 I need to get the call number as soon as he makes the call from his android mobile and then when the call ends then i need the duration of the call. 回答1: Create One broadcast receiver and write following in your receiver onReceive() method this receiver return last record of your call but make some time delay so it can return current record. Cursor c=context.getContentResolver().query(android.provider.CallLog.Calls.CONTENT_URI,null, null, null,android.provider.CallLog.Calls.DATE + " DESC");