android-broadcast

Pop up window over Android native incoming call screen like true caller Android app

人盡茶涼 提交于 2019-11-26 11:31:53
I am developing a broadcast receiver for incoming calls in Android and on getting incoming calls I want to inflate a pop up over the native incoming call screen. I completed that code. But now the problem is that in the Android 4.1 (Jelly Bean) API level 17 when a phone rings, the PHONE_STATE is coming as OFF HOOK , and if I am calling an activity, it gets called, but the code under it doesn't get executed. I am listing the code: My broadcast receiver package com.example.popwindowonincomingcallscreen; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService;

java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.MEDIA_MOUNTED on KitKat only

微笑、不失礼 提交于 2019-11-26 11:03:01
问题 I am using the DownloadManager to download images off our server and I am placing the files in the externalFilesDir . I am send out a broadcast intent because I don\'t want these downloaded images to appear in the gallery. sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse(\"file://\" + context.getExternalFilesDir(null)))); I only tested this on my Galaxy S3 Jelly Bean 4.3 prior and it was working, but when I tested it on KitKat 4.4 it crashes the app. Is there a better way to

Should I use android: process =“:remote” in my receiver?

拈花ヽ惹草 提交于 2019-11-26 10:10:03
问题 I have a BroadcastReceiver which is called every so often, and I have noticed many people use android: process =\":remote\" in their receiver. Mine is used to check a few things and if the conditions match then activate an alarm. My question is should I use the line I had posted above in my manifest? And if so what are the benefits of doing so? 回答1: By defining your receiver with android:process=":remote" you basically run your receiver in a different process (= VM). For typical use-cases,

what is the difference between sendStickyBroadcast and sendBroadcast in Android

↘锁芯ラ 提交于 2019-11-26 10:09:56
问题 What is the difference between sendStickyBroadcast and sendBroadcast in Android? 回答1: Here is what the Android SDK says about sendStickyBroadcast(): Perform a sendBroadcast(Intent) that is "sticky," meaning the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of registerReceiver(BroadcastReceiver, IntentFilter). In all other ways, this behaves the same as sendBroadcast(Intent). One example of a sticky

Listen to own application uninstall event on Android

人走茶凉 提交于 2019-11-26 08:13:38
问题 As far as I know, apps can\'t get intents for their own uninstallation: ACTION_PACKAGE_FULLY_REMOVED ACTION_PACKAGE_REMOVED But how does Dolphin Browser manage to receive a \"removed\" event and start a browser as in the attached image? ADB: 10-20 12:37:00.997: D/BackupManagerService(527): Received broadcast Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:mobi.mgeek.TunnyBrowser flg=0x8000010 (has extras) } 10-20 12:37:00.997: V/BackupManagerService(527):

How to get sms sent confirmation for each contact/person in android?

*爱你&永不变心* 提交于 2019-11-26 05:38:26
问题 I want to send sms to multiple people and verify whether sms sent or not. I checked multiple links (mentioned here) and got the idea of using PendingIntent and broadCast Receiver for confirmation. Practical way to find out if SMS has been sent Sending text messages programmatically in android http://mobiforge.com/design-development/sms-messaging-android But the key problem is that, I have different 50 contacts number in an arrayList and their different msgs in another arrayList . I use this

Android Broadcast Receiver bluetooth events catching

删除回忆录丶 提交于 2019-11-26 05:34:29
问题 I\'m trying to catch bluetooth state changes with Broadcast Receiver. My manifest: <uses-permission android:name=\"android.permission.BLUETOOTH\" /> <application> <activity android:name=\".MainActivity\" android:label=\"@string/app_name\" > <intent-filter> <action android:name=\"android.intent.action.MAIN\" /> <category android:name=\"android.intent.category.LAUNCHER\" /> </intent-filter> </activity> <receiver android:name=\".BluetoothBroadcastReceiver\" android:label=\"@string/app_name\">