C# Shell changes in version >= 2.5
Version 2.5 is a huge update, especially under the hood. This took a lot longer than I expected due to various reasons... It isn't even a fully polished version yet. For example due to the multiple changes there is only English in the app for now. But that is the most major issue I can think of. This is a detailing on every major change and what kind of effect it haves.
The app is now built with the Android 12 SDK so scoped storage Android API problems had to be dealt with. For Android >= 11 there is no longer regular file access to the internal storage. The app's local data directory is used to prevent a considerable performance drop in the app itself. User code is effected in the same way. You woudn't be able to use the C# file APIs outside the directory. For a beginner, well that would be confusing - having to use a specialized/limited platform API instead of System.IO. For now the only way to transfer files in and out of the local data directory is via cloud storage. I should be able to add the same functionality for an SD card fairly soon. So don't update yet if you need that.
Here is a list of the primary changes.
-
Projects are now ".csproj" files. This is done via an XML DOM editor so the app should be able to read and edit any ".csproj" file. Any old project should automatically be converted to ".csproj" and work. However due to compatibility issues project settings aren't converted.
-
Performance improvements in the compilation logic. The app should also use a bit less RAM. The Microsoft.CodeAnalysis packages have been updated to version 4.1, which brings C# 10 support.
-
Microsoft now stores assemblies as a blob - a single file containing multiple compressed assemblies. That in now just done when assemblies need to be initially decompressed or updated and then stored in the app data directory. Not counting the temporary extraction of the blob the extracted assemblies will take up an additional 200 MB of space. The framework assemblies needed to compile and run a user program are about 60% to 90% of that size depending on what is used. Part of that is because different versions of assemblies can't be loaded into the app if they are already bundled with it. Yes, all that means the app size has effectively doubled to 400 MB. RAM requirments would have been too high for (even with temporary blob file) in-memory decompression.
-
Support for cloud storage. For now just pCloud. I've added a dual pane local/cloud file manager. The access token for the cloud storage is stored locally as an encrypted string. The encryption key is unique to each device.
-
APK exporting is now supported on Android 12. Exported apps also have the same limits for storage.
APK exporting still works with a pre compiled ".apk" file - a template. DLLs and assets are added to that to produce the final result. The templates now contain an assembly blob, while before assemblies were quickly copied from C# Shell. The result is nearly an additional 35 MB increase in the size of C# Shell. There are 2 templates - for console and for Xamarin.Forms. The console template results in an app that is about 8 MB smaller, the former cost of which was about 15MB in C# Shell size. Now it is about 35 MB. I could remove the console template and use the Xamarin.Forms one for console programs, which would make them about 8 MB larger. However that would also reduce the size of C# Shell by about 35 MB. Which do you prefer? Here is a link to an anonymous poll if you want to answer: https://xoyondo.com/ap/beR9KZBImXj7uVr
More good news... Starting from July 2022 Google will in a nutshell no longer allow non file manager apps the PROMPT_PACKAGE_INSTALL permission. Which is technically good. However C# Shell won't be able to prompt for install of APKs. Sharing the APK and launching a file manager should be a viable workaround. Well, a file manager that supports installing APKs, like X-Plore.
Love your app bro ❤️❤️❤️
Please give full support for xamarin, especially for xamarin android, i want to use material design library for my project 🙏
I use Solid Explorer to move files in and out of your apps directory. You have to pay for it but it somehow gives complete access to every file and folder on your Android without having to root it. Besides your app it is one of the best purchases I have ever made. lol
X-plore File Manager will work too. Allows creating a launcher shortcut too. Most file managers should work for apps that store data like this. In Android >= 11 the app files is stored in external directory. It is in the internal storage. /storage/emulated/0/Android/data/com.radinc.csharpshell/files