Page 1 of 1

Query versionName and versionCode from appCode

Posted: Tue Jan 27, 2015 2:27 am
by MortenL

Hello, I want to implement a AppVersion checker so that I can determine if the currently installed app is the newest released. I did find some information about how to implement a PhoneGap plugin using i.e. PackageManager, but wanted to check if Appery already has a solution for this. Thanks.


Query versionName and versionCode from appCode

Posted: Tue Jan 27, 2015 4:38 am
by Yurii Orishchuk

Hi MortenL,

Unfortunatly you can not use information from "android binary" app settings tab.

So you need to implement this logic your self.

I can suggest you two ways:

1 Create new JS asset and fill it with following code:

pre

self.appInfo = {
version: "123.123",
build: "345.345"
};

/pre

Then you can access to this info with following code:

pre

//Get version.
var version = self.appInfo.version;

//Get build.
var build = self.appInfo.build;

/pre

2 Create some collection in your DB. With collumns "fieldName" and "fieldValue" and request this collection when you need info(for example when your dialog page will be displayed).

Regards.


Query versionName and versionCode from appCode

Posted: Tue Jan 27, 2015 2:23 pm
by MortenL

Thanks Yurii. This works for now. The manual work is a little extra to manage, but not too bad. Excellent if you can add this feature to your product backlog. It would surprise me if I am the only one in need for similar functionality.