Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11689] Android: Ti.Filesystem directory object: nativePath and getNetivePath() return different results on iOS and Android. Parity issue.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2013-04-30T16:59:58.000+0000
Affected Version/sRelease 2.1.3, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsexalture, parity
ReporterAmuktha Akkinepally
AssigneeSunila
Created2012-11-07T18:50:23.000+0000
Updated2017-03-20T20:51:42.000+0000

Description

The nativePath property and getNativePath() method for directory objects return differently on Android and iOS. Steps to reproduce: 1. Load the below app.js 2. Test this on both android and iOS Expected Result: The path should be the same on both. Actual Result: It is different on both. app.js:

var tabGroup = Titanium.UI.createTabGroup();


//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff',
    layout: 'vertical',
});
var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});

var newDir = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, "testdirectory");
newDir.createDirectory();

var npPropertyLabel = Ti.UI.createLabel({
	height: Ti.UI.SIZE,
	width: Ti.UI.SIZE,
	text: 'Native Path Property: ' + newDir.nativePath,
	color: 'red',
});

var npMethodLabel = Ti.UI.createLabel({
	height: Ti.UI.SIZE,
	width: Ti.UI.SIZE,
	text: 'Native Path Method: ' + newDir.getNativePath(),
	color: 'red',
});

var namePropertyLabel = Ti.UI.createLabel({
	height: Ti.UI.SIZE,
	width: Ti.UI.SIZE,
	text: 'Name Property: ' + newDir.name,
	color: 'black',
});

var nameMethodLabel = Ti.UI.createLabel({
	height: Ti.UI.SIZE,
	width: Ti.UI.SIZE,
	text: 'Name Method: ' + newDir.getName(),
	color: 'black',
});


win1.add(npPropertyLabel);
win1.add(npMethodLabel);
win1.add(namePropertyLabel);
win1.add(nameMethodLabel);

//
//  add tabs
//
tabGroup.addTab(tab1);  


// open tab group
tabGroup.open();

Attachments

FileDateSize
iOS Simulator Screen shot Mar 21, 2013 2.14.19 PM.png2013-03-21T08:58:46.000+000047049
Screenshot_2013-03-21-14-15-48.png2013-03-21T08:58:46.000+000029146

Comments

  1. jithinpv 2013-03-21

    Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4 iOS iPhone Simulator: iOS SDK version: 6.0 jithinpv
  2. Sunila 2013-04-30

    Native path is platform specific and will be different on IOS and Android
  3. Lee Morris 2017-03-20

    Closing ticket as invalid.

JSON Source