Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Write files to the folder in applicationDataDirectory/externalstoragedirectory in Android

$
0
0

I am unable to write files to the folder and save to photo gallery.

Ti.UI.setBackgroundColor('#fff');
var win=Ti.UI.createWindow({
    backgroundColor:'#fff'
});
var imageView=Ti.UI.createImageView({
    image:'KS_nav_ui.png',
    //backgroundColor:'white'
});
win.add(imageView);
var image = imageView.toImage();
    var newDir = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'test'); 
var newFile = Titanium.Filesystem.getFile(newDir.nativePath,'img.png'); 
 newFile.write(image.media);
 Ti.Media.Android.scanMediaFiles([newFile.nativePath], null, function(e){});
win.open();

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>