Reputation: 67
I want to develop an Android application in order to capture events (key press, touch, ...). The problem is that when my application is minimized, it cannot capture events. One solution can be using message sent from OS kernel to processes but I do not know how. I will be appreciated if anybody can help me.
Upvotes: 2
Views: 708
Reputation: 9443
You'll probably want to create an Intent Filter. Intents are Android's way of notifying applications when something interesting happens that they may want to be aware of. If you scroll down on the intent page you can see the list of actions/events that are exposed through intents. From there you create an IntentFilter as part of your app definition in your Android Manifest file.
Here is an example of the manifest for responding to a Search button click:
<intent-filter>
<action android:name="android.intent.action.SEARCH_LONG_PRESS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
You can find some good information on how intents work and how to set them up on the Intents and Intent Filters page of the developer docs
Upvotes: 1
Reputation: 1007554
The problem is that when my application is minimized, it cannot capture events.
Correct.
I will be appreciated if anybody can help me.
Fortunately, what you want is impossible, as it would represent a massive security hole.
Upvotes: 2