MortenL
Posts: 0
Joined: Thu Jan 08, 2015 1:38 am

Query versionName and versionCode from appCode

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.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Query versionName and versionCode from appCode

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.

MortenL
Posts: 0
Joined: Thu Jan 08, 2015 1:38 am

Query versionName and versionCode from appCode

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.

Return to “Issues”