Infeasible
Status Update
Comments
gf...@google.com <gf...@google.com>
da...@gmail.com <da...@gmail.com> #2
This would indeed be very useful feature I think. Currently, my only alternative is to reorganize all my subfolders and their contents to be in the top-most directory of which I know the name of. First of all, this results in this directory having thousands of files, each with a VERY long name to properly identify it based on its original path. Secondly, it requires additional effort on the reorganizing side of things; I need some script to do something I feel should've been part of the NDK...I mean there's already a function for iterating over files, why not folders as well?
Just my two cents :)
Just my two cents :)
ni...@osomi.net <ni...@osomi.net> #3
I agree that it would be a useful feature, the alternatives that I have seen require either the user to avoid folders altogether, a Java backend (which is one of the things the NDK tries to avoid) or finding the apk as zip and searching for directories (slow & unnecessary).
[Deleted User] <[Deleted User]> #4
That's frustrating...But for those who are looking for a pure C++ solution, I would recommend using Qt Framework on Android. You can iterate over folders with the following code snippet:
foreach (const QString& dirName, QDir("assets:/").entryList(QDir::AllDirs | QDir::NoDotAndDotDot)
Qt probably uses a Java backend for this, but it works at the end. You can use many Qt classes across multiple operating systems without thinking about all that garbage. They handle all the wrappers etc for you. Just a little suggestion 👍🏻
foreach (const QString& dirName, QDir("assets:/").entryList(QDir::AllDirs | QDir::NoDotAndDotDot)
Qt probably uses a Java backend for this, but it works at the end. You can use many Qt classes across multiple operating systems without thinking about all that garbage. They handle all the wrappers etc for you. Just a little suggestion 👍🏻
jo...@gmail.com <jo...@gmail.com> #5
I would love to see this feature implemented as well. I'd love to be able to organize assets by directory in the NDK without using some weird hack or importing a massive framework like Qt -- my binary size right now is minuscule, and I'd likely quadruple it by bringing in Qt. That's not even to mention the fact that apps that don't rely on Qt would be swatting flies with sledgehammers by solving this issue by linking to Qt.
[Deleted User] <[Deleted User]> #6
Yes Qt is a massive framework. It's not an optional solution for such a small problem, I didn't want to mean that; I was meaning the shifting of entire development platform from Android to fully cross-platform Qt C++ Framework (for a few reasons):
* Qt is a C++ platform; whereas Android is not exactly (Java, Kotlin and all that garbage is the primary focus of Android)
* Qt is better maintained in terms of C++
* Apps written with Qt can work on Android, iOS, macOS, Windows, *nix, Linux, Embedded... with a single code base
* Qt has built-in cross-platform key features like event driven programming, media encoding/playing, animations, networking, databasing, image encoding/rendering, purchasing, scripting, data visualization, 2d/3d rendering etc. (you would normally find a 3rd party library for every one of those features on Android or write your own solution)
Anyway, that's just a suggestion.
* Qt is a C++ platform; whereas Android is not exactly (Java, Kotlin and all that garbage is the primary focus of Android)
* Qt is better maintained in terms of C++
* Apps written with Qt can work on Android, iOS, macOS, Windows, *nix, Linux, Embedded... with a single code base
* Qt has built-in cross-platform key features like event driven programming, media encoding/playing, animations, networking, databasing, image encoding/rendering, purchasing, scripting, data visualization, 2d/3d rendering etc. (you would normally find a 3rd party library for every one of those features on Android or write your own solution)
Anyway, that's just a suggestion.
ma...@gmail.com <ma...@gmail.com> #7
Please add a AAssetDir_getNextFileOrDirectoryName or similar. This is essential and basic functionality that shouldn't be missing.
zj...@gmail.com <zj...@gmail.com> #8
+1
ad...@gmail.com <ad...@gmail.com> #9
Keep up the good work.
ad...@gmail.com <ad...@gmail.com> #10
#googleadswords.com
gf...@google.com <gf...@google.com>
sc...@google.com <sc...@google.com> #11
Can we make an internal mirror bug for this feature request? Thanks!
gf...@google.com <gf...@google.com> #12
is...@google.com <is...@google.com>
nc...@google.com <nc...@google.com> #13
Internal bug assigned. Closing the external bug. Issue is being worked on.
ra...@hotmail.com <ra...@hotmail.com> #14
Hello, is this internal bug still being worked on? It's been over a year since it was created. Thanks.
nc...@google.com <nc...@google.com> #15
I checked b/248283470 and sorry it had been closed. Therefore, no this is not currently being worked on anymore.
ra...@hotmail.com <ra...@hotmail.com> #16
Thank you for checking. I'm surprised that this has been closed and isn't being worked on however, as this is something really basic that the NDK should provide. What will it take to get this task reopened?
nc...@google.com <nc...@google.com> #17
Hi,
Sometimes filing it again will get more traction. This component captures issues related to documentation ONLY onsource.android.com , the website of the Android Open Source Project, so you might try some of the other bug queues.
For issues with the Android operating system, file a bug with the associated component found at:
https://source.android.com/setup/contribute/report-bugs
For user issues, find the right place to get help at the Android help center at
https://support.google.com/android/table/7393834
For questions on github usage, refer to
https://support.github.com/request/account?tags=dotcom-footer%2Chubberfy_account
HTH!
Sometimes filing it again will get more traction. This component captures issues related to documentation ONLY on
For issues with the Android operating system, file a bug with the associated component found at:
For user issues, find the right place to get help at the Android help center at
For questions on github usage, refer to
HTH!
Description
The spec shows that there is only a function for iterating over files, not directories. This either means that the developers using the NDK can't query the asset manager for directories; at least not on my device. Or that it only works on some devices (not on 8.0.0 s7 edge). I'd recommend adding AAssetDir_getNextFolderName, requiring AAssetDir_getNextFileName to display directories as well as assets or providing a function to loop over all files in the assets dir (nested).
AAssetManager *assetManager = ((android_app*)param)->activity->assetManager;
AAssetDir *dir = AAssetManager_openDir(assetManager, path);
Log::println(String((void*)dir));
const char *name = nullptr;
while ((name = AAssetDir_getNextFileName(dir)) != nullptr) {
Log::println(String("res/") + name);
}
AAssetDir_close(dir);
Doesn't do anything for path = "" or "res" (assets/res), but when I pass in a directory with files "res/shaders" (assets/res/shaders) it does work.
EDIT: