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
Related
I built an app for a client, but it must be private so I can't publish it in the store.
This application is installed in 30 devices, so every time I release some updates another guy has to install the new app in every device. I was wondering if I could update the app from a link or something.
My idea is to insert in a table the current version with the link of the app that expo provides me after the build.
Once I press the button "check for updates" I check the version installed and if it's old, I will download the app from the link and install it automatically.
Is it possible at least for Android? For ios I don't care so much since it is installed only in one device.
I read about updates from expo wiki but I think it works only for published apps
thanks
Put the .apk on a server in the internet.
Everytime your app starts it starts a thread that checks if the .apk on the internet is different/newer from the one that is running.
If so then the new one is downloaded automatically.
When all done your app starts an install intent at a suitable moment.
Google Play can distribute private app to devices registered in your organization.
You can read this for more info: https://support.google.com/googleplay/android-developer/answer/6145139?hl=en
When you install an app from Google Market, you have an install button, which downloads and automatically starts the installation program for the apk you just downloaded. It doesn't install it automatically, only it automatically launches the installer for the apk you just downloaded.
Is it possible to have a similar button if you have a apk file on your local server? How will the link look like?
I've read a lot of almost similar questions here (like this one
How to install APK automatically when the file download is complete (hosted on private) or how to automatically install an apk), but none of the answers explained if Google uses something special for its market or is it possible to use a special kind of a link to force the installation program from the phone to automatically launch after download? Automatically LAUNCH, not automatically INSTALL the apk.
That is, when users scans my QR code with a QR code reader or types directly the URL in the browser, how can my application trigger the installer program right after download?
Let's say I do the following:
1. I generate a private key on my computer
2. I sign my app with my private key
3. I submit my app to Google market
4. I upload my app to my site.
When someone will download my app from Google Market, the following will happen:
a) That person will access the Google Market URL of my app
b) He will download it to his phone
c) The application installer from the phone will start automatically, and ask him if he agrees with the permission required by the app.
When someone will download my app from my site, the following will happen:
a) That person will access the Google Market URL of my app
b) He will download it to his phone
c) The application installer from the phone will NOT start automatically.
I don't want the app to install without any intervention from the user, just for the install process to start automatically after download.
My question is how to make c) to happen even if he downloads the same app, signed with the same signature, but from my site?
The simple answer is: You can't (at least if I'm remembering correctly).
AOSP contains a set of Google's public keys that they sign their applications with. And in order to be able to install an application without any intervention from the user, the apk must be signed with the matching private key. So, in order to do this, you will have to do one of two things:
Get google's private key and sign your apk with it.
Get everyone to upgrade their phone to have your public keys along side google's.
Neither of these are really possible. So basically, you can't. Unless your targeting the root/rom community. Then you might be able to convince them to do #2 (add you to the list of keys that can install apps without intervention).
I have a scenario where I have to install an apk file through code and I dont want the user to have option either install or cancel it. For ex, I want to create an app similar to the android market. In that app, I will display list of my applications and display an install button for each app. When the user clicks the install button, the app should be installed directly without asking the user to install or not. I found a link which have a method installPackage in PackageManager. I am getting compilation error when I use it. It seems that it is remove from the android framework.
Is there nay possibility to do this ?
thanks,
Senthil
My customer wants the android app to update itself automatically whenever a change is made. They do not want to publish the app in the android market. For the first time, the app will be installed using the Android SDK or the numerous other ways to install.
How do I ensure that the app is automatically upgraded whenever bug fixes or features are added. If not automatically, a button from the app is also ok
Thanks.
Create an "updater" application. This application will monitor a remote server for updates and if it finds one, it will install the apk programmatically. Read this question for directions on how you can install an apk programmatically. You will easily find more information regarding this topic on the net.
You could try to use Pushlink. http://www.push-link.com
It can be done in following ways :
1. a push notification mechanism
2. server pooling on each start / time interval
3. Push SMS
to update the client application.
If your client is using Google Apps you can create a private Google play channel for your organization. There you can publish the apps only for your users to see. I know that you explicitly said that this is not an option, but it's, by far, the best option (although it's not free).
http://support.google.com/a/bin/answer.py?hl=en&answer=2494992
Maybe you can update your app programmatically:
download new version of your app (*.apk) to a local storage of
Android device
run new Intent for update app
Intent intentInstall = new Intent(Intent.ACTION_VIEW)
.setDataAndType(Uri.parse("file:///path/to/new_app.apk"),
"application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intentInstall);
remove downloaded *.apk
See also Android App Version Update service without releasing it to marketplace
Is there a way to automatically trigger the installation process of a just downloaded apk ?
Currently after I download the package , nothing happens unless I click the package ,in which case the packege installer is launched !
The tomcat server from where I download the package has in the web.xml file the following :
<mime-mapping>
<extension>apk</extension>
<mime-type>application/vnd.android.package-archive</mime-type>
</mime-mapping>
That is exactly as it should be. Your app can trigger download of an apk but to install it the user must be shown the permissions it requests and explicitly agree. You absolutely cannot 'automatically trigger the installation process'. Even if you are updating an already-installed app.
OS-level permissions are required to call the PackageManager APIs that actually install APK files. These are not available to developers or 3rd party apps.
Since the Android Marketplace is part of the OS and has OS-level permissions, it can prompt the user for permission to download and install an app once before the download begins, and continue the rest of installation without user input.
3rd party apps cannot do this. By design, the only method available for developers/apps to install APK files is to launch the PackageInstaller activity, which will always require an extra verification step from the user before the install happens.