I am developing two android apps with android studio and for some reason I want just one of these apps can be installed on a device. I think I should check the package name of second app and prevent it from installing. Is there any way to do that? thanks.
You can not prevent any app from being installation. Instead you can stop your app from being running. I mean, when your app starts, check if specific application is installed, and if so stop your application.
An ordinary app cannot prevent another app from being installed. Malware authors would think that such a "feature" would be wonderful.
Device owner apps — mostly for IT departments at larger organizations — have some abilities here, though I forget whether they can block installation by package name.
Related
Is it possible to hide somehow your app package from the list returned by context.getPackageManager().getInstalledPackages(0)
or context.getPackageManager().queryIntentActivities
or from the checks using context.getPackageInfo(uri, PackageManager.GET_ACTIVITIES)?
I heard about the problem when companies do not allow to use their apps in the case of detecting installed one from the concurrent company. They probably use one of these checks.
Is it possible to hide installed application from other applications?
Not on a conventional Android device.
With root, this might be possible, but it might mean that the app is useless (if nothing knows the app is there, nothing will cause the app to run).
I heard about the problem when companies do not allow to install their apps in the case of detecting installed one from the concurrent company.
That too is not possible. Until the company's app is installed, it has no means of determining what other apps are installed. An app might refuse to run based on conditions like what other apps are installed, but it cannot prevent its own installation based on such conditions.
My question may look strange but I'll try to explain somehow. Let's imagine there is an Android device with software that adjusts some settings based on application package name - it's a real-life scenario. This software may provide better performance for listed applications and there is no way to add my application to that list. What I'm capable of doing is to release my application under one of listed package names (not to Google Play, just provide APK on GitHub so that anyone who wants to use it will install it manually). And there comes my question:
is it legal to use some company's existing package name for my own application? Is it protected legally? My app is free & open source application.
Just to be clear: I'm not doing this to impersonate "real" application with bad intentions. I just want my application to use full range of device capabilities... And download page will state it clearly & visibly :)
In other words: can I release app with package name e.g. com.google.android.talk? I know that it won't override existing app if someone has it installed etc. (it's not my goal to override some application). I'm just talking about such possibility and legality.
This is totally legal, as you can use whatever String you want for your app/package name.
However, just doing this will most probably be not enough to "impersonate" the other app, as this would be a serious security flaw. First of all, there can never be two apps with the same package name installed.
If the app you speak about is created by a "serious" developer, say Google or one of the OEMs, it will check both package and signature of the app and will therefore know your app is not the same as the replaced app.
Also, when the user tries to install your app, a package conflict will happen, followed by the signature conflict. There are two scenarios here:
If the app you are replacing is a standard app, the user will be able to install your app from adb, but only after thay accept to completely wipe the data of the original app. You have probably seen this dialog while developing stuff.
If the app is provided by the OEM and has system permissions, the installation will simply fail, with no possibility to "overwrite" the app. This can be dodged by having the devices rooted, replacing the .apk file in the system directory and restarting the phone.
Please mind that none of the above will work by just uploading the .apk to the phone. This needs to be done from adb. On-phone installer will just fail.
Does anybody has the Idea of making an android app undeletable.I want to install selected apps on the system memory so that anyone having an access to my phone cannot delete those apps even after resetting the phone...
What I earlier saw was that the apps installed on the system memory cannot be changed or modified by ordinary users...I tried resetting my phone but saw some apps preinstalled from the company remained and all the apps that were downloaded from the play store were deleted..
The answer I got from searching the web was that I could make install an Android app to the system memory...does it make the app undeletable even after resetting or formatting the phone?
You can achieve this by making your application by Developing a Device Administration Application, follow this link http://developer.android.com/guide/topics/admin/device-admin.html.
you could only do this if you root your phone and place the apps inside system/apps.
However, if this is about your phone, why don't you use a password protector for apps, so nobody can access the app manager?
Removing a users choice to uninstall your app, goes against everything most programmers strive for. It's probably against the Google T&Cs also. And as already said, other than Malware or some dodgy virus attempt, there would be no practical (ethical) use for such an app, IMO.
I am developing a customer care android application. The client want that only the customer care application should be installed in the Android phone and we should prevent installation of other application. Is there any hack we can do to do that?
Is there any hack we can do to do that?
Fortunately, not from a standard SDK app -- the technical term for this would be "malware".
As the comments to your question indicate, you are welcome to root the device, remove the Google Play Store client (if it exists), and disable the ability to install from non-Play sources by adjusting the secure settings. However, I suspect that this will prevent you from updating your own app without rooting.
i'm developing a couple of apps at the moment one is an image-processing app, the other a google maps app. when i'm developing them i can only have one app at a time on the phone. is there any reason for this? my phone is a Samsung galaxy portal api2.1.
i'd like to have a few apps on my phone that are in the development process for interview purposes. Is this possible?
The only reason can be that the applications share the same package name. Android uses the package name to distinguish which application to launch (using the launcher or startActivity calls). Is there a reason for you to have the same package name for different applications?
Uninstall both apps on the device. Then after renaming the package names (all instances of them), run both again and it should work.