<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Tetsuya -- the next release in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/resolveFileSystemURL-on-Android-5-X/m-p/1093317#M66056</link>
    <description>&lt;P&gt;Tetsuya -- the next release will include Cordova CLI 5.4.1+ (see specifics here &amp;gt; &lt;A href="https://software.intel.com/en-us/xdk/faqs/cordova#cordova-version)" target="_blank"&gt;https://software.intel.com/en-us/xdk/faqs/cordova#cordova-version)&lt;/A&gt; which would be the best option to try. It is very close to the latest version of Cordova.&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2016 01:07:04 GMT</pubDate>
    <dc:creator>PaulF_IntelCorp</dc:creator>
    <dc:date>2016-03-02T01:07:04Z</dc:date>
    <item>
      <title>resolveFileSystemURL on Android 5.X</title>
      <link>https://community.intel.com/t5/Software-Archive/resolveFileSystemURL-on-Android-5-X/m-p/1093314#M66053</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to read photo data stored in the photo library on Android device (5.1).&lt;BR /&gt;
	I've tried to use window.resolveFileSystemURL for that, but it failed by the error code 1000.&lt;/P&gt;

&lt;P&gt;How can I treat on this problem?&lt;/P&gt;

&lt;P&gt;We can easily reproduce the problem by the following steps.&lt;/P&gt;

&lt;P&gt;1. Create new project using XDK sample "Image Capture".&lt;BR /&gt;
	2. Add "File" plugin&lt;BR /&gt;
	3. Replace www/js/main.js by the code shown below;&lt;BR /&gt;
	4. Build the project and launch it on some Android 5.1 device&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;/*jslint sloppy:true, browser:true, devel:true, white:true, vars:true, eqeq:true, plusplus:true */
/*global $:false, intel:false*/
/** 
 * This function runs once the page is loaded, but intel is not yet active 
 */

var windowHeight;
var init = function () {
    windowHeight=window.innerHeight;
    var currentpic = document.getElementById("slideshowpicid");  
    currentpic.onload=alignImageMiddle;
};

window.addEventListener("load", init, false);  

/**
 * Prevent Default Scrolling 
 */
var preventDefaultScroll = function(event) 
{
    // Prevent scrolling on this element
    event.preventDefault();
    window.scroll(0,0);
    return false;
};
    
window.document.addEventListener("touchmove", preventDefaultScroll, false);

/**
 * Device Ready Code 
*/

var fileSystem = null;

var onDeviceReady=function(){&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // called when Cordova is ready
   if( window.Cordova &amp;amp;&amp;amp; navigator.splashscreen ) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Cordova API detected
        navigator.splashscreen.hide() ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // hide splash screen
    }
} ;
document.addEventListener("deviceready", onDeviceReady, false);


//Event listener for camera
//document.addEventListener("intel.xdk.camera.picture.add",onSuccess); 
//document.addEventListener("intel.xdk.camera.picture.busy",onSuccess); 
//document.addEventListener("intel.xdk.camera.picture.cancel",onSuccess); 
var picturecount=0;

function onSuccess(imageURI) 
{
    
    var pic1 = document.getElementById("photoone");
    var pic2 = document.getElementById("phototwo");
    var pic3 = document.getElementById("photothree");

        var changebutton = document.getElementById("buttonid");    

        pic3.src = pic2.src;
        pic2.src = pic1.src;
        pic1.src = imageURI;
    


        if(picturecount&amp;gt;=2)  
        {
            changebutton.innerHTML = "Make Slideshow";
            changebutton.className = "button showbutton";
            changebutton.onclick=makeslideshow;
        } 
        picturecount++;    
    
    window.resolveLocalFileSystemURL(
        imageURI,
        function(fileEntry) {
            var reader = new FileReader();
            reader.onload = function(evt) {
                var result = evt.target.result;
                alert("read file bytes=" + result.byteLength);
            };
            fileEntry.file(function(file) {
                alert("read file");
                reader.readAsArrayBuffer(file);
            });
        },
        function(error) {
            alert("read file failed. " + JSON.stringify(error));
        });
}

function onFail(message) {
   alert("Picture failure: " + message);
}
//This function creates the slideshow of the captured pictures.
function makeslideshow()
{
    var changebutton = document.getElementById("buttonid");
    var pic1 = document.getElementById("photoone");
    var pic2 = document.getElementById("phototwo");
    var pic3 = document.getElementById("photothree");
    pic1.className="hide";
    pic2.className="hide";
    pic3.className="hide"; 
    changebutton.innerHTML="Take Picture";   
    changebutton.className="button hide";
    document.getElementById("imagecontent").className="show";
    var currentpic = document.getElementById("slideshowpicid");
    currentpic.src=pic1.src;
}

function alignImageMiddle(){
    var currentpic = document.getElementById("slideshowpicid");  
    var height = window.innerHeight;
    currentpic.style.marginTop=(height-currentpic.offsetHeight)/2+"px";
}

/**
 * The following functions could be a single function that moves forwards or backwards.
 * For the demo we want users to be able to see exactly what is going on
 */

//Move to the next picture.  If we are at the last picture, we jump to the first.
function Next()
{
    var pic1 = document.getElementById("photoone");
    var pic2 = document.getElementById("phototwo");
    var pic3 = document.getElementById("photothree");
    var currentpic = document.getElementById("slideshowpicid");
    var currentsrc = currentpic.src;

    if(currentsrc===pic1.src)
    {
        document.getElementById("slideshowpicid").src=pic2.src;  
    }
    else if(currentsrc===pic2.src)
    {
        document.getElementById("slideshowpicid").src=pic3.src;
    }
    else
    {
        document.getElementById("slideshowpicid").src=pic1.src;
    }
    
}

//Move to previous picture.  If we are at the first picutre, we jump to the last.
function Previous()
{
    var pic1 = document.getElementById("photoone");
    var pic2 = document.getElementById("phototwo");
    var pic3 = document.getElementById("photothree");

    var currentsrc = document.getElementById("slideshowpicid").src;

     if(currentsrc===pic1.src)
    {
       document.getElementById("slideshowpicid").src=pic3.src; 
    }
    else if(currentsrc===pic2.src)
    {
        document.getElementById("slideshowpicid").src=pic1.src;
    }
    else
    {
       document.getElementById("slideshowpicid").src=pic2.src;
    }

}

//Functionality to end the slideshow
function endslideshow()
{
    document.getElementById("imagecontent").className="hide";
    picturecount=0;

    var pic1 = document.getElementById("photoone");
    var pic2 = document.getElementById("phototwo");
    var pic3 = document.getElementById("photothree");
    var changebutton = document.getElementById("buttonid");
    
    pic1.className="";
    pic2.className="";
    pic3.className="";  

    pic1.src="images/EmptyBox-Phone.png";
    pic2.src="images/EmptyBox-Phone.png";
    pic3.src="images/EmptyBox-Phone.png";
    
    changebutton.onclick=takepicture;  
    changebutton.className="button";
}

//Camera button functionality
function takepicture()
{
    navigator.camera.getPicture(onSuccess, onFail, { quality: 50,
                                                     sourceType: navigator.camera.PictureSourceType.SAVEDPHOTOALBUM,
                                                     destinationType: navigator.camera.DestinationType.NAVITE_URI,
                                                     encodingType: navigator.camera.EncodingType.JPEG
                                                    });

} 
&lt;/PRE&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
	--&lt;BR /&gt;
	tetsuya&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 12:24:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/resolveFileSystemURL-on-Android-5-X/m-p/1093314#M66053</guid>
      <dc:creator>tetsuya</dc:creator>
      <dc:date>2016-03-01T12:24:37Z</dc:date>
    </item>
    <item>
      <title>Looks like this may be the</title>
      <link>https://community.intel.com/t5/Software-Archive/resolveFileSystemURL-on-Android-5-X/m-p/1093315#M66054</link>
      <description>&lt;P&gt;Looks like this may be the same problem you're having &amp;gt; &lt;A href="http://stackoverflow.com/questions/30640251/cordova-resolvelocalfilesystemurl-error-code-1000-in-android" target="_blank"&gt;http://stackoverflow.com/questions/30640251/cordova-resolvelocalfilesystemurl-error-code-1000-in-android&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 21:40:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/resolveFileSystemURL-on-Android-5-X/m-p/1093315#M66054</guid>
      <dc:creator>PaulF_IntelCorp</dc:creator>
      <dc:date>2016-03-01T21:40:10Z</dc:date>
    </item>
    <item>
      <title>Hi, Paul.</title>
      <link>https://community.intel.com/t5/Software-Archive/resolveFileSystemURL-on-Android-5-X/m-p/1093316#M66055</link>
      <description>&lt;P&gt;Hi, Paul.&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Thank you for your quick answer!&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;The sample project became working fine by downgrading Cordova CLI version to 4.1.2.&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;I will take this workaround until fixed version of Cordova is included in XDK.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
	--&lt;BR /&gt;
	tetsuya&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 00:44:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/resolveFileSystemURL-on-Android-5-X/m-p/1093316#M66055</guid>
      <dc:creator>tetsuya</dc:creator>
      <dc:date>2016-03-02T00:44:52Z</dc:date>
    </item>
    <item>
      <title>Tetsuya -- the next release</title>
      <link>https://community.intel.com/t5/Software-Archive/resolveFileSystemURL-on-Android-5-X/m-p/1093317#M66056</link>
      <description>&lt;P&gt;Tetsuya -- the next release will include Cordova CLI 5.4.1+ (see specifics here &amp;gt; &lt;A href="https://software.intel.com/en-us/xdk/faqs/cordova#cordova-version)" target="_blank"&gt;https://software.intel.com/en-us/xdk/faqs/cordova#cordova-version)&lt;/A&gt; which would be the best option to try. It is very close to the latest version of Cordova.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 01:07:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/resolveFileSystemURL-on-Android-5-X/m-p/1093317#M66056</guid>
      <dc:creator>PaulF_IntelCorp</dc:creator>
      <dc:date>2016-03-02T01:07:04Z</dc:date>
    </item>
    <item>
      <title>Hi Paul,</title>
      <link>https://community.intel.com/t5/Software-Archive/resolveFileSystemURL-on-Android-5-X/m-p/1093318#M66057</link>
      <description>&lt;P&gt;Hi Paul,&lt;/P&gt;

&lt;P&gt;Good news!&lt;BR /&gt;
	I'm looking forward to that.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
	--&lt;BR /&gt;
	tetsuya&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2016 01:11:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/resolveFileSystemURL-on-Android-5-X/m-p/1093318#M66057</guid>
      <dc:creator>tetsuya</dc:creator>
      <dc:date>2016-03-02T01:11:37Z</dc:date>
    </item>
  </channel>
</rss>

