broadcastreceiver

From which SDK level is android.intent.action.SIM_STATE_CHANGED broadcast intent supported?

﹥>﹥吖頭↗ 提交于 2019-12-12 04:44:53
问题 I have an app in the market (SIM Locked Notifier) that relies on a broadcast receiver that reacts upon receiving a broadcast intent for *android.intent.action.SIM_STATE_CHANGED*.. I developed the app for the latest version, 4.0.3 (i.e. SDK level 15) and now I'd like to extend its compatibility to lower levels (providing runtime checks for unavailable things, like action bar or preference fragments)... The problem is that I'd like to understand if the *SIM_STATE_CHANGED* event is generated

Background Audio for a Call in Progress - Possible?

放肆的年华 提交于 2019-12-12 04:36:51
问题 I am writing a android app which is supposed to play back a audio file when a call is in progress coming from a specific number .. I tried many approaches.. but all went in vein Separate Thread Listener on Telephone service starting a service in parallel can any one please help me how to proceed regarding this ? Update : I am able to play a mp3 file on call recieve and i am able to play it load on speaker.. but how ever loud i play the calling party is not able to listen to it.... is there

android USB connection charging signals

丶灬走出姿态 提交于 2019-12-12 04:35:38
问题 How can I check the USB socket is plugged or not (Charging with AC / USB)? (android version 2.1 / 2.2) I am writing a wireless charging application that I want to get different types of charging signals ( wireless , AC charging / USB ). I used broadcastReceiver to get the charging signal and found that using wireless charging and AC charging return the same signal (AC charging). To distinguish wireless charging and AC charging, I want to detect the USB socket is plugged or not. I try to use

Schedule notification not triggered

徘徊边缘 提交于 2019-12-12 04:28:42
问题 I have an application that i want it to launch a notification every x days(predefined by user). For that I'm using this code: Class extends broadcast receiver: public class OnAlarmReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { String ns = Context.NOTIFICATION_SERVICE; NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(ns); int icon = R.drawable.icon; CharSequence tickerText = "Votre vidange approche"

BroadcastReceiver in Singleton class not receiving intents

空扰寡人 提交于 2019-12-12 04:06:48
问题 I have a Broadcast receiver in a singleton class that's not receiving Broadcast intents. The singleton is initialized with a context (i.e. getInstance(context)). I call getContext().sendBroadcast(intent); but the BroadcastReceiver doesn't get anything. I've confirmed the intent filters are matching. The way I register the receiver is in my singleton constructor like so private class Singleton(Context context) { context.registerReceiver(mReceiver, INTENT_FILTER); .... private onDestroy(Context

How to send and get data between Service and BroadcastReceiver?

前提是你 提交于 2019-12-12 03:57:02
问题 In my previous question: How to keep and access data in BroadcastReceiver? I've got excellent answers, but here I focus on this. There is BroadcastReceiver and there is Service. I would like to send some data from the receiver to service and get the data back. The party which initiates the transfer is receiver, not the service. For the sake of the simplicity, let's say that receiver waits for SCREEN_ON and then asks service "is this a birthday of the user", and server returns true or false.

On broadcast receiver, check for write permission android M

浪子不回头ぞ 提交于 2019-12-12 03:53:21
问题 I use broadcastreceiver of media folder android.hardware.action.NEW_PICTURE service to rename and move image using this code and it was running: CameraReciver package perim.ebrahimi.ir.perim; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.database.Cursor; public class CameraReciver extends BroadcastReceiver { private States states; private SessionManager session; private WriteService main; @Override public void onReceive

Why notifications are getting fired multiple times on retrieving data from Firebase?

倾然丶 夕夏残阳落幕 提交于 2019-12-12 03:47:13
问题 I have a button, when I press it some data is fetched from FirebaseDatabase and then a notification is fired. Here's how: aReference.child(rID).addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { if (dataSnapshot.getValue() != null) { Map<String, String> newRequest = (Map<String, String>) dataSnapshot.getValue(); uAU = newRequest.get("pName"); final int m = (int) ((new Date().getTime() / 1000L) % Integer.MAX_VALUE); Intent

Android Broadcastlistener to start from code at some specifc event

孤人 提交于 2019-12-12 03:43:53
问题 As described in question I want to start a broadcast receiver on some event say a button click so I don't want to use it in xml. Any idea how to do this I searched on net but most of example are using xml for this Regard's Saurabh 回答1: Put this code to your button onClick listener. It creates a receiver, handler, and intent filter, sets the action your receiver should be registered for and register it. Dont' forget to unregister it after all the work will be done. // this goes before onCreate

How to make android application listen to specific NFC chip? [duplicate]

无人久伴 提交于 2019-12-12 03:39:24
问题 This question already has answers here : How to use NFC ACTIONS (5 answers) Closed 4 months ago . I'm creating application that do some action if hit NFC chip , I know the following information about NFC in Android please correct me if I am wrong you can't register actions of the NFC to receiver in the manifest file , only activities . each NFC chip has it's own unique id . what I want to do is while the Application is in the background or it's closed , if I hit NFC chip with id (ex 1234) my