broadcastreceiver

Getting (not%20set) for UTM parameters with Install Referrer- Android

拈花ヽ惹草 提交于 2019-12-06 01:21:23
问题 I am using my custom broadcast receiver as follows to track UTM parameters. <receiver android:name=".services.CustomInstallListener" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER" /> </intent-filter> </receiver> public class CustomInstallListener extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.hasExtra("referrer")) { String data = intent.getStringExtra("referrer"); String referrers[]

sendOrderedBroadcast setPackage requirement in Oreo

99封情书 提交于 2019-12-05 23:54:01
Why would the following Ordered Broadcast fail in Android Oreo, unless I specifically set the package name? final Intent vrIntent = new Intent(RecognizerIntent.ACTION_GET_LANGUAGE_DETAILS); // Setting the package it will work. Omitting, it will fail // vrIntent.setPackage("com.google.android.googlequicksearchbox"); getContext().sendOrderedBroadcast(vrIntent, null, new BroadcastReceiver() { @Override public void onReceive(final Context context, final Intent intent) { // final Bundle bundle = intent.getExtras(); final Bundle bundle = getResultExtras(true); if (bundle != null) { if (bundle

android: validate the identity of intent sender

血红的双手。 提交于 2019-12-05 23:05:28
问题 I work in a company that produces several apps, not all those apps have the same signature or more like it we have at least 5-6 apps certificates for the time being. We tried to create a mechanism in which all the companie's apps on the same device share the same is, For example if user installed from the market App A and no app installed, a new ID will be generated, if now he installs App A, app B should have the same id as App A(id is just a generated UUID type #4) etc... We are using

StartActivity in android broadcast receiver

允我心安 提交于 2019-12-05 22:34:44
I registered receiving SMS broadcast in manifest.xml. How can I start new Activity in receive() method of the broadcast. is there any flags of Intent to set or anything? use FLAG_ACTIVITY_NEW_TASK like this @Override public void onReceive(Context context, Intent intent) { Intent i = new Intent(context, AlarmDialog.class); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); } 来源: https://stackoverflow.com/questions/8211754/startactivity-in-android-broadcast-receiver

What Firebase-cloud-messaging Intent-filter to use for a BroadcastReceiver?

为君一笑 提交于 2019-12-05 21:47:17
I am trying to get the Android BroadcastReceiver to run when a Firebase Cloud message notification is received by the Android system. public class MyBroadcastReceiver extends BroadcastReceiver { private static final String TAG = "MyBroadcastReceiver"; @Override public void onReceive(final Context context, Intent intent) { Toast.makeText(context, "EVENT OCCURED", Toast.LENGTH_LONG).show(); } } It is required in the AndroidManifest to specify receiver tags as such: <receiver android:name=".MyBroadcastReceiver" android:exported="true"> <intent-filter> <action android:name="android.intent.action

Abort sms broadcast and/or delete received sms from inbox

我怕爱的太早我们不能终老 提交于 2019-12-05 21:39:46
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 lots of messages that it is impossible. So is it possible and how I can do that? I am using android 2.1

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

痴心易碎 提交于 2019-12-05 21:36:44
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 the application name, not the just the application name to do something else. Cheers, Gil I'm developing

BroadcastReceiver is not working

笑着哭i 提交于 2019-12-05 21:16:54
I have implemented this broadcast reciever: public class ServiceManager extends BroadcastReceiver { private final String BOOT_ACTION = "android.intent.action.BOOT_COMPLETED"; private final String BOOT_ACTION_FIRST_LAUNCH = "android.intent.action.PACKAGE_FIRST_LAUNCH"; private final String BOOT_ACTION_RESTARTED = "android.intent.action.PACKAGE_RESTARTED"; @Override public void onReceive(Context context, Intent intent) { // All registered broadcasts are received by this String action = intent.getAction(); if (action.equalsIgnoreCase(BOOT_ACTION) || action.equalsIgnoreCase(BOOT_ACTION_FIRST

Android: Shut down / loss of bluetooth connection or file receive -> Do something

折月煮酒 提交于 2019-12-05 20:49:09
I want to write an App that monitors my paired bluetooth connection in the following way: If a file comes from a paired source it should be stored. If no file was passed and the bluetooth connection breaks down, my app shall store a dummy file. Storing a file works great, my main issue is how to run this whole thing without having an activity on my display.... I read much about services, but mostly it is said that a service is depending on an activity/app...is that right? Is there any other possibility to realize something like that? What about broadcast receivers? How can I programm this

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

断了今生、忘了曾经 提交于 2019-12-05 20:47:14
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. bindal 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"); int numberColumn = c.getColumnIndex(android.provider.CallLog.Calls.NUMBER); int dateColumn = c