android-broadcastreceiver

Android broadcast receiver custom permissions

夙愿已清 提交于 2020-04-30 07:45:08
问题 In view of the security model in Android, I'm trying out custom permissions. I'm trying out to enforce broadcaster permissions in my application. The scenario is that I have an activity A, which triggers a broadcasts like this (with a permission) : Intent updateUserBroadcast = new Intent(); updateUserBroadcast.setAction("android.intent.action.ACTION_UPDATE_USERNAME"); updateUserBroadcast.putExtra("username", userName); sendBroadcast(updateUserBroadcast, "com.android.MaliciousApp.RECEIVE

AlarmManager not invoking the task?

☆樱花仙子☆ 提交于 2020-01-17 07:57:09
问题 I want to execute a auto-logout after 10 PM everyday in my application, for that that I have implemented a AlarmManager task but it is not invoking .For testing purpose I have given the other timing .(e.g calendar.set(Calendar.HOUR_OF_DAY,15); calendar.set(Calendar.MINUTE,59); calendar.set(Calendar.SECOND,30); ) AlarmManager Code: sign_in_button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { hideKeyboard(LoginActivity.this); //implementation of auto

How to pass custom Serializable object to BroadcastReceiver via PendingIntent

大城市里の小女人 提交于 2020-01-10 05:27:38
问题 I am trying to pass a custom Serialized object from my IntentService to a BroadcastReceiver using PendingIntent. Here is my custom object: Row.java public class Row implements Serializable { private String name; private String address; public Row(BluetoothDevice device) { this.name = device.getName(); this.address = device.getAddress(); } } Here is my IntentService MyIntentService.java public class MyIntentService extends IntentService { public MyIntentService() { super("MyIntentService"); }

BroadcastReceiver cannot show notification when app closed/killed

断了今生、忘了曾经 提交于 2020-01-04 05:17:15
问题 My task is to set a alarm to trigger receiver to show notification a specific time. And the code works perfectly if app is opened or just in background. At the time app is being killed, receiver can still be triggered when alarm is executed. However, no notification was shown. What can I do? Alarm function: public static void makeAlarm(Context context,Date date) { Log.i("Alarm", "makeAlarm"); AlarmManager alarmMgr; PendingIntent alarmIntent; alarmMgr = (AlarmManager) context.getSystemService

Properly tracking install referrals on Play Store

此生再无相见时 提交于 2019-12-31 12:53:33
问题 I have a simple task: I want to track the referral id of an app install and pass it to backend. What I did: I created a link with an extra parameter referrer and appended it to the invite link. When it is opened, the javascript detects if the browser is an Android mobile browser and then prepares an intent and issues a redirect to that intent. While preparing the intent, referrer field is extracted from the url and appended to the intent like this: intent://scan/#Intent;scheme=com.example

Properly tracking install referrals on Play Store

无人久伴 提交于 2019-12-31 12:52:44
问题 I have a simple task: I want to track the referral id of an app install and pass it to backend. What I did: I created a link with an extra parameter referrer and appended it to the invite link. When it is opened, the javascript detects if the browser is an Android mobile browser and then prepares an intent and issues a redirect to that intent. While preparing the intent, referrer field is extracted from the url and appended to the intent like this: intent://scan/#Intent;scheme=com.example

Properly tracking install referrals on Play Store

主宰稳场 提交于 2019-12-31 12:52:10
问题 I have a simple task: I want to track the referral id of an app install and pass it to backend. What I did: I created a link with an extra parameter referrer and appended it to the invite link. When it is opened, the javascript detects if the browser is an Android mobile browser and then prepares an intent and issues a redirect to that intent. While preparing the intent, referrer field is extracted from the url and appended to the intent like this: intent://scan/#Intent;scheme=com.example

Android - Cant see the incoming calls when LayoutParams.TypeSystemError is displayed

馋奶兔 提交于 2019-12-31 05:39:06
问题 I'm developing lock screen app. Here Lock screen is displayed on the top of the screen using this command "WindowManager.LayoutParams.TYPE_SYSTEM_ERROR;" But my problem is I can't See the Incoming call Window when the custom lock screen is displayed. Incoming call window is not overrided over my custom lock screen. 1) Is there any permission required for displaying the incoming call window.? 2) We have to add any other codes for answering the incoming class This is my Lockscreen receiver

I am not able to receive “android.provider.Telephony.SMS_RECEIVED” this broadcast in Android Oreo

天涯浪子 提交于 2019-12-29 00:41:50
问题 This is my Menifest file <receiver android:name="com.agribazaar.android.receivers.OTPReceiver" android:exported="true"> <intent-filter> <action android:name="android.provider.Telephony.SMS_RECEIVED" /> </intent-filter> </receiver> This is my Broadcast Receiver class public class OTPReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")){ } } 回答1: This fixed the issue for me

Boot BroadcastReceiver does not work on Xiaomi devices

不问归期 提交于 2019-12-28 04:06:34
问题 I have a following BroadcastReceiver which should run after boot completion. I have tested it on my Xiaomi device (Redmi 1s) , it's not running, while on other devices like Samsung it's running as expected. public class DeviceBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if(intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) { Toast.makeText(context, "I am Running", Toast.LENGTH_SHORT).show(); } } } I have set