Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to retrieve a MP3 file from ./assets/internal ?


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Sep 7, 2017 6:07 PM Last Post By: GAI CHEW KAI
GAI CHEW KAI

Posts: 53
Registered: 7/29/04
How to retrieve a MP3 file from ./assets/internal ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 7, 2017 1:53 AM
Embarcadero® C++Builder 10.2 Version 25.0.26309.314
Android 7.0.1
Microsoft Windows 10 x64 Pro [Version 10.0.14393]

I have added few MP3 files into an Android project, when deployed to mobile I cannot browse any of the MP3 files ?

1. I am using the following method but the file not exists.

UnicodeString us = System::Ioutils::TPath::Combine( System::Ioutils::TPath::GetDocumentsPath(), "test.mp3" );

// us ..../data/users/0/com.embarcadero.xxxx/files/test.mp3

2. Where is actually those MP3 files stored on Android phone and how to retrieve if ./assets/internal is used ?

Please advise.
Mark Richards

Posts: 42
Registered: 12/8/99
Re: How to retrieve a MP3 file from ./assets/internal ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 7, 2017 5:33 AM   in response to: GAI CHEW KAI in response to: GAI CHEW KAI
Try this instead?

UnicodeString us = IncludeTrailingPathDelimiter(System::Ioutils::TPath::GetDocumentsPath()) + "test.mp3";

1. I am using the following method but the file not exists.

UnicodeString us = System::Ioutils::TPath::Combine( System::Ioutils::TPath::GetDocumentsPath(), "test.mp3" );

// us ..../data/users/0/com.embarcadero.xxxx/files/test.mp3

2. Where is actually those MP3 files stored on Android phone and how to retrieve if ./assets/internal is used ?

Please advise.
GAI CHEW KAI

Posts: 53
Registered: 7/29/04
Re: How to retrieve a MP3 file from ./assets/internal ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 7, 2017 8:10 AM   in response to: Mark Richards in response to: Mark Richards
Mark Richards wrote:
Try this instead?

UnicodeString us = IncludeTrailingPathDelimiter(System::Ioutils::TPath::GetDocumentsPath()) + "test.mp3";
- already tried but the result failed. The file failed to be detected via FileExists()
GAI CHEW KAI

Posts: 53
Registered: 7/29/04
Re: How to retrieve a MP3 file from ./assets/internal ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 7, 2017 9:09 AM   in response to: Mark Richards in response to: Mark Richards
I found the answer that is, to add files via the Deployment Manager which result in Type as "File", the default remote path is ".\" and I changed to ".\assets\internal\" then thing working ok.

Both methods working fine, such as:

us = System::Ioutils::TPath::Combine( System::Ioutils::TPath::GetDocumentsPath(), L"test.mp3" );

OR

us = IncludeTrailingPathDelimiter( System::Ioutils::TPath::GetDocumentsPath() ) + L"test.mp3";

NOTE: The reason previously attempts failed is because I added MP3 files via the Project Group, the Type will be "Project Files" which the above methods will fail.

us is reported as:

/data/user/0/com.embarcadero.xxx/files/test.mp3

Hopes this help.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02