Languages

Menu
Sites
Language
Strange behaviour on Tizen 4.0

My application was rejected by TizenStore because it doesnt runs perfect on Tizen 4.0 and I dont know why.

I download images from Server A and write them to the storage on the phone. It works perfectly on Tizen 2.3, Tizen 2.4 and Tizen 3.0. But something goes wrong in Tizen 4.0

My write to storage looks like this

var file = dir.createFile(data.name + ".png");
	
	if(file !== null) {
		file.openStream(
			'w', 
			function(stream) {	
				stream.writeBase64(data.image);
				stream.close();
				callback(data.state);
			},
			function(err) {
				console.log("Error " + err.message);
			},
			"UTF-8"
		);
	}

To show the image I use this

var file;

    if(this.name === 'Recruit') {
		return '/images/recruit.png';
	} else {
		file = dir.resolve(this.cleanName() + ".png");
		
		return file.toURI();		
	}

Result in Tizen 2.x and Tizen 3.x

Result in Tizen 4.0

Currently I use "wgt-private" as location, but got the same issue with different locations like "downloads", "images".

Edited by: Marco Buettner on 16 Aug, 2018

Responses

4 Replies
André Reus

Hi Marco, 
I found similar problem once, I use scanFile function to update contents. After calling scanFile the image/file showed correctly! 

Privilege: http://tizen.org/privilege/content.write

Code:

/* Following example scans "tizen.jpg" in media directory */

function errorCB(err)
{
  console.log("The following error occurred: " + err.name);
}

function successCB(path)
{
  console.log("scanning is completed");
}

tizen.filesystem.resolve("images/tizen.jpg", function(imageFile)
{
  tizen.content.scanFile(imageFile.toURI(), successCB, errorCB);
});

 

Please check here https://developer.tizen.org/ko/development/api-references/web-application?redirect=https://developer.tizen.org/dev-guide/4.0.0/org.tizen.web.apireference/html/device_api/mobile/tizen/content.html#ContentManager::scanFile

Marco Buettner

Hey,

Thx for the reply, I will check it :)

Marco Buettner

I test it, but I want to use "wgt-private" for saving the files and when I use it, I got "UnknownError"

Marco Buettner

I change for some tests from wgt-private to "downloads" but still doesnt work.