Skip to content

How do I set UserDefault values from Android (perhaps from iOS too) #1495

Closed Answered by rh101
murasu asked this question in Q&A
Discussion options

You must be logged in to vote

That isn't supported with the current implementation of UserDefault in Axmol, since it is no longer using the Android SharedPreferences implementation.

You have several options (all very simple to do), such as:

1 - Implement your own UserDefault which would call the AxmolEngine functions for SharedPreferences, then call UserDefault::setDelegate(UserDefault* delegate) to set your own implementation. You would add this custom UserDefault code to your own project.

2 - Add Java code to your application that can call native code in your app, and that in turn will call the current Axmol UserDefault implementation instead, so no need to use Android SharedPreferences etc..

For iOS, it's the same …

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@murasu
Comment options

@murasu
Comment options

Answer selected by murasu
Comment options

You must be logged in to vote
3 replies
@murasu
Comment options

@antn9x
Comment options

@murasu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants