How to install Android applications without opening google market? - android

I want to promote some of my applications when user installs one of them. Is there a way to install them without sending the user to market?
For example to ask for permission when user install my app and then use it to receive access token and install applications with it.

Download apk file from the server to mobile, after that use following code to install application.
Intent promptInstall = new Intent(Intent.ACTION_VIEW);
promptInstall.setDataAndType(Uri.fromFile(new File(apk_filepath),"application/vnd.android.package-archive");
startActivity (promptInstall);

Related

android google play auto install apk like google drive

I've and application that requires a secondary application to be installed to work . Reason for this vary, mostly memory (both flash and ram) footprint if this is used from multiple applications.
Anyway, it's not very convinient that a user has to go to the playstore again after having downloaded and started the first app.
Now I've discovered google drive does the same with google docs/sheets/presentation. You first install google drive, and when you need another application you still need to install it.
However google drive manages to show an "do you want to install this application" popup immediately instead of just redirecting the user to the playstore: See https://drive.google.com/file/d/0BxHD8LQaDPnrbXpEcm1HdV9KVkpNOUlRWldyVjhBbnFkSFJN and https://drive.google.com/file/d/0BxHD8LQaDPnrRS1PSHdyNDRXT3Nzb3BBVjNfSDVRbDZhaGpN
Question is: does anybody have an idea how to do this? Or is this an api that only google apps are allowed to use? I've not found any documentation about it. Decompiling the google drive app also did not help me much, it's heavily proguarded.
Intent promptInstall = new Intent(Intent.ACTION_VIEW)
.setDataAndType(Uri.parse(yourApkFilePath),
"application/vnd.android.package-archive");
startActivity(promptInstall);
Download apk file to sdcard(from your server) and use above code with filepath. It opens a prompt to the user whether to install new application.
Note: this works only if the user checks "Install app from external sources" in the Settings

Android INSTALL_PACKAGES Permission and Non-PlayStore Apps

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 Google Play and simply present the user an installation screen to acceppt the installation. I would like a solution, where I sent an intent to the PlayStore app and it displayed the app name, permissions and the install button. I've found nothing. Anyone any experience here?
I thought I could package this additional app into the assets of my enclosing app. I'd need to write it to the file system and send the system an intent to install the package. Problem: The App was not loaded from Google play and with that it's source is unknown. If I used the PackageManager and let it install the APK, does the permission INSTALL_PACKAGES allow my app installing this 2nd app on a user's device (since the user already accepted that my app may install packages)?
I hope someone may help. And thank you in advance.
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.
This combination is impossible, barring a major security flaw in Android and/or the Play Store. The only way to install apps through the Play Store is via the Play Store app.
I would like a solution, where I sent an intent to the PlayStore app and it displayed the app name, permissions and the install button.
That activity is not exported. You are welcome to use a market:// Uri to lead the user to the Play Store, where they can review this second app and decide, for themselves, whether or not to download and install it.
since the user already accepted that my app may install packages
Your app cannot install packages directly, unless it is signed with the firmware signing key or is installed on the system partition (e.g., by a rooted device user), as that is the only way that you can hold the INSTALL_PACKAGES permission. Ordinary SDK apps are welcome to create an ACTION_VIEW or ACTION_INSTALL_PACKAGE Intent to request that the app be installed, but the user will need "unknown sources" enabled.

Is there any API that allows to install an apk in Android?

I want to build an app able to install apps in any Android Device from my PC, I know about adb terminal application..and I could build some kind of an interface for it, but I have been trying to find any api release that allows me to do the same thing without calling to adb.exe. I dont care if is in java or any other language...anyone knows?
You are welcome to start an activity using an ACTION_VIEW or ACTION_INSTALL_PACKAGE Intent, pointing to the APK file.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(path)), "application/vnd.android.package-archive");
startActivity(intent);
I do not think that an api exists. ADB is a client-server program that includes three components: a client, a server and a daemon, so (I think) it's not too easy to create an api. You must take into account that the ADB is the best option, and maybe you can develop a frontend (Eg: http://forum.xda-developers.com/showthread.php?t=970348 )
But if you are just trying to install xpi:
WHy don't you upload your app to Google Play or alternatives?
Also you can copy the app to your phone and install it via Install File Manager or (you need to install it first)
Try something similar to http://www.apkinstall.com/
I think you are trying to install an apk from your apk which is not feasible.
You can listen to other app in your app by broadcasting in other app and receiving that broadcast in your app .

How to install .apk on multiple phones for testing

Hi I am developing a cloud application for android. While developing its a torture to install apk on every phone after a single line change in code. Is there a way to install it through script. or maybe i can put apk to some web/ftp server and from there I can install it somehow on each phone. Atleast I dont have to connect every phone through USB every time.
Please Help
For our production purposes, we use Dropbox on our computers and our devices, copy APKs into it, then click from Dropbox from each of our phones.
edit: When I've had to programatically install APKs in the past, I used something like this (which I can't find where I got it from anymore):
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "app.apk")), "application/vnd.android.package-archive");
startActivity(intent);
If you're willing to root some of those devices, you can do adb over wifi (unless they already have that option built-in).
You could also use a web server/gmail (or PushBullet for Jellybean-only devices) to deliver your apk to those devices, but that solution would still require a couple of additional steps from the user.
It's possible to install an application remotely over-the-air to your devices with your own google account without user intervention on the phone itself, but only if it's already published on Google Play. I suppose some of that process could be automated if you take a look at the new Google+ Sign-in api, and/or if you use a selenium script to trigger the installation from your desktop computer's web browser (because user authorization is still required through the web browser on the desktop itself, that's why you'd need Selenium to do that bit).

Installing Android app through OTA service

I have developed 5 android applications and generated the 5 apk files with same keystore. Of the 5 apps, one app is the home app which contains a common database. All other apps are accessing the database using the content provider.
Now, I want the user to download the all 5 apk files through the OTA service. After the download completed the home app first get started to install and after the installation completed automatically the second app get started to install and likewise for all 5 apks. Is there anyway to achieve this?
You can prompt an install
Intent promptInstall = new Intent(Intent.ACTION_VIEW)
.setData(Uri.parse("file:///path/to/your.apk"))
.setType("application/vnd.android.package-archive";
startActivityForResult(promptInstall);
One's the user has accepted and installed, you will get a callback on which you can invoke the next APK install. You could also use PackageManager to check if the user has installed the APK successfully

Categories

Resources