broadcastreceiver

Activity Listener - Google Cloud Messaging - BroadcastReceiver

左心房为你撑大大i 提交于 2019-12-21 05:33:27
问题 I have implemented GCM in my android application and it's working fine with receiving messages. The BroadcastReceiver is set up in the manifest-file according to the examples provided by Google. My question is the following: If the user is having the application open and I want to update some results in that view - how can this be done? I was first thinking of registering this activity as a listener on whatever the BroadCastReceiver recieves. However, this must then be a static list of

Problem acquiring wake lock from broadcast receiver

孤街浪徒 提交于 2019-12-21 04:39:24
问题 I have a problem. I am trying to make a broadcast receiver acquire a wake lock so my alarm will wake the phone from sleep mode. In the broadcast receiver below, the program crashes with "source not found" on line "sCpuWakeLock.acquire(); when the class "AlarmAlertWakeLock" is called by AlarmReceiver. Any idea what's going on? Is there a better way to do what I'm trying to do? In one file: import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent;

launching an activity from a broadcast receiver that listens to outgoing call

泪湿孤枕 提交于 2019-12-21 04:32:09
问题 I am trying to launch an activity from a broadcast receiver that listens to outgoing call which is 5556. The problem is, the activity is not being launched but the dial inbuilt activity is being called, I have changed the priority of the intent to 100 but to no avail. How do I get the activity to launch at dial instead of the inbuilt calling activity? Here is the code: package com.messageHider; import android.content.BroadcastReceiver; import android.content.Context; import android.content

launching an activity from a broadcast receiver that listens to outgoing call

落花浮王杯 提交于 2019-12-21 04:31:25
问题 I am trying to launch an activity from a broadcast receiver that listens to outgoing call which is 5556. The problem is, the activity is not being launched but the dial inbuilt activity is being called, I have changed the priority of the intent to 100 but to no avail. How do I get the activity to launch at dial instead of the inbuilt calling activity? Here is the code: package com.messageHider; import android.content.BroadcastReceiver; import android.content.Context; import android.content

Permission Denial With Broadcast Receiver

吃可爱长大的小学妹 提交于 2019-12-21 03:52:40
问题 I am trying to create an app which enters a log message when I make an outgoing call. However, when I run the code, I get a permission denial, despite the fact that I have entered in the permissions. Denial Log: "09-04 02:35:50.535 1294-1666/? W/BroadcastQueue﹕ Permission Denial: receiving Intent { act=android.intent.action.NEW_OUTGOING_CALL flg=0x10000010 (has extras) } to samples.varma.packagecom.testreceive2/.CallReceiver requires android.permission.PROCESS_OUTGOING_CALLS due to sender

Headset button double click in android

北城余情 提交于 2019-12-21 02:37:22
问题 I used this code for detecting single and double click for headset button in my broadcast receiver: int d = 0; @Override public void onReceive(Context context, Intent intent) { String intentAction = intent.getAction(); if (!Intent.ACTION_MEDIA_BUTTON.equals(intentAction)) { return; } KeyEvent event = (KeyEvent) intent .getParcelableExtra(Intent.EXTRA_KEY_EVENT); if (event == null) { return; } int action = event.getAction(); switch (event.getKeyCode()) { case KeyEvent.KEYCODE_HEADSETHOOK: if

Intercepting an intent from an external application

孤者浪人 提交于 2019-12-21 02:34:50
问题 Suppose I want to develop an application that extends in some way (let me say "cooperate with") a very popular application I obviously don't have control over. Let us also suppose, for sake of simplicity, that the very famous application author won't release an update to block my application. I studied the application's functionality and identified that it widely uses BroadcastReceiver s. I also know, from manifest, the com.famousvendor.intent.INTENT_NAME constants I might use. The question

Important DONT's for a good android app design(Beginner/Novice Level)?

只愿长相守 提交于 2019-12-20 15:30:32
问题 Can anyone point to a good source or come up with a brief listing of conceptual android programming DONT's when designing an App? I dont want my question to be vague, so I'll give dummy examples(which might not make any sense or may be completely incorrect) to explain what kind of answers I am looking for are things like : Eg: Avoiding these help you design/program robust android apps Dont acquire wake locks when waiting for a server response OR Dont have this logic in OnReceive of a

Is it possible to read the call cost history from dialogue raised after ending the prepaid call?

柔情痞子 提交于 2019-12-20 09:37:29
问题 Is there a possibility of handling the data displayed on call cost dialogue received by prepaid user. I want to save all the balance reduction for along with call duration in my sqlite db. 回答1: As we learn from the already famous blog post As a start, look at the PhoneUtils class in the Android source code. [...] Specifically, looking at line 217, an intent with the name “com.android.ussd.IExtendedNetworkService” is being composed. So what you need to do is implement your own service that

How to make app lock app in android?

可紊 提交于 2019-12-20 08:12:43
问题 I have to develop an app locker for Android where the user can block apps and other users can not access these apps without an access key. I have installed an app but I don't know how to lock this app. Please suggest me something. 回答1: This is not how stack overflow works. You can not ask a complete solution without even trying anything. For the most basic version of your app, you need to perform three functions. Get a list of all the installed apps on device and show them in a ListView with