android-broadcast

Android broadcast to specific 3rd party applications

孤街浪徒 提交于 2019-12-23 13:02:09
问题 I developed an android app and it sends broadcast with a custom permission. public abstract void sendBroadcast (Intent intent, String receiverPermission) Now any 3rd party app that has a broadcast receiver and declared the custom permission in their manifest will be able to listen to the broadcast. Is there a way to control which application can receive the broadcast from my application? what I'm afraid of is the custom permission gets in the hand of the wrong people and they start creating

GCM Regisration Id expiration time

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 05:25:30
问题 I'm struggling with the next issue about GCM. I read the document (GCM document) and saw the example by Google how to implement the GCM client within Android app but in the entire document there is no reference to expiration of Registration Id. I saw that question but the example there is not following the last update by Google to the GCM Demo App My questions are: Does a Regisration Id ever expire? If a Regisration Id expires, how can I know that (is there any event for that)? Thanks in

Issue in open my application from browser url in android

会有一股神秘感。 提交于 2019-12-23 04:41:42
问题 Hello friends i wnat to open my application form browser url so in my menifest file below is my code <activity android:name=".Registration" android:exported="true" > <intent-filter> <data android:scheme="rentalandroid"/> <category android:name="android.intent.category.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <action android:name="android.intent.action.VIEW" /> </intent-filter> </activity> and i want to

Manifest-declared BroadcastReceiver not picking up explicit broadcast when app is not running

蓝咒 提交于 2019-12-22 10:56:36
问题 I am trying to get two apps to communicate via broadcasts. The first app sends a broadcast using code like the following: Intent outIntent = new Intent("org.example.WHATEVER"); PackageManager pm = this.getPackageManager(); List<ResolveInfo> receivers = pm.queryBroadcastReceivers(outIntent, 0); if (receivers != null) for (ResolveInfo receiver : receivers) { Log.d("Sender", String.format("Polling %s", receiver.activityInfo.packageName)); outIntent = new Intent("org.example.WHATEVER"); outIntent

How to use NFC ACTIONS

倖福魔咒の 提交于 2019-12-22 09:01:03
问题 I am trying to register a receiver programmatically to get notified once an NFC tag is detected. As shown in my code I registered for the desired action and I created the broadcast receiver programmatically. I also added the required permission in the manifest file but the problem is that onReceive is never called. Please let me know what I am doing wrong and how to fix it. IntentFilter intentFilter1 = new IntentFilter(); intentFilter1.addAction("android.nfc.action.TAG_DISCOVERED");

Long running service consumes a lot of battery

China☆狼群 提交于 2019-12-21 11:14:06
问题 I developed an app and some people complains that it takes too much battery, it is the second most consuming process after the screen. However, in some devices it does not consumes that much battery. All the work my app do is in a service. The service is sticky and is running all the time (the android system may kill it when has low resources or pause it when device go to sleep), it has listener to the accelerometer as long as the screen is on, it is not foreground service and does not hold

Long running service consumes a lot of battery

♀尐吖头ヾ 提交于 2019-12-21 11:14:01
问题 I developed an app and some people complains that it takes too much battery, it is the second most consuming process after the screen. However, in some devices it does not consumes that much battery. All the work my app do is in a service. The service is sticky and is running all the time (the android system may kill it when has low resources or pause it when device go to sleep), it has listener to the accelerometer as long as the screen is on, it is not foreground service and does not hold

Long running service consumes a lot of battery

一个人想着一个人 提交于 2019-12-21 11:13:08
问题 I developed an app and some people complains that it takes too much battery, it is the second most consuming process after the screen. However, in some devices it does not consumes that much battery. All the work my app do is in a service. The service is sticky and is running all the time (the android system may kill it when has low resources or pause it when device go to sleep), it has listener to the accelerometer as long as the screen is on, it is not foreground service and does not hold

Can you use pending intents with localbroadcasts?

╄→гoц情女王★ 提交于 2019-12-21 07:28:49
问题 I am interested in using pending intents with local broadcasts. To make myself clear, I am using the following for registering receivers and sending broadcast: android.support.v4.content.LocalBroadcastManager . I have a local broadcast receiver in a service which works. I am trying to send local broadcasts from a custom notification layout which includes click-able items. The local broadcast receiver - just receives simple action intents. I was trying something like this to no avail: Intent

Create an automatic launch-able Broadcast Receiver in Android

丶灬走出姿态 提交于 2019-12-20 07:29:48
问题 Problem: I am willing to create an application that simply starts as a background process and whenever a new message comes into the device it should log it into a file or simply display a toast message. I have read a lot of blogs and tried to follow the steps as mentioned. But, I keep on sending messages on my device and nothing displayed not even in device log. I want to run it on devices from Froyo to Lollipop. So, I am not willing to use new Telephony API which supports API 19 and later