broadcastreceiver

Google Analytics for Android v2 Campaign Tracking Not Working

╄→尐↘猪︶ㄣ 提交于 2019-12-04 21:36:43
问题 I have spent a ton of time on this, and am now pulling my hair out. I am using the Google Analytics Android SDK v2. I have been using it for months, and have collected data using EasyTracker . No issues there. I recently tried to implement Campaign Tracking, and everything seemed okay, but after weeks in the market even with hundreds of referral downloads, I saw no data. I recently looked into how to test it and found this: stackoverflow.com/questions/5890914/how-to-test-android-referral

Android MMS Monitoring

一个人想着一个人 提交于 2019-12-04 21:26:25
I have spent the last several hours trying to research this and understand it, however i've come up empty on every example I tried. Basically my app can send information via MMS to someone else, though the content is in a format that the native inbox doesn't display correctly. Sending the content works fine, however I need to be able to detect the incoming MMS message and open the content in my application to format it correctly. Are there any decent tutorials for this? Of the ones i've found it seems like there's a good amount of information that is missing so I usually end up with errors, or

How do I set a broadcast receiver

前提是你 提交于 2019-12-04 21:14:15
I want to set a broadcast receiver to run some function when it gets the broadcast message, in this example, I want to catch the download's manager intent: DownloadManager.ACTION_DOWNLOAD_COMPLETE I looked at the Android API examples and haven't found a way to do this You should read this first: http://developer.android.com/reference/android/content/BroadcastReceiver.html Then look here for examples. Android Samples: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/appwidget/ExampleBroadcastReceiver.html Blog post: http://www.androidcompetencycenter.com/2009

How to send data to a running activity from Broadcast Receiver,

大兔子大兔子 提交于 2019-12-04 21:09:40
问题 I am able to receive C2DM message fine but I want to send the data to a running activity, i.e when the activity is running, if the receiver receives C2DM message it is to send the data to the running activity. The code of receiver is (no bugs in the code): public class C2dmreceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); Log.w("C2DM", "Message Receiver called"); if ("com.google.android.c2dm.intent

How to detect that i have received an email/gmail on my Android Device?

流过昼夜 提交于 2019-12-04 20:27:23
Is there a way to detect or an event being triggered when i receive a gmail/email on my android device. Basically i would like my application to read the email notification when i receive it. Could you kindly tell me if there is way to do this ? Alex Davis You need to register a content observer (not broadcast receiver) contentResolver.registerContentObserver(Uri.parse("content://gmail-ls"), true, gmailObserver); gmailObserver is your own ContentObserver object. ContentObserver.onChange is going to be called every time something changes in Gmail. Here you get all conversations like so: Cursor

Android Lock Screen and Keyboard Controls

筅森魡賤 提交于 2019-12-04 20:20:36
I am part way through writing a media player app for Android. It's all going really well so far, however I am now reaching the difficult stage! I have two questions. Do i need to implement a service activity? As I understand it, this is required to allow the app to continue working in the background. However, mine is working fine while I move to other programs on the tablet, and returns to the app without problems. Can someone please explain what the advantages are of services? Secondly, I would like to integrate the media player with the standard lock screen controls in ICS, and also make it

BroadCastReceiver for Multiple sent Messages?

不羁的心 提交于 2019-12-04 19:37:48
In my app i am sending multiple sms at one time which working perfectly fine. But when i am trying to receive confirmation messages in Broadcast Receiver i am expecting to get all numbers but i end up in receiving same one number instead of n numbers. To send SMS Intent intent = new Intent(SENT); intent.putExtra("phonenumber", sms_phonenumber); PendingIntent sentPI = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); SmsManager sms_man = SmsManager.getDefault(); sms_man.sendTextMessage(sms_phonenumber, null, sms_message, sentPI, null); To Receive Sent Confirmation

Broadcast receiver not working background on some devices

半城伤御伤魂 提交于 2019-12-04 19:34:42
I am trying to get WiFi connection changing event using Broadcast Receiver class. I have tested this on Samsung S7 edge and HTC 626Q and it works well (even when the app is closed), but this is not working on Huawei GR5 2017 if the app is closed. It works only when the app is running on screen. Both S7 and GR5 devices have Android 7 (Nougat) OS. Broadcast Receiver public class NetworkChangeReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context,intent.getAction(),Toast.LENGTH_SHORT).show(); } } AndroidManifest file <?xml

java.lang.ClassCastException while running new `runnableThread` in `Service` Class

主宰稳场 提交于 2019-12-04 19:15:48
I have an application , contains a broadcastReceiver which listens to all new received SMS . If any new SMS received this BroadcastReceiver starts a background Service which runs GPS and return the coordinates , this coordinate retrieving needs a new thread to be run , in the Service class there is no getApplicationContext() so I used 'getContentBase()' for starting the new thread this is the code ((Activity)getBaseContext()).runOnUiThread(new Runnable() { ((Activity)getBaseContext()).runOnUiThread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub

Check if the broadcstreceiver is registered? [duplicate]

99封情书 提交于 2019-12-04 19:11:43
问题 This question already has answers here : How to check if Receiver is registered in Android? (17 answers) Closed 4 years ago . Is there any way to check if the broadcast receiver is working or not. I did it like below. I register the broadcast receiver but it doesn't find this registered receiver.. PackageManager pm = getApplicationContext().getPackageManager(); final List<PackageInfo> packs = pm.getInstalledPackages(PackageManager.GET_RECEIVERS); for (final PackageInfo p : packs) {