broadcastreceiver

How to make app lock app in android?

﹥>﹥吖頭↗ 提交于 2019-12-20 08:12:22
问题 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

Android Wifi broadcast receiver not working as expected

我只是一个虾纸丫 提交于 2019-12-20 07:31:41
问题 I have to get the WiFi ssid whenever phone connects to new WiFi network. I registered the following receiver `registerReceiver(this.mybroadcast, new IntentFilter(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION));` This part of code works perfectly. But in onReceive method, NetworkInfo info = intent.getParcelableExtra(WifiManager.EXTRA_WIFI_INFO)); always returns null. I tried EXTRA_NETWORK_INFO as well, but it also returns Null. I can't use this.registerReceiver(this.mybroadcast, new

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

Android Broadcast Security

有些话、适合烂在心里 提交于 2019-12-20 06:24:58
问题 In android, you can set the action of a broadcast to almost anything (save system actions.) My question is how can you prevent other apps from spoofing your broadcasts? Say you have an action called "com.a.b.c". Other applications should receive com.a.b.c, but they shouldn't be able to send com.a.b.c. How can that be done? Also, I seek clarification of permissions that deal with broadcast reception. I find the Android documentation a bit confusing with this. Is there a way to make a

Need to perform some activity during the unistallation of an Android app

送分小仙女□ 提交于 2019-12-20 05:56:47
问题 I am working on an app in which i need to log, if user uninstalls the app. So i am following this approach How can an app detect that it's going to be uninstalled? But i am facing the same problem as in this post Can't get receiver when the app uninstall. As my phone is Android 4.4... Can anybody post the exact solution (code) to solve this problem??? Edit: During uninstallation QUERY_PACKAGE_RESTART intent should be broadcasted but i am not recieving it. I declared it in manifest as well i

unable to run service when Date changes using broadcast receiver

自古美人都是妖i 提交于 2019-12-20 05:35:07
问题 I create an birthday reminder app. I want to start service at 12:00 in night to scan birthdays of person in Database. I add a broadcast receiver. <receiver android:name=".MyReceiver"> <intent-filter> <action android:name="android.intent.action.DATE_CHANGED"/> </intent-filter> </receiver> But It don't work. I don't why.. here is the code of broadcast receiver ..... package com.example.forgetmenot; import android.content.BroadcastReceiver; import android.content.Context; import android.content

Service based Android application on Google Play Store

旧巷老猫 提交于 2019-12-20 04:49:47
问题 I'm developing an application which will consists only of a few services and no activities (i.e. no UI) Basically I want to have 2 to 3 services to be running in the background right from when user installs the application on his/her device. I have a few questions over this: How will my services start after application installation? My BroadcastReceiver should be listening to which event? How can I package my application to deploy it application on Googly Play Store? 回答1: You can't do that on

Android: Broadcastreceiver with Achartengine ,don't display updates

风流意气都作罢 提交于 2019-12-20 04:23:45
问题 I'm trying to display information got from wifi scan with broadcast receiver ,into a bar chart using achartengine. Well i want to have a real time chart ,every time i receive data from onReceive() method ,i update the chart. To achaeive that ,i create the chart objects in the onReceive() method .But i just get a chart with the first result ,there is no update ,although i can see the changes on the wifi scan. I would like to know what is the problem. This is the code that i'm using: public

BroadcastReceiver behavior when phone is asleep

狂风中的少年 提交于 2019-12-20 04:23:21
问题 I am not quite certain what the behavior of a BroadcastReceiver , registered in the manifest and enabled via PackageManager , is when the phone is asleep. The question arose because I need a receiver registered for broadcasts from WifiManager <receiver android:name=".receivers.ScanResultsReceiver" android:enabled="false" > <intent-filter> <action android:name="android.net.wifi.SCAN_RESULTS" /> <action android:name="android.net.wifi.WIFI_STATE_CHANGED" /> </intent-filter> </receiver> but what

GCM push notification for background app causes crash

微笑、不失礼 提交于 2019-12-20 04:15:28
问题 I stumbled about a problem to receive GCM messages if my app runs in background (Service). In my scenario, I don't receive the GCM message (please notice it is not about how to receive GCM in general like here) and the ActivityManager kills the app. So I wonder if I have a conceptual misunderstanding or if it is a general problem. Background I have an Android application that runs in foreground (Activity) and background (Service). The application is attached to a persistent notification to