Giter Site home page Giter Site logo

permissions-samples's Introduction

Warning This sample has been deprecated and is no longer being maintained.

Find the new permission samples in the new platform-samples repo.

### Android Permissions Samples Repository

This repository contains a set of individual Android Studio projects to help you get started writing/understanding Android Permissions.

permissions-samples's People

Contributors

canato avatar codingjeremy avatar ggfan avatar marcelpinto avatar nic0lette avatar owahltinez avatar tiembo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

permissions-samples's Issues

Crash on the emulator

You app crashes on the emulator with

Process: com.example.android.basicpermissions, PID: 16924
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.basicpermissions/com.example.android.basicpermissions.camera.CameraPreviewActivity}: java.lang.RuntimeException: Fail to get camera info

Here's the screenshot. I propose handling this case elegantly.
screen shot 2015-10-25 at 12 22 13 pm

7

[removed]

Target Android 12

Would be good to update the samples to target Android 12 since there are many new requirements that are being enforced on us developers.

He

Hello world

a1

không viết gì

Error with OnePlus: E/libc Access denied finding property "vendor.camera.aux.packagelist" (and "vendor.camera.hal1.packagelist" too)

Hi,
tested on ONEPLUS 9 running android 11, I've got this error when clicking on the OPEN CAMERA PREVIEW button:

E/libc: Access denied finding property "vendor.camera.aux.packagelist" W/asicpermissions: type=1400 audit(0.0:3799): avc: denied { read } for name="u:object_r:vendor_persist_camera_prop:s0" dev="tmpfs" ino=13601 scontext=u:r:untrusted_app:s0:c236,c256,c512,c768 tcontext=u:object_r:vendor_persist_camera_prop:s0 tclass=file permissive=0 app=com.example.android.basicpermissions E/libc: Access denied finding property "vendor.camera.hal1.packagelist" E/libc: Access denied finding property "vendor.camera.aux.packagelist" W/asicpermissions: type=1400 audit(0.0:3800): avc: denied { read } for name="u:object_r:vendor_persist_camera_prop:s0" dev="tmpfs" ino=13601 scontext=u:r:untrusted_app:s0:c236,c256,c512,c768 tcontext=u:object_r:vendor_persist_camera_prop:s0 tclass=file permissive=0 app=com.example.android.basicpermissions

but I get the the preview showed. I've also had this error message with another application that I can't list the back wide angle camera (CameraManager.getCameraIdList() ).

No error with Samsung Galaxy S10 (android 12).

I'll appreciate any help

New ActivityResultContracts.RequestPermission() sample

Issue

Android 11

With the new Android 11, we have a change on permissions behaviour, adding:

Luckily, Android already give a method(RequestPermission) that deal with all this cases.

Developer Android Permission Guide

On the permission guide Request App Permission where this project is linked (end of the page) we can see the usage of ActivityResultContracts.RequestPermission() and ActivityResultCaller.registerForActivityResult.

What can make the developer confused because registerForActivityResult still on alpha for appCompat library.

Solution

Based on this, would be beneficial for the community to have a sample code for it. But since the library still not release this should be another sub-project until the appCompat release 1.3 and this code became the default one.

Add support for 'Never ask again' option

I've noticed that the 'Never ask again' option is not handled in the given sample and this is a relatively common case when dealing with run-time permissions.

getDisplay() raises an exception

BasicPermissions
CameraPreviewActivity.java
// Get the rotation of the screen to adjust the preview image accordingly.
int displayRotation = getDisplay().getRotation();
Rasing exception on AVD API level 19
Android Studio 4.2.2
compileSdkVersion 30

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.