Post Reply 
Plus42 Equations, Preview Release
05-18-2022, 09:49 AM
Post: #681
RE: Plus42 Equations, Preview Release
(05-18-2022 02:04 AM)rprosperi Wrote:  OFF does not exit the app on Android, at least not on my Pixel 6 Pro. I prefer it that way, but it's not a big deal, however since Free42 does one thing and Plus42 another thing, and Plus42 is new, I assumed that was the one with the bug.

OFF does exit the app in both Free42 and Plus42 on my Moto G5 (Android 8.1.0)...
Visit this user's website Find all posts by this user
Quote this message in a reply
05-18-2022, 11:08 AM
Post: #682
RE: Plus42 Equations, Preview Release
Both apps call Activity.finish() in response to shell_powerdown(), which in turn is called by Shift-EXIT and by the OFF function. I don't know how that could fail to end the application. Bob, is this reproducible?
Visit this user's website Find all posts by this user
Quote this message in a reply
05-18-2022, 03:04 PM
Post: #683
RE: Plus42 Equations, Preview Release
(05-18-2022 08:22 AM)Thomas Okken Wrote:  I could make it a configurable option on Android as well as iOS, of course. And at least I should look into why it isn't working in Plus42 on Android, that's weird because why would that be different?

Then again, the accidental OFF auto-enable in Plus42 on iOS turns out to be a bug that it inherited from Free42, but which doesn't cause this behavior in Free42 while it does in Plus42. Weird.

Regarding the iOS prohibition on apps exiting on their own: I do get it, because that kind of behavior looks exactly the same as a crash, and apps have a particular lifecycle that the OS should be in control of. It's pretty much the same as on Android, actually. That they go so far as to reject apps that don't conform to their UI standard... well, Apple have been pretty specific about uniform, predictable user interfaces, going back to MacOS 1.0. Having given themselves veto power in the App Store, I'm not surprised they use it to enforce those standards. And I never use OFF to exit on my phone, even though I use it all the time in the desktop versions... it just doesn't fit it the flow on mobile, I guess.

I'm 100% in favour of Apple's militant stance regarding 'UI/UX/ interaction design' consistency. Equally, it's one of the things that annoys me most on Android. Google may have guidelines on such matters but much slips through that's an utter UX/UI horror show.

Much as I'm most at home in the anything-goes environs of Linux, I do appreciate macOS for what it is (and seeing as it's very UNIX-like beneath its fetching exterior, you're often getting the best of both worlds).
Find all posts by this user
Quote this message in a reply
05-18-2022, 07:11 PM (This post was last modified: 05-18-2022 07:26 PM by ijabbott.)
Post: #684
RE: Plus42 Equations, Preview Release
(05-18-2022 09:49 AM)Thomas Okken Wrote:  
(05-18-2022 02:04 AM)rprosperi Wrote:  OFF does not exit the app on Android, at least not on my Pixel 6 Pro. I prefer it that way, but it's not a big deal, however since Free42 does one thing and Plus42 another thing, and Plus42 is new, I assumed that was the one with the bug.

OFF does exit the app in both Free42 and Plus42 on my Moto G5 (Android 8.1.0)...

On my Moto g(30) (Android 12), 'OFF' hides Free42 or Plus42 into the background but doesn't exit the app completely.

Bringing the app back out of the background behaves like 'ON'.

The 'OFF' function also turns off the 'Continuous ON' setting in Free42 or Plus42. (Guessing an = instead of == bug in the C++ code?)

— Ian Abbott
Find all posts by this user
Quote this message in a reply
05-18-2022, 07:50 PM
Post: #685
RE: Plus42 Equations, Preview Release
(05-18-2022 07:11 PM)ijabbott Wrote:  The 'OFF' function also turns off the 'Continuous ON' setting in Free42 or Plus42. (Guessing an = instead of == bug in the C++ code?)

That's intentional. I feel there should be a way to turn off Continuous ON mode from the calculator, without having to go to the Preferences dialog, and since turning the calculator off turns off Continuous ON mode on the real calculator, this seemed like a logical and convenient way to do it.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-18-2022, 11:02 PM
Post: #686
RE: Plus42 Equations, Preview Release
(05-09-2022 08:40 AM)Thomas Okken Wrote:  The integrator doesn't solve the equation, it just evaluates it, and evaluating an equation with a top-level = sign means evaluating its left- and right-hand sides and subtracting the latter from the former. So if you're integrating Y=X^2 with integration variable Y, you're integrating Y-X^2, where X will be whatever value it happens to be when you start the integration.

Out of curiosity, what happens under the hood differently when integrating the same equation after plotting it? I get the ‘rights answer when I do that.

An easy workaround for this has been to set the LHS to zero and reverse LLIM and ULIM.
Find all posts by this user
Quote this message in a reply
05-19-2022, 06:45 AM
Post: #687
RE: Plus42 Equations, Preview Release
(05-18-2022 11:02 PM)tgray Wrote:  Out of curiosity, what happens under the hood differently when integrating the same equation after plotting it? I get the ‘rights answer when I do that.

When you integrate from the plot viewer, with Y not set to <STK>, the integrator calls SOLVE for every sample point.

You can do that without PLOT as well, but then you'll have to write a small program that calls SOLVE, and then INTEG that program. In other words, the combination of INTEG and SOLVE is a feature of PLOT; INTEG by itself does not support that, at least not directly, not without a little help.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-19-2022, 10:25 AM
Post: #688
RE: Plus42 Equations, Preview Release
Maybe a constants library would be useful in Plus42?
It would complement equations and units very nicely.

Possibly with user added constants, defined in combinations of symbols and numbers.
Like if Planck's constant is h, the reduced Planck constant definition could be stored as h/(2*π), evaluation only happening when absolutely necessary.
Find all posts by this user
Quote this message in a reply
05-19-2022, 01:04 PM
Post: #689
RE: Plus42 Equations, Preview Release
(05-18-2022 11:08 AM)Thomas Okken Wrote:  Both apps call Activity.finish() in response to shell_powerdown(), which in turn is called by Shift-EXIT and by the OFF function. I don't know how that could fail to end the application. Bob, is this reproducible?

Very consistently different behavior between the two apps, but different than my initial report, now that I check more thoroughly:

Free42 v3.0.11 - [shift] [off] has no apparent effect, the app remains active/foreground. OTOH, if I [XEQ] "OFF", the app appears to close but is actually still running (is this called minimized on iOS and Android?)

Plus42 v1.0.4 - [shift] [off] appears to exit the app, though it is actually still running, like above. [XEQ] "OFF" does the same.

Pixel 6 Pro, Android 12

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
05-19-2022, 01:41 PM
Post: #690
RE: Plus42 Equations, Preview Release
(05-19-2022 01:04 PM)rprosperi Wrote:  Free42 v3.0.11 - [shift] [off] has no apparent effect, the app remains active/foreground. OTOH, if I [XEQ] "OFF", the app appears to close but is actually still running (is this called minimized on iOS and Android?)

Plus42 v1.0.4 - [shift] [off] appears to exit the app, though it is actually still running, like above. [XEQ] "OFF" does the same.

That is weird! I have no explanation for that.

Free42 and Plus42 perform the same actions in all of those scenarios: they turn off Continuous ON mode, by calling getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON), and then they end the activity, by calling finish().

Maybe calling finish() from an event handler is frowned upon, but why it would give different results in Free42 vs. Plus42, I have no clue...
Visit this user's website Find all posts by this user
Quote this message in a reply
05-19-2022, 04:02 PM
Post: #691
RE: Plus42 Equations, Preview Release
(05-19-2022 01:04 PM)rprosperi Wrote:  Free42 v3.0.11 - [shift] [off] has no apparent effect, the app remains active/foreground. OTOH, if I [XEQ] "OFF", the app appears to close but is actually still running (is this called minimized on iOS and Android?)

Plus42 v1.0.4 - [shift] [off] appears to exit the app, though it is actually still running, like above. [XEQ] "OFF" does the same.

Pixel 6 Pro, Android 12

Odd. On my phone both Free42 (3.0.11) and Plus42 (1.0.4) close when I press that. Samsung A50, Android 11. Maybe an Android 12 thing?
Find all posts by this user
Quote this message in a reply
05-19-2022, 04:05 PM (This post was last modified: 05-19-2022 05:00 PM by johanw.)
Post: #692
RE: Plus42 Equations, Preview Release
(05-19-2022 01:41 PM)Thomas Okken Wrote:  Maybe calling finish() from an event handler is frowned upon, but why it would give different results in Free42 vs. Plus42, I have no clue...

How about this class (it is Java but the php tag was the only way I see how to format it a bit nicely):

PHP Code:
package org.thoughtcrime.securesms;

import android.content.Intent;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;

public class 
ExitActivity extends Activity {

  @
Override
  
protected void onCreate(Bundle savedInstanceState) {
    
super.onCreate(savedInstanceState);

    if (
Build.VERSION.SDK_INT >= 21) {
      
finishAndRemoveTask();
    } else {
      
finish();
    }

    
System.exit(0);
  }

  public static 
void exitAndRemoveFromRecentApps(Activity activity) {
    
Intent intent = new Intent(activityExitActivity.class);

    
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
            
Intent.FLAG_ACTIVITY_CLEAR_TASK
            
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
            
Intent.FLAG_ACTIVITY_NO_ANIMATION);

    
activity.startActivity(intent);
  }


You include the class and call ExitActivity.exitAndRemoveFromRecentApps(getActivity()); from your activity and include it in your manifest.
Find all posts by this user
Quote this message in a reply
05-19-2022, 04:57 PM
Post: #693
RE: Plus42 Equations, Preview Release
I like the idea of calling finishAndRemoveTask() instead of finish() if API level 21 (Android 5) or later is detected, but will that fix the issue reported by Bob? The older finish() call is not deprecated, so it should still work, even in Android 12...
Visit this user's website Find all posts by this user
Quote this message in a reply
05-19-2022, 05:40 PM
Post: #694
RE: Plus42 Equations, Preview Release
(05-19-2022 04:57 PM)Thomas Okken Wrote:  I like the idea of calling finishAndRemoveTask() instead of finish() if API level 21 (Android 5) or later is detected, but will that fix the issue reported by Bob? The older finish() call is not deprecated, so it should still work, even in Android 12...

I have no idea to be honest. What the formal API description says and what the vendor implements may differ, and especially some Chinese manufacturers are known to mess things up. The fastest way to find that out is to make a test build and let Bob try it out.
Find all posts by this user
Quote this message in a reply
05-19-2022, 07:01 PM
Post: #695
RE: Plus42 Equations, Preview Release
(05-19-2022 05:40 PM)johanw Wrote:  What the formal API description says and what the vendor implements may differ

Certainly, but the difference in behavior between Free42 and Plus42 on the same device is puzzling, since they both have exactly the same logic for OFF...
Visit this user's website Find all posts by this user
Quote this message in a reply
05-19-2022, 07:15 PM
Post: #696
RE: Plus42 Equations, Preview Release
(05-19-2022 01:04 PM)rprosperi Wrote:  Free42 v3.0.11 - [shift] [off] has no apparent effect, the app remains active/foreground. OTOH, if I [XEQ] "OFF", the app appears to close but is actually still running (is this called minimized on iOS and Android?)

Plus42 v1.0.4 - [shift] [off] appears to exit the app, though it is actually still running, like above. [XEQ] "OFF" does the same.

Pixel 6 Pro, Android 12

Very odd! I have the same versions of Free42 and Plus42 running on the same phone (Pixel 6 Pro) and same Android version (12). Both apps close with [shift][off] for me.

-Brian

"Don't believe everything you read on the internet." -Benjamin Franklin
Find all posts by this user
Quote this message in a reply
05-19-2022, 07:33 PM
Post: #697
RE: Plus42 Equations, Preview Release
(05-19-2022 07:01 PM)Thomas Okken Wrote:  
(05-19-2022 05:40 PM)johanw Wrote:  What the formal API description says and what the vendor implements may differ

Certainly, but the difference in behavior between Free42 and Plus42 on the same device is puzzling, since they both have exactly the same logic for OFF...

In that case I suspect a broken state file or something similar. Does this behaviour continue after a removal of all data?
Find all posts by this user
Quote this message in a reply
05-19-2022, 07:45 PM
Post: #698
RE: Plus42 Equations, Preview Release
It doesn't look like an Android 12 issue, or at least Shift-EXIT works for me in both Free42 and Plus42 in the Android 12 emulator.
Visit this user's website Find all posts by this user
Quote this message in a reply
05-20-2022, 12:28 PM
Post: #699
RE: Plus42 Equations, Preview Release
I've verified mine behave as reported about 5 more times, you know, just to be really, really sure, and indeed the difference persists. Not that I'm complaining, I only reported it because the topic was being discussed and I noticed the difference.

A possible, but unlikely IMHO, cause is that Free42 was migrated to this phone when I bought it in October, whereas Plus42 was purchased and installed from the App store when 1.0 formally launched (I never ran a pre-1.0 copy).

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
05-20-2022, 01:01 PM
Post: #700
RE: Plus42 Equations, Preview Release
(05-20-2022 12:28 PM)rprosperi Wrote:  A possible, but unlikely IMHO, cause is that Free42 was migrated to this phone when I bought it in October, whereas Plus42 was purchased and installed from the App store when 1.0 formally launched (I never ran a pre-1.0 copy).

It's as plausible a hypothesis as any I can come up with... because I can't come up with anything at all!

Maybe there's something in the system log? I wouldn't know where else to look, at least not without being able to connect the phone to my laptop...
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 12 Guest(s)