I need a simple service (which will run in the background), when user copies anything from the browser or sms etc., there will be a toast showing that text.
example:
this service must be run on android 2.1 and later.
Today (from 10:35 AM to now[11:11 PM]) I've been searching the internet and tested several codes, but so far I have not come to a conclusion.
Some users in response to questions like this suggested that the use of the (my-clips) project. I get this, you can download this. But this project is complex and I am confused.
can anyone show me a very simple example please? thank you
Edit:
Here is what works for me.
First, the Broadcast:
and then this is the service
Also, the permissions:
the way i did it was:
do it this way without service, add to manifest or anything, just open your app first then close it, and copy the text from anywhere to copy and show up in your app
First, You need to add these permissions to AndroidManifest:
Then, you need to add a service like this:
Add this service in AndroidManifest:
start service at MainActivity
for monitor Clipboard in android you need a service for monitoring clipboard and this service should be define in manifest. your clip board service is here
https://github.com/twaddington/Android-Clipboard-Monitor/blob/master/src/com/example/clipboardmonitor/service/ClipboardMonitorService.java
and manifest define is in the below