Is it possible to disable uninstall option in app? - java

steps:
Settings -> Apps -> App info.
try to disable uninstall option.
Use case:
If user try to uninstall the app, at that time try to call api.
I am using Device admin access.

You cant remove the "Uninstall" option, but you can try setting some permissions to the user you want to

Related

Active or enable app in device administrator without user interaction

i am developing an applocker application in android.so to prevent user from clearing data,i need to disable clear button in settings which i can achieve by adding my app in device administrator..i am able to achieve that using this code
Runtime.getRuntime().exec("dpm set-device-owner com.example.hp.useradministratordemo/.DemoFrag");
but my app is not active or enabled in device administrator and this process i want to do without user interaction..I searched for that and i found that there is one command "set-active-admin" but i don't know how to use this shell command
..thanks in advance

How to use code to open android.permission.SYSTEM_ALERT_WINDOW permission

In my app, I need to use android.permission.SYSTEM_ALERT_WINDOW permission. Now I know to go to setting to open it. But some of the application is automatically opened. I want to know how to do it
If i got it right, you want to ask the user for some permissions on app launch. There's a great library to help you do that in Android :
Github link for the Permission dispatcher library
You can also check these libraries :
App-Runtime-Permissions-Android
Assent
MarshmallowPermissionManager
Every app that requests the SYSTEM_ALERT_WINDOW permission and that is installed through the Play Store (version 6.0.5 or higher is required), will have granted the permission automatically.
If instead the app is sideloaded, the permission is not automatically granted. You can try to download and install the Evernote APK from apkmirror.com. As you can see you need to manually grant the permission in Settings -> Apps -> Draw over other apps.
It is a new behaviour introduced in Marshmallow 6.0.1.
If you want the app to be sideloaded, you show manually show a prompt and direct the user to enable Draw over other apps permissions from the settings. Have a look at Requesting permissions

Android, root, whitelist

How can I create whitelist with root-granted apps? Other apps must be denied whithout any prompt.
I'm looking for existing solution or some advice how to write app with this features.
You should checkout Superuser on the market. This app can manage what apps have root access to the device.
use
Download Magisk Manager
solutions 1
its have feature for app selection for pregranted and for other apps
solutions 2
first manually grant permission from Magisk app
set default Aotometic Response -> Deny
be free to ask for more help :)

android mobile device is not showing on device chooser of eclipse

After spending a lot of time, this issue is not solved. I am using karbonn a+1, and after installing all drivers and running adb kill-server and adb start-server, and then adb devices, it is not showing the device on device chooser.
Did you enable 'USB debugging' on your device?
You can find this setting in the Development settings. If you need need information on how to enable it, check the android manual on using hardware devices.
It can be because the driver isn't installed.
Go to Device Manager from Control Panel.
Now if there are some driver under Android Phone, then other setting might have caused that. Else, if your Android show small yellow mark, there is problem with the driver.
Right Click on that 'android' button
click Update driver and chose latest driver from computer.
That should work. If you have bought new phone, like Karbonn, and you are tried of searching adb driver online, like I was, its actually on your own phone. Navigate to SD-Card on your phone and copy 'Pcdriver' to your desktop. Unzip it and update your driver selecting. Hope this helps.
If you on Windows 8, you may have to Disable Driver Signing before that:
Move your mouse pointer to the upper right-hand side of your
monitor. This will open the charm bar.
Click the Settings charm.
Click the Change PC settings link at the bottom of the Settings
menu.
Click the Restart now button.
Click Troubleshoot.
Click Advanced Options.
Click the Startup Settings.
Click the Restart button. Your computer will reboot.
After the reboot, press the [F7] key. This chooses the 7) Disable
driver signature enforcement option.
Login to Windows 8.
You can do like this
Right click on your project.
select run as -> Run configurations.
select tab target - > Choose always prompt to pick device.
this may solve your problem. :)
You have to walk through these steps if you have an Android device from a small manufacturer with custom usb id.
Download the Google USB driver (Android SDK Manager -> Extras)
Find your device in Control panel -> Device manager
Click on Properties->Details and select Hardware identifier property. You should see something like USB\VID_2207&PID_0010&REV_0222&MI_01
Change sdk/extras/google/usb_driver/android_winusb.inf
Copy
;Google Nexus One
%SingleAdbInterface% = USB_Install, USB\VID_18D1&PID_0D02
%CompositeAdbInterface% = USB_Install, USB\VID_18D1&PID_0D02&MI_01
add new entry for your tablet. Change the VID and PID to your device's. (The ones in step 2.)
;Orion Tablet
%SingleAdbInterface% = USB_Install, USB\VID_2207&PID_0010
%CompositeAdbInterface% = USB_Install, USB\VID_2207&PID_0010&MI_01
Add the VID of the device to the end of
Users/%user%/.android/adb_usb.ini . Take care to the 0x hexa
notation!
# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE.
0x2207
Remove all existing device drivers for the device
Turn on USB Debugging on your device
Plug in the device
Select manual installation of the driver
Select the driver from sdk/extras/google/usb_driver
Select Android Composite ADB Interface
Run adb kill-server
Run adb devices
Your device should show now up in the device list.

GPRS Setting in mobile Application its self

Can i save automatically GPRS setting when i am installing the Java ME application.
Any one have any experience please share.
No, You can't have this.
What you can do is, Try making connection if it fails prompt user to make active connection available to application.
Unfortunately, you can't change the GPRS settings programmatically. We don't have the permission for accessing those things. So you have to change manually the GPRS settings before starting your application.

Categories