Appcelerator : Add permission WRITE_EXTERNAL_STORAGE for android 6

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>var permission = 'android.permission.WRITE_EXTERNAL_STORAGE';
function saveToGallery() {
    var videoFile = Ti.Filesystem.getFile('BigBuckBunny_320x180.mp4');
    Ti.Media.saveToPhotoGallery(videoFile.read(), {
        success : function(e) {
            console.log('SAVED TO GALLERY!');
        },
        error : function(e) {
            console.log('SAVE ERROR: ', e)
        }
    });
}

if (Ti.Android.hasPermission(permission)) {
    saveToGallery();
} else {
    Ti.Android.requestPermissions([permission], function(e) {
        if (e.success) {
            saveToGallery();
        } else {
            Ti.API.info('PERMISSIONS ERROR: ' + e.error);
        }
    });
}

মন্তব্যসমূহ

এই ব্লগটি থেকে জনপ্রিয় পোস্টগুলি

Github: Push an existing repository from the command line

Android : Enable/Disable wifi programmatically

Android : Firebase Cloud Messaging