android-permissions

java.io.FileNotFoundException: (Permission denied) when writing an object using ObjectOutputStream

六眼飞鱼酱① 提交于 2019-12-02 06:59:40
I have been trying to work around this for several hours and I am extremely frustrated so I am coming to you guys for some guidance. I am trying to save and retrieve a User object I have created. I want to make it so that I can save and retrieve this User object from any intent throughout my application, so I decided to go with a FileInput and Output stream. I have included my code for both below. Here is my output data method: public static void serializeDataOut(User ish) { try { String path = Environment.getExternalStorageDirectory().getAbsolutePath(); File newFile = new File(path + "myFile

App requests aren't showing up

余生长醉 提交于 2019-12-02 06:41:12
I have a map activity in my app. I'm trying to request location permissions on it, but the request permissions are not showing up. I have no idea why... This is my full code: public class MapsActivity extends FragmentActivity implements OnMapReadyCallback { private static final String FIREBASE_URL="https://****.firebaseio.com/"; private Firebase firebaseRef; private LocationManager locationManager; private GoogleMap mMap; SupportMapFragment mapFrag; boolean bPermissionGranted; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R

confused about android runtime permissions

◇◆丶佛笑我妖孽 提交于 2019-12-02 06:11:03
问题 So this whole new android runtime permissions has gotten me confused. My app is currently compiling and targetting version 23 which means I have to use runtime permissions. My app primarily uses the camera api which needs the camera permission so I added the runtime permissions before opening the camera as such: if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {//ask permissions for camera ActivityCompat.requestPermissions(this, new

Can't turn on location on android api23?

五迷三道 提交于 2019-12-02 04:19:38
I have used the following code and the dialogue that asks for permission shows as expected. But when I click "allow" it doesn't do anything. The log message doesn't appear as if the permission wasn't granted so I went to my parameters to verify if location is "on" and it was "off". Wasn't it supposed to be on because I granted the app access to my location ? If I manually turn it "on" and then run the app again, once it asks for my permission, it works and shows the log message but isn't the whole point of asking for permissions (via dialogue) to turn on location (when it's off) if the user

Violation of the Permissions policy in google play

白昼怎懂夜的黑 提交于 2019-12-02 04:14:24
问题 Our app was currently removed from google play for having the SMS permission. We already removed the permission and uploaded a new apk but the status of the project is still removed. Do we have to wait for them to review, it or is there any other necessary steps/action needed for the project to be back on Google Play? 回答1: Fillup google docs for permission. Make sure your SMS permission is given in manifest and give the pop up in user level. Contact google developers as soon as possible. See

Get gmail profile image and full name

孤者浪人 提交于 2019-12-02 04:14:12
问题 I am preparing a login page for my app. I wanted to do the same thing that twitter is doing. They are helping the user and predefining some fields like email, name and profile pic. I managed to get the email using the GET_ACCOUNTS permission. However I cant see how I get the full name and profile pic? public static String getEmail(Context context) { AccountManager accountManager = AccountManager.get(context); Account account = getAccount(accountManager); if (account == null) { return null; }

confused about android runtime permissions

耗尽温柔 提交于 2019-12-02 01:08:39
So this whole new android runtime permissions has gotten me confused. My app is currently compiling and targetting version 23 which means I have to use runtime permissions. My app primarily uses the camera api which needs the camera permission so I added the runtime permissions before opening the camera as such: if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {//ask permissions for camera ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, CameraPermissions); } else {//permissions attained now you can

Android permission denied for window type 2010 in Marshmallow or higher

僤鯓⒐⒋嵵緔 提交于 2019-12-02 00:39:15
问题 I am try to make Chathead type overly draw via Android Service on my app like bellow image. This chat head app works on Android Version 5 or lower versions(kitkat,lollipop etc).But I am trying it in Marshmallow and higher versions,Then get this error. android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@48f5767 -- permission denied for window type 2010 Chat head code Note :I am calling this function from Android Service Permission List: <uses

Get gmail profile image and full name

徘徊边缘 提交于 2019-12-02 00:08:15
I am preparing a login page for my app. I wanted to do the same thing that twitter is doing. They are helping the user and predefining some fields like email, name and profile pic. I managed to get the email using the GET_ACCOUNTS permission. However I cant see how I get the full name and profile pic? public static String getEmail(Context context) { AccountManager accountManager = AccountManager.get(context); Account account = getAccount(accountManager); if (account == null) { return null; } else { return account.name; } } private static Account getAccount(AccountManager accountManager) {

Package Installer crashes in Android M after requesting permission READ_SMS

浪子不回头ぞ 提交于 2019-12-02 00:06:09
I have a Login Fragment that tries to access (TelephonyManager) getActivity().getSystemService(Context.TELEPHONY_SERVICE); this works well with devices up to Lollipop 5.1. And when I tried it in Marshmallow 6.01 it showed security exception. So I added code from android docs to request permission on runtime. Here is the code int permissionCheck = ContextCompat.checkSelfPermission(getActivity(),Manifest.permission.READ_SMS); if (permissionCheck != PackageManager.PERMISSION_GRANTED) { // Should we show an explanation? if (ActivityCompat.shouldShowRequestPermissionRationale(getActivity(),