I have recently created an app via app inventyor and have faced a problem to publish that.
I am going to publish this app in a local platform ( something same as google play) this publisher persist to remove the:
"<uses-permission android:name="android.permission.CAMERA"/>"
the camera recall in my app after pushing a key and they justify since the user will push this key intently the camera permission must not be shown.
they have suggested the following code to be written in JAVA for this porpose but I do not know how I should generalize that to MIT App Inventor.
thank you in advance for your helps.
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == CAMERA_REQUEST && resultCode == Activity.RESULT_OK) {
Uri imageUri = data.getData();
if(imageUri != null) {
// do something with image
}
}
}
how are you using the camera in your app?
are you using the camera component? the webviewer? or any other component?
usually if you want to use the camera, your app needs that permission in the manifest
and as the CAMERA permission is consiered a dangerous permission, you have to ask for using that permission during runtime of the app... What is a dangerous permission?
thank you for your reply.
I have put a camera in my app from the design part and have called that in the block part by pushing a button. is it possible to use another way to take a picture by pushing a button while using the camera permission is not required? (eg. camera component, the webviewer, or any other component)
thanks for your reply.
the mentioned extention is to load images, I need a way to recall camera (to take a picture) without appearing the camera permission.
if this extention work for this purpose too? and how?