Android - Simple permissions - Why don't I need this permission? - android

I'm currently working images using
mBitmap = BitmapFactory.decodeFile(filePath);
ExifInterface exif = new ExifInterface(filePath);
My permissions are:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
I thought I needed a read storage permission to get the files from the gallery. Why can I access files from my Gallery without this permission?
If it helps, I'm using the ACTION_SEND intent filter to start the activity via a "Share" dialog.
Edit: Just to clarify, my application works perfectly. I thought I would need a special permission to read files from the SD card (such as images). Is this not the case?

this is
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Related

About Android File permission

I want to read This directory's file data(file of about 80MB)
/storage/emulated/0/Download/Record_test.mp4
But when using File.length() Function, It returns "0", I can't understand it. Because of I have declared the relevant permission.
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

In My Webview Upload Image Button Not Working But In Browser It's Working

In My Webview Upload Image Button Not Working But In Browser It's Working .Using WordPress file upload not working using flutter.rest all working fine
used all permissions
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE" >
</uses-permission>
<uses-permission
android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Do i need add something in main dart file

How to solve java.lang.SecurityException while trying to take a photo using camera in Kotlin?

I am trying to take a photo in kotlin with the following function:
#JavascriptInterface
fun generate() {
val photoUri = Uri.fromFile(photo)
val imageCaptureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
.putExtra(MediaStore.EXTRA_OUTPUT, photoUri)
startActivityForResult(imageCaptureIntent, GO_TO_CARD_REQUEST_CODE)
}
My manifest has following permissions and features granted:
<uses-feature android:name="android.hardware.camera.any" android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
When starting the activity an exception is shown in Logcat:
"java.lang.SecurityException: Permission Denial: starting Intent { act=android.media.action.IMAGE_CAPTURE flg=0x3 cmp=com.android.camera/.Camera". The camera application does not even start. How to solve this error? Thanks for any help.
The CAMERA permission is if you are using the camera directly in your app, via the Android SDK's camera API or libraries around them. ACTION_IMAGE_CAPTURE launches an external camera app — that app uses the API and needs the permission. So, the simplest solution is to remove the CAMERA permission.

Phone call function intent not working in android

I have made a simple app,In that i want to make a phone call on click of a text view,But I am getting an exception that "No activity found that can do this action"..I have tried a lot and gives all permission to manifest,But still having the same error".
main.java
Intent dialer = new Intent(Intent.ACTION_CALL,
Uri.parse("9033309332"));
startActivity(dialer);
manifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CALL_PRIVILEGED" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
Try to use this code.
Intent callIntent = new Intent(Intent.ACTION_DIAL);
callIntent.setData(Uri.parse("tel:9033309332"));
startActivity(callIntent);
I also had the same problem. Most probably it may be because our device grant the permission to that app then it may work. Just go to settings and grant the permission.

Turning on the internet data packets in android

what i am doing::
I have disabled the datapackets so i don't have a internet connection
at the moment in emulator
Now i am checking whether the internet connection is available if not
availabe i am using this code below to launch the screen so that i
can enable the datapackets
code::startActivity(new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK));
This code takes me to page::
When i click on button it shows turning wifion.... but it is not switching on no matter how long i wait
But when i close the app and go to settings manually. I can turn it on
The permissions i have used are below::
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
What is that i am doing wrong here ? how can i correct myself !
try this code.it might helps you
Intent gpsOptionsIntent = new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS);
startActivityForResult(gpsOptionsIntent,0);
if you are using wifiManager than you will need this permission.
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

Categories

Resources