[Dev] Fwd: Content url problem fixed..

McGee, Art amcgee7 at jaguarlandrover.com
Wed Apr 15 16:13:58 GMT 2015


See,  Below for how to access media from within the content folder.

Thanks,

-- 
*Art McGee*
Infotainment Engineer



Jaguar Land Rover North America, LLC
1419 NW 14th Ave, Portland, Oregon, 97209
JaguarUSA.com <http://www.jaguarusa.com/index.html>  |  LandRoverUSA.com
<http://www.landrover.com/us/en/lr/>

---------- Forwarded message ----------
From: McGee, Art <amcgee7 at jaguarlandrover.com>
Date: 15 April 2015 at 09:09
Subject: Content url problem fixed..
To: Aaron Eiche <aeiche at jaguarlandrover.com>


Aaron,

I found out how to use the API to access the images.  I noticed the url are
more like.  file:///home/app/content/Images/*.png

Here is some online docs.

https://developer.tizen.org/dev-guide/2.2.1/org.tizen.web.appprogramming/html/tutorials/content_tutorial/browsing_content.htm

Attached is a working wigit show images.

Heres a few notes.

config.xml:

    <tizen:privilege name="http://tizen.org/privilege/content.read"/> I
suspect that this one is needed.
    <tizen:privilege name="http://tizen.org/privilege/filesystem.read"/>

main.js:

var TheConentManager = tizen.content

function onContentItemArraySuccess(contents)
{
   for (var i=0; i < contents.length; i++)
   {
      console.log(i + ":" + contents[i].type + ":" + contents[i].title +
":" + contents[i].mimeType);
      console.log("content:",contents[i]);
      var img = document.createElement("img");
      img.setAttribute("src",contents[i].contentURI);
      var text = document.createTextNode(contents[i].title);
      var listelement = document.createElement("li");
      listelement.appendChild(img);
      listelement.appendChild(text);
      document.querySelector("#itemlist").appendChild(listelement);
   }
}

function onDirectoryArraySuccess(directories)
{
   console.log("onDirectoryArraySucces Count="+directories.length);
   for (var i = 0; i < directories.length; i++)
   {
      /* Retrieve folder-specific information */
      console.log("DIR:",directories[i]);
   }
}

var contentType = "IMAGE";
var filter = new tizen.AttributeFilter("type", "EXACTLY", contentType);
TheConentManager.find(onContentItemArraySuccess, onError, null, filter);
TheConentManager.getDirectories(onDirectoryArraySuccess, onError);


-- 
*Art McGee*
Infotainment Engineer



Jaguar Land Rover North America, LLC
1419 NW 14th Ave, Portland, Oregon, 97209
JaguarUSA.com <http://www.jaguarusa.com/index.html>  |  LandRoverUSA.com
<http://www.landrover.com/us/en/lr/>




-- 
*Art McGee*
Infotainment Engineer



Jaguar Land Rover North America, LLC
1419 NW 14th Ave, Portland, Oregon, 97209
JaguarUSA.com <http://www.jaguarusa.com/index.html>  |  LandRoverUSA.com
<http://www.landrover.com/us/en/lr/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tizen.org/pipermail/dev/attachments/20150415/312f0d2c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestImageAccess.wgt
Type: application/octet-stream
Size: 84533 bytes
Desc: not available
URL: <http://lists.tizen.org/pipermail/dev/attachments/20150415/312f0d2c/attachment-0001.obj>


More information about the Dev mailing list