How to check JRE version prior to launch?

You could do this using reflection and two compilers. Compile a main class with the oldest java version you want to be able to run at all with. It checks the version using System.getProperty(“java.version”), or whatever, and then uses reflection to load your real main class if that check passes, possibly even loading the jar … Read more

How to open external programs in Python

The short answer is that os.system doesn’t know where to find firefox.exe. A possible solution would be to use the full path. And it is recommended to use the subprocess module: import subprocess subprocess.call([‘C:\Program Files\Mozilla Firefox\\firefox.exe’]) Mind the \\ before the firefox.exe! If you’d use \f, Python would interpret this as a formfeed: >>> print(‘C:\Program … Read more

How to detect Apps first launch in iOS?

Swift 4 and higher You can use this anywhere to verify that the user is seeing this view for the first time. func isAppAlreadyLaunchedOnce() -> Bool { let defaults = UserDefaults.standard if let _ = defaults.string(forKey: “isAppAlreadyLaunchedOnce”) { print(“App already launched”) return true } else { defaults.set(true, forKey: “isAppAlreadyLaunchedOnce”) print(“App launched first time”) return false … Read more

Android: Launch activity from clickable text

Try this, final Context context = … // whereever your context is CharSequence sequence = Html.fromSource(context.getString(R.string.clickable_string)); SpannableStringBuilder strBuilder = new SpannableStringBuilder(sequence); UnderlineSpan[] underlines = strBuilder.getSpans(UnderlineSpan.class); for(UnderlineSpan span : underlines) { int start = strBuilder.getSpanStart(span); int end = strBuilder.getSpanEnd(span); int flags = strBuilder.getSpanFlags(span); ClickableSpan myActivityLauncher = new ClickableSpan() { public void onClick(View view) { context.startActivity(getIntentForActivityToStart()); } … Read more