x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How does "Additional Non-asset Directories to Package" works?

I want to read text file by C++ std API '"fopen", it's successful on Windows, but read failed on Android.

 FString projectDir = FPaths::GameDir();
 FString path = projectDir + TEXT("Content/Resource/conf/role/Role.conf");
 FILE * fp = ::fopen(TCHAR_TO_ANSI(*path), "rb");
 
 if (fp)
 {
     TxtDebug->SetText(FText::FromString("TRUE++++++++++++"));
 }
 else
 {
     TxtDebug->SetText(FText::FromString("FALSE-----------"));
 }

as I know, if there are some files should be inclued when Packaging, "Additional Non-asset Directories to Package" should be checked. even I check this setting, fopen still read file failed. alt text

Product Version: UE 4.11 Preview
Tags:
package-1.png (11.7 kB)
more ▼

asked Feb 26 '16 at 02:33 PM in Using UE4

avatar image

笑傲江湖-DA
216 13 24 32

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

UE4 isn't support c++ low level API on Android, I should use UE4 IO API instead of fopen

 FString Content;
 FFileHelper::LoadFileToString(Content, *(projectDir));
more ▼

answered Mar 11 '16 at 02:46 PM

avatar image

笑傲江湖-DA
216 13 24 32

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Android

 extern FString GExternalFilePath;
 FString path = GExternalFilePath + TEXT("Content/Resource/conf/role/Role.conf");

iOS

 NSArray *docu = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
 NSString *docu_path = [docu firstObject];
 FString RootPath(docu_path);
 FString path = RootPath + TEXT("Content/Resource/conf/role/Role.conf");

if you can't open the file with Android,you'll need READ_EXTERNAL_STORAGE permission.

more ▼

answered Apr 18 '18 at 06:19 AM

avatar image

_ODIN_
1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question