Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Support? #287

Open
KurtGokhan opened this issue Aug 27, 2021 · 6 comments
Open

Android Support? #287

KurtGokhan opened this issue Aug 27, 2021 · 6 comments

Comments

@KurtGokhan
Copy link
Contributor

Is there a plan to support Android Mono? Is it possible and feasible?

I see this was discussed in #57 but ClearScript does not use mixed assemblies anymore so I wanted to ask again.

@ClearScriptLib
Copy link
Collaborator

Hi @KurtGokhan,

We have no mobile plans for ClearScript at the moment. As you probably know, ClearScript is a side project, and supporting the three major desktop platforms – including the eight platform-specific V8 packages – is already stretching the limits of the resources available.

As for whether it's feasible, we're not aware of any reason why not. ClearScript's managed assemblies already target .NET Standard 2.1, which is supported by Mono and Xamarin. All that remains is the native ClearScriptV8 library, which should be relatively easy to build in an Android NDK environment.

Thanks!

@KurtGokhan
Copy link
Contributor Author

Thank you. I will check if it is something I can do.

@nextfool
Copy link

Hi @ClearScriptLib So I have checked the source code
1634177790(1)

And found out this. So now questions are:
1.Is there any perticular reason/dificulties to implement android(as well as ios) support?
2. if I want to folk my own source to make this happen, can you give me any advise, and do you think its doable?
3. do you have any plan in the future to support android(and any other OS)?

Sorry for so many questoins, but I thinks it will be a really cool project if it can support mobile OSes.

Thank you.

@nextfool
Copy link

Thank you. I will check if it is something I can do.

Hi, do you make any progress regarding android supporting? Can you share any of your thought? Thank you.

@KurtGokhan
Copy link
Contributor Author

@nextfool I succeeded in making ClearScript run on Android. See #290

But there are some caveats.

  • It is for 7.1.5.
  • If you want to use it, you will need to build it from source.
  • I had removed Intl to cut down the binary size and simplify some stuff, but can be enabled with some effort.
  • Since there is no way to know if a platform is Android in .NET, I had to improvise a bit.
  • The code is written with my opinion and not reviewed by ClearScript team.

Ultimately, that PR is something I prepared for myself so it may not be perfectly suitable for you.

@cyraid
Copy link

cyraid commented Mar 20, 2023

Wouldn't you be able to use System.OperatingSystem.IsAndroidVersionAtLeast(33) and System.OperatingSystem.IsAndroid for example? You could use that with say, [SupportedOSPlatform("Android33.0")] and such decorated methods if you want. Tested and works in net7.0-android for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants