How to identify if the new apk is installed? - android

I'm creating an android library that will be embedded in to application source which will be used for recording some analytics information on the server. I wanted to find out if the user has upgraded to a new version of the application(not the library) using SDK API. I'm trying to avoid having the application developers change anything in the manifest to indicate the version change. I already have a mechanism to identify each device on the server. In this case is there a way to identify if the .apk is upgraded when the tries to contact the server?
So far I found PackageInfo.lastUpdateTime is changed. I thought PackageInfo.signatures content will change too, but it is not changed even when I change the application code. Appreciate any help.

Why not just send along BuildConfig.VERSION_CODE? If the value is different than the last value received, it's been updated. For an application to be updated, the version code must be at least as large as the previous version. To be published on the Google Play store, the version code must be increased.

Related

How to update an already distributed app without installing a new version

I built a small application that gives real time update on coronavirus cases in my country.
Just recently, the API which I used to get the number of cases, deaths etc changed their endpoints
e.g from
https://covid19.com/corona/country
to
https://covid19.com/v2/corona/country
Due to strict restictions by Google on apps relating to covid19, I couldnt upload to playstore but I built an APK and shared the link to many people to download.
Now, they cant access the number of cases in the app due to a change in the API endpoints.
Please, how do I change just that string URL from my end to have effect on everyone who has the app already without needing to build another apk and making people to download the app again.
I discovered Firebase Remote Config, I tried it on my android studio, run the app on my phone, and yes it was working on my device, but How do I get it to work on other people devices with the app already installed.??
The only option you have is:
If you have put any text field which takes string data dynamically (like from database/server), there you can inform user to download latest version with a short link. But again that depends upon the text view size/scope you have defined.
Since, without updating the app itself by anyway, it seems impossible to make the existing app working.

How to deal with obsolete api’s in a mobile app

The fictitious situation is the following: I have a mobile application that has been published to the store for about a year now (both for iOS and Android). I’m preparing a new version of the application. Some of the api’s in the back end are obsolete or deprecated.
The problem is that users of the application that would not update the app to the new version will experience problems with the operation of the app because the back end api’s have been replaced or removed.
The question is how to deal with this situation before becoming a problem?
Are there any guidelines from apple or google for obsolete functionality between different versions of the application?
#Dimitris, Here you need to provide force update to the old apps. This can be done using app configuration file. Basically, you will have an app configuration file which contains JSON with following keys:
{
"server":{
"app-server1-base-url":"http://",
"status":{
"is-running":true,
"message":"We are busy upgrading XYZ server with technology and features. We will be back soon. We apologize for the inconvenience and appreciate your patience. Thank you for using XYZ!"
},
"force-update":{
"status":false,
"message":"Please download the latest version of XYZ from App Store to continue using the app. Thank You!"
}
}
}
Here 'app-server1-base-url' key will be base URL for the app. you can put all the service URL in this file.
Case 1:
Your app will check this at the time of launch whether force update available or not to the app.
Case 2:
API versioning can be done if you want to handle it using backend.
Note: Please keep configuration file on services like AWS S3 etc.
As Puneet Sharma said in this post: https://stackoverflow.com/a/18756151/8354952.
Almost all changes to the iOS versions are additive and hence an
application build using lower version still runs on the higher iOS
version. But we also need to notice that APIs are introduced or
deprecated and behaviors of existing APIs may occasionally change.
Basically the old version application may run on the latest system version. But some special api or class may be deprecated, this will cause some weird behavior or crash. So Apple or Google will also recommend user to update old version applications.
For the api from our own server, we can do the application compatibility by ourselves. Upload the current version identifier, the server can transfer different types of data through detecting the identifier.

Can I increment version number of iOS/Android app even users don't install app to update

I create iOS and Android apps as hybrid app.
My apps send HTTP request to server, and then get HTML,CSS,JS etc.
Users don't need to update my apps until I change native side project.
It means that sometimes my apps version don't changes even I provide new functions or fix bugs.
It's wired for user. I should display increment version number when my apps have changes.
I want to increment version number of my apps even users don't install my apps to update.
Is there any good way to achieve it?
I come up with one idea to directly change setting file like Android manifest file.
However, I don't know whether it's good and works....
It is not possible for iOS, you need to submit new version for version number to change for your app
Also not possible for android as well
I don't think it is possible.
AndroidManifest is XML file attached to your APK and could not be changed when it's installed - only by application update (I mean installing new APK with incremented version number).
In iOS situation is the same. Version code is attached in Info.plist file which, like AndroidManifest, is just file attached to your application archive and could not be changed.
I don't think you can dynamically change your version code - because this is what you are trying to do.
For Android that's simply possible, for iOS, because of the Sandbox and Apples protections, not. (If not jailbroken)
You could let the app have a settings/information section where it displays current version, and this version will be loaded from your server as well as the HTML, CSS and JS.

Android/iOS Apps Crashing, do they need deletion for new update to occur?

I've got a development partner who says that in order to fix bugs that cause an application on iOS & Android to crash on load that end users need to delete the original app and re-download the new updated version. Are they for real? Shouldn't it just be incorporated into a standard app update and work like any other update?
The answer depends on how your app was distributed. If you just sent out a link like http://www.mysite.com/mytestApp.apk, it's easiest to uninstall. If they're updating via the Google Play Store, you have to set your version number higher than the installed version. Users can then get the newer version more seamlessly. I haven't done an ad hoc distribution with iOS yet, but updates via the app store seem to work similarly to the Play store. Users get a notification and can then update if their device meets the required specs.
Usually an update should resolve these issues. However, I have seen rare instances where users running older apps will need to uninstall/reinstall to get the new version of the application working. Like I said, these are rare instances where some major configuration has to take place. It's not something most updates need to do.

Application update?

I have build a maps related software which require the app to get update whenever the base map is modified. Basically we have nodes.json whose data will get updated under such situation.
One way i am thinking of is to have the latest version of .apk on my dropbox account. Whenever the file in my account is of higher version than the one currently installed, user will get a pop-up . But i am not very clear about the implementation.
Also the application works offline so whenever user connects to some internet source he should be notified..
Please help me with my solution or suggest if there is a better solution.
thanks

Categories

Resources