Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2131] BlackBerry: Ti.Filesystem.getFile path is wrong

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2014-02-25T03:34:55.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy, Titanium SDK & CLI
Labelsblackberry
ReporterHazem Khaled
AssigneeShak Hossain
Created2014-02-13T11:11:46.000+0000
Updated2016-03-08T07:41:06.000+0000

Description

Hello, You know default path on Titanium project is /Resources while we need to add the BB10 path before "app/native/assets/" for example
if (OS_BLACKBERRY){
   var url = 'app/native/assets/strings.xml';
} else {
   var url = 'strings.xml';
}

var file = Ti.Filesystem.getFile(url);
Can we please make BlackBerry path like anyone else, or add this problem in documentation Thanks a lot

Comments

  1. Hazem Khaled 2014-02-24

    Maybe we need to use something like that QDir::currentPath() + "/app/native/assets/" + (path of file)
  2. Pedro Enrique 2014-02-24

    Can you try
       var file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'strings.xml');
       
    This should work in all platforms.
  3. Hazem Khaled 2014-02-24

    I'm already using this workaround Ti.Filesystem.getFile('app/native/assets/strings.xml'); and working fine, also your solution working fine Thanks
  4. Pedro Enrique 2014-02-25

    That is not a workaround, that is the proper way to do it.
       var file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'strings.xml');
       
    Closing as invalid, thanks for reporting.

JSON Source