EventBus is a library of Greenbot . This is very simple for all users how to implement and its basic use. Here I will also share examples for better understanding. What is EventBus? EventBus is subscribed/publish event bus to communication between components with limited lines of code, in short, its bus for events transfers the data between one activity(class) to another to reflect the changes based on our needs. That makes the data exchange between components like Activity, Fragment, Services, and any kind of backgrounds threads pretty easy. EventBus can handle the threading for us: events can be posted in threads different from the posting thread. Common use can be dealing with UI changes. In Android, UI changes must be done in the Main(UI) thread. In other words, networking or more time-consuming task cannot be handled in the Main thread, for that we must use AsyncTask or Handler to make it more smooth. Now we have one more options use EventBus to change the UI po...
I have worked since 1 week on how to disable the FORCE STOP button in Manage Application in Android. And I was able to disable the Force Stop and Uninstall button in Manage Application.
For that you need to make your application as Device Administrator. Android has add this kind of feature from Android 2.2 version. This feature is for Security reason with different option. Set Minimum Password Strength, Data Wipe, Force Lock, Reset Password and so on. We set our application as Device Administrator to change above features.
See the below screen shots which shows how to activate the application and disable force stop button.
1. Create one class with specific name and extends DeviceAdminReceiver.
2. Add main functionality under MainActivity to enable Device Admin Application.
3. Add below device_admin.xml file under /res/xml/ folder.
4. Add receiver in AndroidManifest.xml
Reference Site
If you are satisfied then please give your comments.
Thanks for your Interest!!!
For that you need to make your application as Device Administrator. Android has add this kind of feature from Android 2.2 version. This feature is for Security reason with different option. Set Minimum Password Strength, Data Wipe, Force Lock, Reset Password and so on. We set our application as Device Administrator to change above features.
For more info and advance example you can check your android-sdk path (>= android-8).
\samples\android-[>=8]\ApiDemos\src\com\example\android\apis\app\DeviceAdminSample.java
See the below screen shots which shows how to activate the application and disable force stop button.
[Active device adminstrator]
[Disable the Force Stop and Uninstall button]
Follow the below steps to disable the FORCE STOP button.
1. Create one class with specific name and extends DeviceAdminReceiver.
2. Add main functionality under MainActivity to enable Device Admin Application.
3. Add below device_admin.xml file under /res/xml/ folder.
4. Add receiver in AndroidManifest.xml
You can also download full source from here.
DeviceAdminDemo: https://github.com/prashantadesara/DeviceAdminDemo
Reference Site
If you are satisfied then please give your comments.
Thanks for your Interest!!!
Hey Good tutorial..keep it up..
ReplyDeleteBut one question is, how to disable "Clear Cache" also, right now I can see "clear cache" Enable.
Thanks for your interest.
DeleteI thought "Clear Cache" is not able to disable due to its System level button. But If I find anyhow then share it here.
Thanks,
Hi Prashant.
ReplyDeleteI try to use your example in my Android, but this don´t disable the Force Stop button in settings.
Only work the Uninstall button, when you try uninstaller. I had to add this line for uninstaller mDPM.removeActiveAdmin(mAdminName);
Thanks for your answer.
Hi Erick,
DeleteSince Android 2.2, this new Device Policy API allowed to developer create this kind of feature.
Which android device and version do you have?
Hi Prashant,
DeleteI have the version 2.3.6 (Zombie art by Jack Larson) and the device is a Huawei Y200.
Thanks for your answer.
Hi Erick,
DeleteThen it must be work in your device because its android > 2.2 version.
Can you please try to uninstall and install it again?
You can check DeviceSample from below path in your Android-SDK path.
\samples\android-[>=8]\ApiDemos\src\com\example\android\apis\app\DeviceAdminSample.java
Thanks,
but its not working on android 7.1.1 and above
DeleteNice tutorial.. thanks a lot for sharing it. :-)
ReplyDeleteHi,
DeleteThanks for your Interest and comments !!!
I do this example but nothing changed and i try to debug it on my galaxy note2 device and also nothing changed !!!!
ReplyDeleteHi
DeleteI would suggest to can you please check again in same device ? May be something wrong from your side. Because I tested in Nexus 7 and its working perfectly even so many people visit this post and they got work perfectly.
So just try again and let me know or else share some logs here. So I can identify what's problem in your side.
This comment has been removed by the author.
ReplyDeleteHi Prashant Adesara
ReplyDeleteIt's working fine but can you tell me how can i start this force stop button and uninstall it?
Hi Pankaj,
DeleteIf you want to enable it again then go to Android device Settings -> Security -> Device Administrator -> and deselect the checkbox of your application.
That's it.
Thanks for your interest in my blog.
I add the code and nothing changed
ReplyDeleteHi Ahlam,
DeleteMeans you got any error? Please share here if you got any error.
In which android device and version you try to run?
i am using your code on 2.3.6 but force stop button is still enable..can u plz guide me ??
ReplyDeleteHi Shubham,
DeleteFirst install installed old version and than try to install the application. At the starting application ask for Device Manager policy. Just did it and then check your force stop button was disable automatically.
Thanks,
Hi ,
ReplyDeleteI used your code and tested on my Rooted Samsung Galaxy s3 and unrooted Nexus 4 but nothing happened.
Can you kindly tell me how will it work ??
Hi Noman,
DeleteFirst installed old version and than try to install the fresh application again. At the starting application display dialog, Just click on Active button and then check your force stop button was disable automatically.
Thanks,
Prashant.
Hello Prashant:
ReplyDeleteNice code.
Code runs ok in 4.4 but no in two Samsung with 2.3.6 (one GT P1000 and GT S6500). I tried "First installed old version and than try to install the fresh application again" but nothing. I have seen in several comments the same problem with 2.3.6... Buttons Force Close and Unistall are enabled although it is true uninstall finally no success. ¿A new advice to try?
This code works in a service? I have tried in a normal app and it works, but in a service not
ReplyDeletevery nice coding.... but i want disable only force stop button. how to modify? please tell me....
ReplyDeleteHi Prashant Adesara,
ReplyDeleteThanks a lot for your help!
It works perfectly and the tutorial is very clear.
It was very helpful to me.
I tested it on a device Samsung Galaxy Core GT-I8260L with Android version 4.1.2
Thanks again!
Thank you prahant. It works perfect.
ReplyDeleteThis is a wonderful article, Given so much info in it, These type of articles keeps the users interest in the website, and keep on sharing more ... good luck.
ReplyDeleteAndroid Training in chennai | Best Android Training in chennai
thanks for sharing this information
ReplyDeleteAndroid Training Institute
I really like your post, thanks for sharing..
ReplyDeleteBEST
ANDROID TRAINING IN NOIDA
BEST BIG DATA HADOOP TRAINING
IN NOIDA
Thanks for sharing this Informative content.
ReplyDeleteAndroid Training in Noida
Thank you so much, only one thing left, can I install or uninstall applications silently and how?
ReplyDeleteGreat post Concise and informative. Looking forward to more content like this. Keep up the good work.
ReplyDeleteActive Rehabilitation Surrey
https://bayanlarsitesi.com/
ReplyDeleteGöktürk
Yenidoğan
Şemsipaşa
Çağlayan
7G8PD
ankara parça eşya taşıma
ReplyDeletetakipçi satın al
antalya rent a car
antalya rent a car
ankara parça eşya taşıma
AOFR5Y
Adıyaman Lojistik
ReplyDeleteTrabzon Lojistik
Muğla Lojistik
Bayburt Lojistik
Bayburt Lojistik
QZZYO
95073
ReplyDeleteMalatya Evden Eve Nakliyat
Kripto Para Borsaları
Artvin Evden Eve Nakliyat
Tekirdağ Çatı Ustası
Osmaniye Evden Eve Nakliyat
046C8
ReplyDeleteBayburt Parça Eşya Taşıma
Kastamonu Evden Eve Nakliyat
Çanakkale Şehirler Arası Nakliyat
Ankara Parke Ustası
Yozgat Lojistik
Malatya Parça Eşya Taşıma
Çerkezköy Ekspertiz
Tunceli Lojistik
Silivri Parke Ustası
2608C
ReplyDeleteTokat Şehirler Arası Nakliyat
Edirne Lojistik
Niğde Şehirler Arası Nakliyat
Malatya Lojistik
Kilis Evden Eve Nakliyat
Çorlu Lojistik
Gölbaşı Fayans Ustası
Osmaniye Evden Eve Nakliyat
Sakarya Şehirler Arası Nakliyat
403BB
ReplyDeleteKeçiören Fayans Ustası
Bitmex Güvenilir mi
Tekirdağ Parke Ustası
Altındağ Parke Ustası
Erzurum Evden Eve Nakliyat
Mersin Evden Eve Nakliyat
Giresun Evden Eve Nakliyat
Altındağ Boya Ustası
Batman Şehirler Arası Nakliyat
479B9
ReplyDeleteEryaman Boya Ustası
Nevşehir Şehirler Arası Nakliyat
Keep Coin Hangi Borsada
İstanbul Parça Eşya Taşıma
Tokat Şehir İçi Nakliyat
Karaman Şehir İçi Nakliyat
Zonguldak Parça Eşya Taşıma
Van Lojistik
Ordu Parça Eşya Taşıma
C8682
ReplyDeletekarabük sohbet chat
görüntülü sohbet ücretsiz
kayseri kadınlarla görüntülü sohbet
canli sohbet chat
ücretsiz sohbet sitesi
en iyi sesli sohbet uygulamaları
kars ücretsiz görüntülü sohbet
samsun görüntülü sohbet kadınlarla
rastgele canlı sohbet
A30C3
ReplyDeletebalıkesir görüntülü sohbet sitesi
kars kadınlarla rastgele sohbet
hakkari sesli sohbet sesli chat
antalya canlı sohbet odaları
sesli görüntülü sohbet
düzce ucretsiz sohbet
kırıkkale kızlarla canlı sohbet
isparta görüntülü sohbet canlı
kastamonu en iyi rastgele görüntülü sohbet
8A3B4
ReplyDeletetrabzon sohbet
kayseri mobil sohbet chat
canlı sohbet siteleri ücretsiz
mardin rastgele görüntülü sohbet
çankırı canlı görüntülü sohbet siteleri
bilecik bedava sohbet uygulamaları
giresun ücretsiz sohbet uygulamaları
görüntülü sohbet siteleri
sivas nanytoo sohbet
ABC5D
ReplyDeleteHardox Sac Fiyatları
Köşebent Demir Fiyatları
Boyalı Kutu Profil Fiyatları
Corten Sac Fiyatları
Krom Boru Fiyatları
Çatı Sacı Fiyatları
Trapez Sac Fiyatları
İnşaat Demiri Fiyatları
HRP Sac Fiyatları
26EDDF1689
ReplyDeletetiktok ucuz beğeni satın al
60CB899B9B
ReplyDeletetakipçi