Method to check to see if camera is available or not

This commit is contained in:
Steve McNiven-Scott
2016-05-13 09:26:13 -04:00
parent 87c9828a04
commit 465c719800
5 changed files with 26 additions and 0 deletions

View File

@@ -106,6 +106,12 @@ export var takePicture = function (options?): Promise<any> {
});
}
export var isAvailable = function () {
var utils: typeof utilsModule = require("utils/utils");
return utils.ad.getApplicationContext().getPackageManager().hasSystemFeature(android.content.pm.PackageManager.FEATURE_CAMERA)
}
var calculateInSampleSize = function (imageWidth, imageHeight, reqWidth, reqHeight) {
var sampleSize = 1;
if (imageWidth > reqWidth && imageHeight > reqHeight) {