Since it is a question asked quite frequently, here is the recommended programmatical check to find out if there is a feature missing on the device your ARchitect-SDK is deployed at.
1. Set the following in your Manifest
<uses-permissionandroid:name="android.permission.INTERNET"/> <uses-permissionandroid:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permissionandroid:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permissionandroid:name="android.permission.ACCESS_GPS"/> <uses-permissionandroid:name="android.permission.CAMERA"/> <uses-permissionandroid:name="android.permission.INTERNET"/> <uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permissionandroid:name="android.permission.READ_PHONE_STATE"/> <!-- required for ImageRecognition only -->
2. Create this helper Method somewhere in your code, so you can check requirements manually. If you want to run your app also on devices without all requirements:
remove affected entries in manifest
disable ARchitect-cam for unsupported devices using the following helper-function
public static boolean checkARchitectRequirements( final Context context ) {
final LocationManager locationManager = (LocationManager)context.getSystemService( Context.LOCATION_SERVICE );
final SensorManager sensorManager = (SensorManager)context.getSystemService( Context.SENSOR_SERVICE );
Maybe this method should complement/replace the isDeviceSupported() method in the SDK?
A
Andreas Fötschl
said
about 11 years ago
Hi there!
Yepp - You're right. You can even use it instead. But sometimes you wanna know what's exactly missing. That code snippet allows you to find out more.
Cheers, Andi
Y
Yegor Vedernikov
said
about 11 years ago
Indeed, my 2nd suggestion is (if you decide to put this into SDK) to return the list of missing features instead of boolean, where empty list would mean the full compatibility.
;)
M
Mathias OBERSON
said
over 7 years ago
Hello !
I know it's been four year since the last post, but would there be any way to have the same kind of code as in the first post of this thread but for the Cordova Wikitude Plugin ?
I have one a the device on which I test my app that seems to miss something. But I can't figure out what this is since the isDeviceSupported() method only returns a String...
Being able to test each and every hardware requirements would be higly welcome.
I also second the suggestion by Yegor that a the isDeviceSupported method returns exactly what's missing. This would make much more sense.
Thanks in advance !
Mathias
A
Andreas Schacherbauer
said
over 7 years ago
Hi Mathias, Currently we don't have such a snippet for Cordova, but we're planning to update the isDeviceSupported method accross all Android SDKs + extensions in an upcoming release.
For now the only way would be that you write your own Cordova plugin containing the code from this thread.
Best regards,
Andreas
M
Mathias OBERSON
said
over 7 years ago
Hi Andrea
I'm glad to hear that you will improve the isDeviceSupported() method. That's a very good news :)
Andreas Fötschl