Android – Checking Permissions in a Separate Class

I found some other topics that touched on this, but the solutions did not work for me. I have a class which contains the methods for checking permission, and I make a call to it in the I read from some people that I have to pass a Context and Activity to checkPermissions(), … Continue reading “Android – Checking Permissions in a Separate Class”

Minimum actions required to implement a custom permission in the Java security system

I found below question somewhere. I tried to find the answer but could not. Can any body please help with answer/ some reference links? Thanks in advance. Which one of the following lines describes the minimum actions required to implement a custom permission in the Java security system? Implement a new permission class and add … Continue reading “Minimum actions required to implement a custom permission in the Java security system”

Java: Accessing Windows files from Linux machine

I’ve got a Java program that saves a new PDF file to a shared network location. On Windows, it works fine, using backslashes serverDirName=\\\c$\input To try skip all the complexity of permissions, I’ve set the sharing on that folder in Windows to Read/Write for “Everyone”. I’d like to try run the program from a linux … Continue reading “Java: Accessing Windows files from Linux machine”

Android permissions: asking options guide

I apologize in advance for my language and if this thread is a duplicate. I would like to ask for a ‘mini-guide’ on android permission asking for 6.0+. The problem that I am personally having is some applications I recently released require permissions like internet and external storage. But the only way I could ‘help’ … Continue reading “Android permissions: asking options guide”

Granting Android Permissions – unknown value

Some time ago i added permission to my app about ‘fine location’ by some tutorial from internet. Everything works like i want, but i have question about 1 unexplained line: private static final int MY_PERMISSION_REQUEST_FINE_LOCATION = 101; Why is there value 101 ? Why not 102 or 200 ? private static final int MY_PERMISSION_REQUEST_FINE_LOCATION = … Continue reading “Granting Android Permissions – unknown value”

Android studio Dangerous permission

I’m trying to change my system/phone brightness through my application. For this I need to ask for permission (“dangerous permission”). I’m not quiet sure if I’ve done the correct way but this doesn’t seem work as it always returns permission denied. public void switches() { if (systemBrightness) { ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.WRITE_SETTINGS}, 1); Toast.makeText(this, “Changed to … Continue reading “Android studio Dangerous permission”

Android ask for multi permissions

I have an app which need to ask first for two permission , to read contacts and write file in extrernal storage. The problem is that when the app open at first time crash and ask for the permissions, when I reopen it all is good the app is run smoothly. public class MainActivity … Continue reading “Android ask for multi permissions”

checkSelfPermission always returns GRANTED

I have an Android app and I’d like to check the camera permission. However, even if I turn it off (in the app setting of the simulator or the real device), the result is always 0 (GRANTED). The simulator and real device I use is on SDK 23, Android M. int permissionCheck = ContextCompat.checkSelfPermission(mActivity, Manifest.permission.CAMERA); … Continue reading “checkSelfPermission always returns GRANTED”

Permisions in REST API using Spring Boot and LDAP

I have configured LDAP (at this moment via ldif file) and successfully integrated with spring boot (spring boot exposes REST API). I mean that only authorized requests (by Basic Auth) are serviced, other requests are rejected (401 code). My REST API exposes two urls: (1) /deleteUser/id (2) /showUser/id And two groups of user in LDAP … Continue reading “Permisions in REST API using Spring Boot and LDAP”

What is the different between android:maxSdkVersion=“18” and no?

What is the different between <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” android:maxSdkVersion=”18″/> <uses-permission android:name=”android.permission.READ_EXTERNAL_STORAGE” android:maxSdkVersion=”18″/> and <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE> <uses-permission android:name=”android.permission.READ_EXTERNAL_STORAGE”>