android-package-managers

Android M reflection method freeStorageAndNotify exception

 ̄綄美尐妖づ 提交于 2019-12-17 18:40:09
问题 I'm using reflection method freeStorageAndNotify: Method freeStorageAndNotify = null; freeStorageAndNotify = service.packageManager.getClass().getMethod( "freeStorageAndNotify", long.class, IPackageDataObserver.class); freeStorageAndNotify.invoke(PackageManager.class, maxCache + freeSpace, packageDataObserver); This causes InvocationTargetException: java.lang.SecurityException: Neither user 10199 nor current process has android.permission.CLEAR_APP_CACHE. Some points: - I already have android

Implement hidden Android interface through reflection and proxy

一世执手 提交于 2019-12-13 20:17:32
问题 I am trying to use the hidden Android package manager's method installPackage and its callback class IPackageInstallObserver . I managed to retrieve the method in question via Java's reflection but am struggling to implement the hidden observer interface via reflection proxies. I tried the following approach but it still didn't work. I tried it like this: // I declared the same interface signature locally interface IPackageInstallObserver { fun packageInstalled(packageName: String?,

There is a issue in parsing the package, android?

冷暖自知 提交于 2019-12-13 10:40:21
问题 I've made this application, which I've been testing for a while now. When I was done I put it on the Market store and it was all good but now a made a new version, not changing the manifest it gives me an error on my phone when I try to install it: There is a problem parsing the package. <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> I had no problems with the app before but why now? 回答1: This error happened to me a couple of time and I was able to fix it by cleaning the

Android: where do PackageManager and SensorManager get their information?

落花浮王杯 提交于 2019-12-13 04:43:33
问题 On Android, to find out the available system features you can do something like: PackageManager pm = getPackageManager(); for (FeatureInfo fi : pm.getSystemAvailableFeatures()) { String feature_name = fi.name; if(fi.name == null){ feature_name = "GlEs Version " + fi.getGlEsVersion(); } Log.i("theTag", feature_name + ""); } Similarly, to find out the available sensors you can do something like: SensorManager sensorManager = (SensorManager)getSystemService(SENSOR_SERVICE); List<Sensor> sensor

Android INSTALL_PACKAGES Permission and Non-PlayStore Apps

北城以北 提交于 2019-12-12 12:34:31
问题 I'm preparing my app for the play store and plan to deliver one component as separate install package (since my customer can't recover the source code, but the app is signed with his key). I thought about two ways of doing that. My needs are just these: Users with "unknown sources" deactivated should be able to install the 2nd app. And: The user should never be redirected to Google Play store. Both apps are free. I've looked up for solutions that would let me download an additional APK from

how to get list of installed instant messenger apps?

 ̄綄美尐妖づ 提交于 2019-12-12 01:49:35
问题 My app should be able to send the text in a TextView via WhatsApp, Email, SMS etc. For that i need a list of installed Messging Applications. I tried it with the PackageManger but i get all apps. How can i get only the Instant Messaging Apps? This is my code to list the installed apps: PackageManager packageManager=this.getPackageManager(); List<PackageInfo> applist=packageManager.getInstalledPackages(0); Iterator<PackageInfo> it=applist.iterator(); while(it.hasNext()){ PackageInfo pk=

Is there any way to get notified before the app is being replaced by another?

半世苍凉 提交于 2019-12-11 17:01:38
问题 I know about the ACTION_MY_PACKAGE_REPLACED Intent action but what it do is - notifies the receiver AFTER the app got replaced. But the things is - I want to know before the app is being replaced by another. I tried with these actions <receiver android:name=".receivers.InstallReceiver" android:enabled="true" android:exported="true"> <intent-filter> <action android:name="android.intent.action.PACKAGE_INSTALL" /> <action android:name="android.intent.action.PACKAGE_ADDED" /> <action android:name

Android categorize installed applications

喜你入骨 提交于 2019-12-11 11:43:05
问题 I want to categorize installed android applications (Like Social, Entertainment, Games, News, Tools and etc). Can anyone suggest how can i programmatically arrange all the installed apps? 回答1: Use the WhereDat API: Create a raw JSON POST request, with an array of the packages you want to categorize: { "packages": [ "com.pixmix.mobileapp", "com.nextstagesearch" ] } Send it to: http://api.wheredatapp.com/data And here's the response: { "apps": [ { "category": "Productivity", "rating": 4.5,

unistall android application programmatically

无人久伴 提交于 2019-12-11 08:57:00
问题 I want to be able to allow my users to uninstall application from my application. Just like what Google Play Store allow to their users(Please below image) the main question is that how can define a button that by pressing it we can uninstall an app by giving the package name or some other info.Just like the uninstall button on the image. 回答1: try Intent intent = new Intent(Intent.ACTION_DELETE); intent.setData(Uri.parse("package:app package name")); startActivity(intent); If this doesn't

Install application wrapper script wrap.sh

旧城冷巷雨未停 提交于 2019-12-11 08:42:07
问题 Android offers a really powerful way to control application process start - it is so called wrapper script. It is a simple shell script named wrap.sh that should be placed in the app installation lib/ directory (one that contains native libraries, if any): #!/system/bin/sh my_wrapper_cmd $@ If an app has such script the system won't fork zygote to create hosting process for the application. Instead once user tries to launch app - system invokes that script to start brand new app_process with