Coder Social home page Coder Social logo

benbahrenburg / ti-android-requeststoragepermission Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gimdongwoo/ti-android-requeststoragepermission

3.0 2.0 0.0 4.14 MB

Request Android Storage Permission for Titanium SDK 5.1.0+

License: Other

HTML 0.57% Makefile 85.44% C++ 10.81% Java 1.92% JavaScript 1.25%

ti-android-requeststoragepermission's Introduction

Request Android Storage Permission for Titanium SDK 5.1.0+

Description

for Titanium SDK 5.1.0+ & Android 6.0+

Accessing the ti-android-requeststoragepermission Module

To access this module from JavaScript, you would do the following:

var ti_android_requeststoragepermission = require("com.boxoutthinkers.reqstorageperm");

The ti_android_requeststoragepermission variable is a reference to the Module object.

Reference

from Titanium SDK https://github.com/appcelerator/titanium_mobile/blob/5_2_X/android/modules/media/src/java/ti/modules/titanium/media/MediaModule.java

Usage

// request storage permission
if (OS_ANDROID) {
	var requestStoragePermission = function() {
		var RSP = require("com.boxoutthinkers.reqstorageperm");
		if (!RSP.hasStoragePermission()) {
			RSP.requestStoragePermissions(function(e) {
				if (e.success) {
					// success
					Ti.API.info('requestStoragePermission : success');
				} else {
					Ti.API.error('requestStoragePermission : error');
				}
			});
		} else {
			Ti.API.info('requestStoragePermission : already have');
		}
	}
	// do
	requestStoragePermission();
}

Author

Dongwoo Gim, BOXOUT THINKERS

License

MIT License

ti-android-requeststoragepermission's People

Contributors

gimdongwoo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

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.