SharedPreferences

Hi guys,
I’d like to use Sharedpreferences for my copper project but I can’t understand how to save keys etc… I’m a swift user with no knowledge of Java trying to understand how to port a simple app in Android but I don’t understand how to use sharedpreferences here…
Thanks

I’m not very familiar with this API, but from looking at the docs, you should list be able to use it as is, e.g.

public class MainActivity: Activity {

	public override func onCreate(_ savedInstanceState: Bundle!) {
		super.onCreate(savedInstanceState)
		ContentView = R.layout.main
		
		if let pref = getSharedPreferences("foo", MODE_PRIVATE) {
			if pref.contains("bar") {
				let s = pref.getString("bar")
				// works with s
			}
		}
	}
}