android-package-managers

How to programmatically set a lock or pin for an app

丶灬走出姿态 提交于 2019-11-29 21:08:09
So right now I am trying to develop an Android App for my young children. I want to set a pin or passwords on selected applications for a particular amount of time to prevent them from opening the app. For example, let's say that my daughter wants to play angry birds for some time on my phone while I am doing work. I will select my important apps like messaging, gmail, etc and put a pin or password on it for 30 minutes while she plays angry birds. After 30 minutes, I get my phone from my daughter and I can open the app without a pin because the time limit expired. I have done a ton of research

How to Enable Android Download Manager

天涯浪子 提交于 2019-11-29 20:37:15
I'm using Android Download Manager to download list of files. Lately I came across a crash report saying Unknown java.lang.IllegalArgumentException: Unknown URL content://downloads/my_downloads Then later, I figured it out that the reason is because user disabled Android Download Manager. I check if the Download Manager is disabled by checking it's package name with the code below. int state = this.getPackageManager().getApplicationEnabledSetting("com.android.providers.downloads"); And now, I need to find a way to enable the Download Manager if it is disabled. I tried setting it's enable state

part-2 persistent foreGround android service that starts by UI, works at sleep mode too, also starts at phone restart

白昼怎懂夜的黑 提交于 2019-11-29 15:15:01
问题 Status: Really thankful to all who helped and guided here and in part-1! I have made code out of research and help given and have put that working code in EDIT-1 . Criticisms are welcomed to make the code better. Scenario: I asked the question mention in Part-1, but for some reason I can persistently cannot make a design and correct strategy with code that has true integration and sanity. It was a lengthy question and the question nor answer could have been concluded or finalized in just one

Is there a way to keep meta-data in the Android manifest private to the package?

邮差的信 提交于 2019-11-29 14:01:47
I want to use meta-data in the Android manifest to customize the behavior of a service. <service android:name=".SampleService" android:exported="false"> <meta-data android:name="sampleName" android:resource="@string/sampleValue" /> </service> My service is part of a library, and it is possible some may put sensitive data into these attributes when they use my service. Are these meta-data attributes visible to other installed packages on the phone via the PackageManager even if the service is not exported? Are these meta-data attributes visible to other installed packages on the phone via the

Get minSdkVersion and targetSdkVersion from apk file

你。 提交于 2019-11-29 12:06:46
问题 I am trying to get the values of minSdkVersion and targetSdkVersion from an apk stored on the device. Getting other details are discussed here, but only the targetSdkVersion is available in the ApplicationInfo class. Can the minSdkVersion be obtained other than by extracting the apk file and reading AndroidManifest.xml? 回答1: I do not believe this is possible to do on your own and there is no pre-made api for this. The current methods that read and parse the AndroidManifest do not consider

Difference between adb “install” command and “pm install” command?

那年仲夏 提交于 2019-11-29 03:37:40
What's the difference between installing an app using the install command and using the package manager's pm install command? Do they do the exact same job? Does one command actually call the other in the back? adb install -r APK_FILE adb shell pm install APK_FILE adb install is a command to run from a development host, which uploads a package somewhere temporary and then installs it. pm install is a command to run locally on the device. adb does indeed utilize the pm program on the device - see the source code at https://android.googlesource.com/platform/system/core/+/kitkat-mr2.2-release/adb

How to update Gradle dependencies to their latest version

◇◆丶佛笑我妖孽 提交于 2019-11-28 21:06:34
问题 Is there an easy way to get gradle to update dependencies to their latest available version? For build reproducibility all my dependencies are defined with a version number like this in my build.gradle file: dependencies { compile 'namespace:package1:version' compile 'namespace:package2:version' compile 'namespace:package3:version' } Periodically I want to update every package to their latest version. Typically this is the first thing I do for a new sprint after making a release. It's a real

Install APK programmatically on android

夙愿已清 提交于 2019-11-28 19:56:33
I've been trying to get an android application to install an APK on the sdcard programmatically but I'm running into a little trouble. This is how I'm doing it: Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType("ApkFilePath...","application/vnd.android.package-archive"); activity.startActivityForResult(intent,5000); Now that works ok, it brings the package manager and I can control what to do when the manager finishes installing the APK. But the issue that I'm having is that if at the end of the installation the user clicks on "Open" instead of "Done" the "OnActivityResult"

Get icons of all installed apps in android

烂漫一生 提交于 2019-11-28 19:24:29
I want to get icons of my all installed apps. Can I get that icons using package manager? Is there any function for it? Or any other way to get icons of all installed apps in bitmap? Thanks! Ponmalar try { String pkg = "com.app.my";//your package name Drawable icon = getContext().getPackageManager().getApplicationIcon(pkg); imageView.setImageDrawable(icon); } catch (PackageManager.NameNotFoundException ne) { } Check here for more details. I know i am too late for this answer. Above answers are pretty good. Your Question is:- Get icons of all installed apps in android? you want list of install

queryIntentActivityOptions not working

落爺英雄遲暮 提交于 2019-11-28 11:11:55
问题 I am trying to create a dialog that shows all applications in a user phone that can be used to select a picture from the storage or take one using the camera. This is a follow-up to my previous question. The best way I have found to populate my listview in my customized dialog with applications that can perform the above actions is to use queryIntentActivityOptions() method but it's not working. my listview isn't been populated with apps that can be used to access an image or take one using