Is there an effective tool to convert C# code to Java code? [duplicate]

I have never encountered a C#->Java conversion tool. The syntax would be easy enough, but the frameworks are dramatically different. Even if there were a tool, I would strongly advise against it. I have worked on several “migration” projects, and can’t say emphatically enough that while conversion seems like a good choice, conversion projects always … Read more

Android equivalent of NSUserDefaults in iOS

This is the most simple solution I’ve found: //–Init int myvar = 12; //–SAVE Data SharedPreferences preferences = context.getSharedPreferences(“MyPreferences”, Context.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); editor.putInt(“var1”, myvar); editor.commit(); //–READ data myvar = preferences.getInt(“var1”, 0); Where ‘context’ is the current context (e.g. in an activity subclass could be this).