Custom folder for Android?

Stuck at a level? Need help with R'n'D or anything R'n'D related? Post here!

Moderators: Zomis, Flumminator

Post Reply
MichaelCPalmer1980
Posts: 8
Joined: Thu Nov 02, 2017 10:11 am

Custom folder for Android?

Post by MichaelCPalmer1980 » Wed Jan 17, 2018 11:00 am

I downloaded thousands of levels yesterday but then ran into a little problem. I run the Android version, which lacks documenation, and althought it does have storage permission, I cannot find a R&D folder on my SDCard. Without root access, my file manager won't show R&D's internal directory so I can't add levelsets to it.

It seems to me that the Android version has the potential to be the most played version of R&Ds and reallly ought to be better supported. Can someone point me in the right direction for:

Finding custom artwork
Info about creating custom artwork
How to use custom content in the Android version

Many thanks
Mike

User avatar
Holger
Site Admin
Posts: 3225
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Custom folder for Android?

Post by Holger » Thu Jan 18, 2018 10:53 pm

I run the Android version, which lacks documenation, ...
Unfortunately, that's right... :-/
... and althought it does have storage permission, I cannot find a R&D folder on my SDCard. Without root access, my file manager won't show R&D's internal directory so I can't add levelsets to it.
At least I should add some notes about adding additional level sets. The problem is that this is really not user-friendly at all, I'm afraid, as Android does not make it as easy as it is on Windows/Mac/Linux.

The general procedure is discussed/described in this thread:

How to add levels to android version

To summarize it:
  • First of all: You do not need root access!
  • You do need the latest version 4.0.1.0 of R'n'D.
  • Download any zip archive with R'n'D level sets; it should be placed in the "Download" directory.
  • Extract the zip archive with a third-party tool like "RAR" to the "RAR" application's "files" directory (because normal Android apps are only allowed to write to their own data directory).
  • Using the "official" file manager of your Android device (like "My Files" on Samsung devices), move the extracted level set directory from the "RAR" files directory to the R'n'D "levels" directory inside of R'n'D's "files" directory.
  • Restart R'n'D and select the newly installed level set!
Some more details to find the right directories: On my Samsung Android devices (Samsung Galaxy S4 mini and Samsung Galaxy Tab), using the "My Files" application, I first have to select "All files" first from the top-level screen, which effectively moves to "/storage" (displayed on top of the screen). From there, I can either select "Decive storage" and "SD memory card". Select "Device storage" here (this effectively moves to "/storage/emulated/0" on my device). From here, I can navigate to directory "Download" (to find my downloaded R'n'D level set zip archive files), or to "Android/data" (that means, go to the "Android" folder first, then go to the "data" folder). From here, move the extracted R'n'D level set folders from folder "com.rarlab.rar/files" to folder "org.artsoft.rocksndiamonds/files/levels". That's it!

UPDATE:

It seems that the whole process is much easier, as "RAR" apparently can write to other applications "files" folder! Just tested on my S4 mini, and it seems to work just fine! So, you would then only need the following steps:
  • Download any zip archive with R'n'D level sets; it should be placed in the "Download" directory.
  • Extract the zip archive with "RAR" to "Android/data/org.artsoft.rocksndiamonds/files/levels".
  • Restart R'n'D and select the newly installed level set!
Please let me know if this second, much easier process works for you! I will then add this to the instructions on my "Download" web page.

UPDATE 2:

There's something important that I forgot about: I've tested the "easier" way on an old Android version 4.4, which may be less strict regarding apps being allowed to write to other apps' data ("files") directories. It may well be possible that this does not work anymore with more recent Android versions.

So please, everybody with Android devices, let me know if the "easier" procedure works for you or not, and which Android version you have tested! (I will have access to an Android 6.0 device in a few weeks, and I will try how it works there.)

MichaelCPalmer1980
Posts: 8
Joined: Thu Nov 02, 2017 10:11 am

Re: Custom folder for Android?

Post by MichaelCPalmer1980 » Tue Jan 23, 2018 10:44 am

I would like to start by thanking you for your quick response and apologize for asking a question that has already been addressed on this forum. I did search for an answer but apparently not well enough.

Perhaps I should have mentioned that I am using an RCA Viking Pro 10.1 Android laptop running Andoid 6.0. It is not rooted. My prefered file manager is the free and opensource Total Commander, which can handle most compressed files with the exception of 7zip. Now that you have pointed me toward the correct folder everything is fine. The first thing I tried was Snakebite and I was much impressed by the inclusion of so much more than level data. I never realized that R&D was so extensible that a nibbles style growing snake and a new interface could be added. Oh, and it's nice to finally hear some music!

For some reason I never looked in the "android" folder, and anyway I probably wouldn't have scrolled all the way down to org.artsoft since I didn't know that the prefix even existed(everything else is under com.) Most apps that store external files that users are expected to access are stored in their own folder, such as SDCARD/RocksNDiamonds/ instead of SDCARD/Android/org.artsoft.rocksndiamonds. Even a power user such as myself(experienced in DOS, windows, Linux, BASIC, C/C++, and all sorts of design software) overlooked the possibilty. Among Android's long list of shortcomings is its inabilty to search for files in the traditional ways(I can find music or pictures easily, but I never found an app that will search arbitrary files for pattern or RegEx matches.

After reading the discussion from June about custom levels I learned some important facts. I can't blame you for you lack of understanding about the stupid way that Android handles files, but am very happy that some sensible people developed free tools that let you port your great game to Android without knowing about the stupid way that Android handles files.

Most games require that storage permission is granted by their users, including games that that are only expandable by in app puchases and don't need storage permissions to do it. My own games require storage permissions because the RFO Basic! compiler doesn't support saving to Internal storage, which I would prefer, since some users might not wish to grant storage permission to an APK they didn't even download from the app store.

The idea of having private internal storage that can't be altered by other apps is good(as long as you're not tech trying to backup the device). Even the idea of barring users from root access is smart on many levels. Where google screwed up was limiting file permissions to either granting or denying an app storage access. I can't, for example, grant R&D read access to load files from an SDCard without also giving it permission to delete my entire music folder.

I would like to offer some suggestions about how I think R&D should handle file access. Note that I'm doing so without any clue how the Android port handles file IO. You said in that other post that the Android NDK compiled your c source without muddling with Java, yet as I recall SDL offered no IO functionality when I used back in '05.

1: Store all of the R&D data in INTERNAL storage and don't require storage access upon installation
2: Add an options in the settings menu to 'enable custom level data'
3: request storage permissions when the option is enabled
4: popup a message like "copy your level data to the /RocksNDiamonds/ folder on your SDCard"
5: load custom level data from "storage/RocksNDiamonds" instead of /storage/Android/Data/org.artsoft.rockswhateverIforgot/

I think that this would be the best way to do it, but at the very least you should provide some hint in the menu about where to save level data, and where to find it online. After that maybe you'll address the onscreen controlpad issue that I mentioned earlier. That's actually more important, I think, since the latest version of R&D has made it simple enough to add maps once the correct folder is found.

As for exact instructions for your FAQ, I cannot necessarily recommend either your original or your 'simpler' method. I do have RAR and your instructions do work, but Total Commander and other file managers with zip capabilities work just as well. Perhaps android 4.4 is different(I only ever used 6.0), or perhaps you're over-thinking it. I do not believe that the files in /Android/org.artsoft.rocksndiamonds/ are private to rocksndiamonds. By my understanding, private data is "Internal" and cannot be seen by other apps. I think that /Android/org.artsoft.rocksndiamonds/ is simply the default folder used by whatever library functions you're calling to access files. Anyway, all of my filemanagers can access the files just fine, and any archiving app should do the job as well.

Best regards,
Michael

PS: I did mean it when I said Rocks N Diamonds is potentially the best game available for Android. A few little fixes will make it so.

Post Reply