Check version and install apk OTA if the version is different - android

I am trying to build this app which is almost complete now. I am trying to improve it by
Providing OTA support
In order to do that check the version, download apk and install it.
Some research pointed me to use Intents but was not very clear.
A step-by-step procedure will be much appreciated.
Thanks in advance.
PS: I may not be publishing it in the market because of certain requirements. So uploading to market is ruled out.

You can install an APK programatically by sending an intent with ACTION_VIEW with the apk file. This will open the application installer, which will install it if the build version in the manifest is higher than the one in the installed application.
See a similar question here for that part.
You'd need to poll a file on your server somewhere periodically that can return the latest version number, and compare it to the currently installed application version number through PackageManager (call getPackageInfo() and check PackageInfo.versionCode).

Related

Google Play Security Issues?

This is my first time submitting an app to the Google Play store, so I'm not very experienced with the process at all. After struggling for a bit to get it to build correctly, I was finally able to upload an app bundle and send it in for review. A few minutes later I got an email saying my app was "vulnerable to Intent Redirection" and recommended the following article for support: https://support.google.com/faqs/answer/9267555. The problem is I don't understand much of what the article is saying! As far as I know, I haven't messed with anything like this. I've only downloaded the base NDK and SDK stuff from Unity Hub, and I haven't changed any of the code in Android Studio at all. I asked Google for support, and they said:
"We’ve identified that your app is using the AliPay SDK or library, which facilitates the transmission of phone number information without meeting the prominent disclosure guidelines. If necessary, you can consult your SDK provider(s) for further information or please upgrade AliPay SDK version to 15.5.5 or higher."
Please help! Is there an easy fix to this that I'm missing somehow? I don't even know what AliPay is, as I said I'm a total beginner here. In case it's useful info to have, I'm using Unity 2019.2.13f1 on a Macbook Pro running High Sierra 10.13.6.
Well, do what the message says "upgrade AliPay SDK version to 15.5.5 or higher".
Just go to Android Studio and open your build.gradle file then update that lib version. It will be marked with a yellow line, that means that lib has an update. Focus on that line, then do Alt + Click then Enter, now sync and you've done. Upload the new apk.

Android Google Maps Development with Emulator - Repository of Standard APKs

I am a newbie to Android programming and i started putting together an application using Google Maps using Eclipse with KitKat SDK. I developed a simple app to display Google Maps in the Emulator by installing com.android.vending(4.6.16) and com.google.android.gms(4.3.25) apks. I downloaded these APKs from different sites(not sure how authentic they are).
I am making use of the command aapt dump badging to determine the version.
The map opens but i was repeatedly getting a message that "Unfortunately Play Services has stopped"
Objective is to ensure that I am using the right set of APKs with the emulator
The trouble that i am facing is there seems to be no clear directives on where i can find the authentic version of these APKs. I tried Google Play and when i give a search for com.google.android.gms, it yields a result of applications. I was expecting a URL to download the recent version of the APK. Correct me if i am wrong
1. How to download just the recent version of APKs from Google Play ? Am i looking at the correct site
2. Second is there any authorized site from where i can download these APKs?
I was looking for a listing of the APKs with the version number against it. So that i can download the version that i need. I am not sure of the dependencies of the APKs on the Android platform.
3. Finally is there any dependency between com.google.android.gms.apk and the com.android.vending.apk on the basis of the version or the SDK platform used?
Thanks
Govindarajan
I have a suggestion, Try to use Genymotions for testing maps/places app. it is faster than emulator and you can build and check maps application.
www.genymotion.com/‎
LINK

android update/install version checking

i'm new in android developing. (and in developing after all)
Here is my problem: If i install my android application onto my mobile device or AVD, i want it to check the current app version number and if it's lower than the one i want to install currently then install it, and if it is higher , then alert the users that they already use the latest version.
Because now when i install the .apk file, it just installs the app again and nothing happens.
Is it possible to develop this?
Best regards,
weeyas
The install process is managed at the system level, so your application has no control over it. As per the versioning guide, the Android system will only allow you to install updates from the same or newer version codes (i.e., version 1 can be replaced by version 2, but version 2 can never be overridden by version 1 unless you do a complete uninstall/reinstall). This applies to both Google Play updates and sideloading APKs yourself.
I don't know if it is possible if you try to install application from .APK file. However, you will not be able to publish the newest apk to Google Play if it has the same or lower version number than the current one.

Android apk replace vs Update

I have an application already installed on the mobile, am trying to install the update version of it.
I placed the apk inside the data/data folder, using file manager at the path,am trying to install it -
it shows a dialog to replace but not upgarde (Signed with the same key-store and version code/version name has an incremental value).
Could someone explain me more on this?
There is a difference between installing and subsequently, updating, apps off Google Play. Applications installed via a File Manager, for instance, will always prompt you to replace and not update an application. Side-loading apps on devices directly, does not have that mechanism to update. This is true not only for your app, but for every app.
It does not matter how it was signed or even the increment of your app's version.
Upgrade is only possible when you actually follow the installation procedure from Android Market. Else, it would just be a replace.

Upgrade apk downloaded from own web server

I need help in upgrading apk file. I have apk file developed for android 2.2 and I donot wish to publish my apk on android market. I published apk in our own webserver. And i could download it to my android mobile. Now the issue is that how can i upgrade apk file by publishing in our webserver.
My questions are:
How android market does apk upgrading?
How to upgrade a binary in android mobile with new version of which old version is already installed?
I used android built in view using intent which actually Re-installs apk not upgrading.But i don't want prompts asking "Do u want to install application?".
I want the apk to be upgraded once user click upgrade button without showing prompt to user, like doing in android market.
Is there any method to upgrade apk in android?
Are there any restrictions doing that?
Are there any specific permissions i need or i need to set in manifest file.
Once you've downloaded the APK, Android itself decides if the program is installed and needs to be upgraded, or if it is a new installation. Users can decide for themselves whether to upgrade or not.
Besides how to find out when there is an update available, it's not possible to upgrade it without prompting the user with the "Do you want to install". Android doesn't allow third apps to install apps unless the phone is rooted and your app has root access, but I think that this isn't your target group.
I have no experience with that but what you could try is loading classes manually from your server and then store it in the assets folder.
http://android-developers.blogspot.com/2011/07/custom-class-loading-in-dalvik.html
This is one approach, I don't think that it's very handy and easy but it would work.
Hope it helps!
PS:
And just because I'm wondering, is there a reason why don't you wanna publish it on the Android Market?
When you are publishing an App on your private web server, you need to create a process through which you can check for new version .There is No in built method for doing this .
I have created one as well.

Categories

Resources