I have a question. How can I make an Android app installation to work similar as works installation from the official App Store for Android? (http://en.wikipedia.org/wiki/List_of_mobile_software_distribution_platforms) Do I need to have Root access? Or should it be a special version of Android where App Store will work as Google Play? Currently, I’m only able to install applications as “Unknown Sources”, where my application downloads the apk File and calls a system installation window where user confirms the installation. The problem here is that the file to be installed can be copied (even just a brief moment). It may be ok for free applications or the ones with server authentication (log/pas) but for paid apps it could be a problem.
Even if you install the app and delete the APK, it's still very easy to recover the APK of an installed application. The only way you can really protect your app is by using in-app licensing checks or locking the app to a certain device by using the device's id.
Further, on unrooted devices, you can not install apps outside of the Google Play store, unless you enable installation from unknown sources. To get around that restriction -- and to allow auto-updating or silent installation -- you will need to root and install a modified package manager.
Related
I am curious to know the technology behind automatic installation.
Apps from google playstore get installed automatically.
Moreover, 3rd party app store Aptoide also has this feature of automatic installation where the apk file needs not to be manually installed.
How does this happen?
Is there any certain API function or back end code for this?
Thanks
The play store does download the APK file. It just has a permission that allows it to install apps without asking permission. Any system app can get that permission- INSTALL_PACKAGES.
On Android can users choose to install any apps permanently?
And if so how does this work? I know when you first get an Android there are pre-installed apps that are permanent and you cant uninstall them but is there anyway in which we can permanently install apps ourselves?
What you're looking for is a 'system app'.
The apps installed on your Android devices can be broadly categorized as system apps or user apps, based on their installation location. The user apps are just all your normal app installations through the Google Play Store, Amazon Appstore or sideloading. These go into the /data partition of your Android phone, which is the part of the internal memory made available for user data and apps.
System apps are basically the apps that come pre-installed with your ROM. In a standard Android user environment, the user doesn’t have write access to the /system partition and thus, installing or uninstalling system apps directly isn’t possible. The process isn’t as hard as it may sound. However, there is a catch.
In order to install an app as a system app on your Android device, your device must either be _root_ed, or have a custom recovery installed (or both).
Here's how to install an app as a system app
By permanantly, I assume installing them as System Apps.
For that, you might need to root your phone. Google "installing android app as system app" and you will get a lot of answers. This is one sample
As the question is generic, so I am not adding the steps.
Easy way- If you don't uninstall an app, it will stay there permanantly. In addition, you can use additional security for preventing accidental uninstallation.
The device my Android app is running does not have Playstore on it. The plan is to pre-install the software when shipping the device. I am now looking for a strategy to upgrade the application.
I found this useful link to install an Android app from the apk file:
Android: install .apk programmatically
I am thinking I will use this logic to auto-upgrade my app. I am wondering if it is even possible. I am thinking the upgrade will first try to uninstall existing version but will fail as the executable is still running and the file may be locked. Is there a better way? Regards.
Peter, we've just implemented the same thing.
Users have the software pre-installed on their device and we host update APK's on the companies servers.
From the app they can then check for updates where we have a WCF service which extracts the APK file (essentially a .zip) and returns the manifest details. From there we have the version of the APK and can compare it against the local version.
If the user decides to upgrade they can download the APK and you can automatically launch it. At which point the user will be told the application is going to be updated. There are no file locks etc, the app will just close and restart using the new version.
Note: Downgrading is not "automatic". The user would have to first uninstall the app. For upgrades, however, it's a simple case of downloading and launching the APK version (the user will be told they need to allow installations from unknown sources if this is not checked).
You have a couple of options, depending upon your target system.
Use the link you posted. This will provide the user with a traditional install dialog, whereby the user can choose to install or not. You should avoid doing that automatically, as APKs can be large and you might irritate the user if they don't want updates.
You can install updates magically, but you will require the firmware signing key (or possibly root, but I haven't tested that). That will not ask for consent from the user. You will need to add additional code using reflection to access the installation methods of Android. If you go this way, you should build an opt-out/in mechanism.
If your app is open-source, F-Droid would solve the problem for you.
F-Droid is an installable catalogue of FOSS (Free and Open Source
Software) applications for the Android platform. The client makes it
easy to browse, install, and keep track of updates on your device.
Mainly, it updates your app when necessary. (Or just have a look at its source code for inspiration on how to do it).
Yes but as far as I remember only if you had Root privileges in order to have access to the INSTALL_PACKAGES permission.
Several years ago, Android allowed you to set a permission that lets you install apps from a third party location other than Google's own app store Google Play. Eventually they deprecated that permission and only allowed hardware manufacturers to set that permission. I haven't checked since then whether that is still the case.
What I am wondering though is how I would handle a situation where a company wants to install an APK file on to their own devices but not host the APK file in Google Play. How would they provision this?
Android does allow users to install APK files on to their devices that don't come from Google Play, although that feature has to be enabled. Can that feature be enabled programmatically?
The solution that I can think of to installing company apps is to upload an installer app to Google Play that has been developed specifically by the company and used only for the company, even if it's available to everyone in Google Play. Employees would install this app as they do any app from Google Play. When this installer runs, it would prompt for a username/password. Upon authentication, the app would retrieve the company's apps from its own server and install them.
Is this the solution enterprises are currently using or is there something built into Jelly Bean / KitKat / Lollipop that provides provisioning?
EDIT:
Google states on their Android site:
The application is installed on users' devices. Android does not
currently have an automated provisioning solution. Some of the ways a
sysadmin might distribute the application to users are as follows:
Google Play. Enabling installation from another store. Distributing
the application through other means, such as email or websites.
http://developer.android.com/guide/topics/admin/device-admin.html
Aside from those suggestions, they don't offer anything else. Those solutions wouldn't be acceptable in many organizations.
The solution that I can think of to installing company apps is to upload an installer app to Google Play that has been developed specifically by the company and used only for the company, even if it's available to everyone in Google Play.
I'm pretty certain that only the Play Store app has the authority/permissions to programmatically install apps. Those permissions are not available externally to third-party apps. It would be a lot easier to use one of the following options and simply let the OS handle the installation process.
For enterprise apps, the APK file can be
hosted on a public URL. When downloaded, it installs automatically on the user's phone.
sent as an email attachment. Again, when downloaded, it installs automatically on the user's phone.
In both these cases, the user is asked whether they would like to install an APK that originates from a third-party source.
Also, it is not possible to programmatically change the permission for installing third-party apps. That choice has to be made by the user, and the user is confronted with that choice when they access an APK file in the two ways described above.
There is one more option - using Google Play's private channel:
1. Distribute Android apps in your organization.
2. Use a Private Channel to distribute apps in your organization.
3. Deploy app through Google Play Store in a private channel without Google Apps?.
My company would like to give an Android device to a group of our selected customers.
Doing that, we would like to provide users with our mobile app. The app is already on Google Play, but we would like to avoid users downloading and installing by themselves. We prefer to give the device ready, with the app already installed.
We found several ways to manually install an APK on the phone without having to login to the market. But it seems that doing that, the user will not be able to update the app via Google Play, as the app would not be recognized as installed.
Any idea?
As per January 2015, this appears to be impossible. Here is the response I got from Google Play Developer support:
Side-loaded apps do not update via the Play Store. If you would like the app to update, you will need to uninstall the app on your phone and reinstall the app via the Play Store.
I wonder if anyone found a way around this?
To summarize the answer from #Android-Developer and OP's comment discussion:
Google Play recognizes the app signature of APKs regardless of the installation source. As long as you use the same package name and keystore when generating your APK, Google Play will be able to detect newer versions and trigger an update.
To install the app without logging in to a Google account, enable the "Install from unknown sources" option in Settings. You can disable it once the installation is complete.
You may install Titanium Backup if your phone is rooted, then long press on your side loaded app package and select "Attach to market" option. Now you may receive updates via Google Play.
I don't recommend this, I mean never install cracked or patched apps because of copyright or security risks, but installing a Modded version of Google Play can make patched side loaded apps to be upgraded after attaching them to market via Titanium Backup. This is not needed for purchased apps because they are registered in your Google account, so attaching to market will be enough.
To get a MANUALLY INSTALLED APK to show up in the Google Play Store in the UPDATES or INSTALLED section, do either of the following:
1.) Manually install the APK with the SAME APK filename that Google knows the app as (i.e. from the APK download site like APKMirror.com).
2.) If you CHANGED the APK name when you saved it, it will NOT show up in Google Play Store as an installed app.
However, IF there is an update to the app, you will have to do a ONE-TIME search for that app in the store and update it. It will give you the UPDATE option on the app's store page. Once updated via the store, it will show up in the store's Installed / Updates section from now on.
Why does this work? Because the UPDATE will be done thru the store and the APK name it's using during the update process is what Google knows the app as.
If there is NO update, do option #1.
I always add the App name and version info to the front of the filename so I know what it is for later use (because if I'm manually installing, I'll probably be saving it for multiple / future devices).
I also keep the original name at the end, so I can rename it back to the original name if needed. Android is the only O/S I've seen where the filename matters during the install process.