Permission


Source link: https://github.com/karanchuri/PermissionManager

PermissionManager

This Library automatically search for permission in androidmanifests file and request for the same. Also, if request is cancelled it shows a popup window with alert to grant permission. If the app can no longer request permission due to "Don't ask again" on permission it will toast a message to grant permission from settings. All the action performed after grant or deny can be customized by overriding method shown below. Custom permission can be checked instead of all permission in androidmanifests file.

Setup: Add it in your root build.gradle at the end of repositories:

allprojects {
  repositories {

...
maven {
 url 'https://jitpack.io' 
}
  
}
 
}
 

Step 2. Add the dependency

dependencies {

compile 'com.github.karanchuri:PermissionManager:0.1.0' 
}
 

//For Automatic Permission request.

//It Dynamically search for apps permission and request for the same.

//Below code in onCreate function.

@Override
  protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);
  permission=new PermissionManager() {

}
;  permission.checkAndRequestPermissions(this);

  
}
  

//Below code in onRequestPermissionsResult function

@Override
  public void onRequestPermissionsResult(int requestCode,String permissions[], int[] grantResults) {

permission.checkResult(requestCode,permissions, grantResults);

  
}
 

//Customized by overriding method shown below.

permission=new PermissionManager() {

 @Override

 public void ifCancelledAndCanRequest(Activity activity) {

  // Do Customized operation if permission is cancelled without checking "Don't ask again"

  // Use super.ifCancelledAndCanRequest(activity);
 or Don't override this method if not in use

 
}

  @Override

 public void ifCancelledAndCannotRequest(Activity activity) {

  // Do Customized operation if permission is cancelled with checking "Don't ask again"

  // Use super.ifCancelledAndCannotRequest(activity);
 or Don't override this method if not in use

 
}

  @Override

 public List<String> setPermission() {

  // If You Don't want to check permission automatically and check your own custom permission

  // Use super.setPermission();
 or Don't override this method if not in use

  List<String> customPermission=new ArrayList<>();

customPermission.add(Manifest.permission.ACCESS_FINE_LOCATION);

  return customPermission;

 
}

}
; 

 //To initiate checking permission 


  permission.checkAndRequestPermissions(this);
 

//To get Granted Permission and Denied Permission

@Override
  public void onRequestPermissionsResult(int requestCode,String permissions[], int[] grantResults) {

permission.checkResult(requestCode,permissions, grantResults);

//To get Granted Permission and Denied Permission

ArrayList<String> granted=permission.getStatus().get(0).granted;

ArrayList<String> denied=permission.getStatus().get(0).denied;
  
}
 

Resources

Android solution to simplify work with different camera apis. Include video and photo capturing features with possibility to select quality for appropriate media action etc.

This is a demo library to solve the problems with RecyclerView.

Android port of Dan Palmers's jquery.complexify.js.

This is a custom implementation of a RelativeLayout that you can use along with a ViewPager to navigate between fragments. You can use this library if you want 3 tabs(icon + text).

The Spatialite geospatial database ported for Android. 100% offline, portable and self-contained as SQLite.

WHEN DO I NEED IT?

  • When you need deployment, collecting, processing and fast querying of small to huge amounts of geometry data (points, polylines, polygons, multipolygons, etc.) on Android devices.
  • When you want to be 100% independent from any server/cloud backend.

Quick and convenient way to shorten urls using goo.gl service with Rx and Kotlin.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes