Auto-rotation skins on Free42 v3.0.7 - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: Not HP Calculators (/forum-7.html) +--- Forum: Not quite HP Calculators - but related (/forum-8.html) +--- Thread: Auto-rotation skins on Free42 v3.0.7 (/thread-17684.html) Pages: 1 2 |
Auto-rotation skins on Free42 v3.0.7 - rprosperi - 11-07-2021 11:43 PM Has something changed related to skin display, auto-rotation, display in Horizontal mode, etc. in the v3.0.7 release of Free42? I just got a new phone and only yesterday afternoon got Free42 installed and working right in both V and H modes. Then 3.0.7 came out and now it's not working right (or at least the same). Now, in H mode, the same skin is used, but squashed down. Maybe it's something here, but I have all 4 needed files (2 x .gif and 2 x .layout) in the /Free42 folder as normal, and it was working. Strange... RE: Auto-rotation skins on Free42 v3.0.7 - Thomas Okken - 11-08-2021 12:10 AM That sounds like the issue that I fixed in 2.5.24a, back in January: the app not switching between portrait and landscape skins on Android 11. With 3.0.7, I had to change the target sdk version from 29 to 30, i.e. Android 10 to 11. Maybe that change defeated the 2.5.24a fix. The whole thing was a bit mysterious to me to begin with. My own phone, running Android 8.1, doesn't have the rotation problem, so it's of no use for spotting or troubleshooting the issue; I'll see if I can reproduce it in the Android 11 emulator tomorrow. RE: Auto-rotation skins on Free42 v3.0.7 - rprosperi - 11-08-2021 02:42 AM (11-08-2021 12:10 AM)Thomas Okken Wrote: That sounds like the issue that I fixed in 2.5.24a, back in January: the app not switching between portrait and landscape skins on Android 11. Thanks for the feedback Thomas. My new phone is actually Android 12 (a Pixel 6 Pro) but as I noted, 3.0.6 was working yesterday on the same phone. It appears to be something that changed in 3.0.7, but I can't 100% rule out that something in the phone (or Android 12) might be the cause. While I haven't made any Phone config. changes that should affect this deliberately, it's not impossible I've changed something by mistake; there's a lot of new and different things in A v12. RE: Auto-rotation skins on Free42 v3.0.7 - Thomas Okken - 11-08-2021 07:48 AM That's good to know; I'll test this in the Android 12 emulator as well, then. I could also send you an apk with the target sdk set to 29, which you could side-load, to check whether or not that fixes the issue. I do suspect the target sdk setting is the culprit, though, for a couple of reasons: one, the behavior you describe is eerily similar to what prompted the 2.5.24a release; two, changing the skin by accident is not easy to do; three, there haven't been any code changes in the UI part for 3.0.7 except for that target sdk change; and four, Android uses the target sdk setting on an apk to selectively enable compatibility behaviors, and when developers are forced to change that setting, as Google just did effective November 1st, this sometimes causes unexpected breakage. This kind of thing has actually happened to Free42 before, when another forced target sdk change made the main menu stop working. RE: Auto-rotation skins on Free42 v3.0.7 - johanw - 11-08-2021 09:24 AM Strange. This has has never worked for me, but when I tested it with Free42 3.0.7 on Android 11 it worked. What I did: set autorotate on, set Free42 orientation to auto. Select a protrait skin in portrait mode, select a landscape skin in landscape mode (in this case the type_nova_P/L_v2 from Thomas' site). Result: autorotate switched bewteen the corect skins. When I did not first select the landscape skin it showed the portrait skin, but distorted. RE: Auto-rotation skins on Free42 v3.0.7 - Thomas Okken - 11-08-2021 10:31 AM I haven't been able to reproduce the problem in the Android 11 and 12 emulators (API levels 30 and 31). Hmm... I uploaded a 3.0.7 build with target sdk = 29 to https://thomasokken.com/free42/download/test/Free42Android-29.apk -- Bob (or anyone else experiencing the screen rotation issue), could you try installing this, and let me know what happens? RE: Auto-rotation skins on Free42 v3.0.7 - rprosperi - 11-08-2021 02:20 PM (11-08-2021 10:31 AM)Thomas Okken Wrote: I haven't been able to reproduce the problem in the Android 11 and 12 emulators (API levels 30 and 31). Hmm... Quick update - I compared my new phone (A12) with my old phone (A8) side-by-side and I now notice that when in the "Skin: Other" dialog, the *.layout files are not visible (in the file display area where one would pick a file), even though I've confirmed that these files are actually in the /Free42 folder. I then copied the *.layout files to the /Downloads folder and then navigate there in the "Skin: Other" dialog and these files are also not visible there, where they should be as this folder is obviously available to the user. I have confirmed that Free42 is sensing the rotation and "knows" which mode it's in when opening the dialog. So, it must have something to do with folder access, or permissions, etc. Maybe this helps? I'd rather not side-load if it can be avoided, due to a troubled past doing so in very early Android days... RE: Auto-rotation skins on Free42 v3.0.7 - SammysHP - 11-08-2021 02:50 PM The way the filesystem can be accessed has changed dramatically with API 30. Look for "Storage Access Framework" (SAF). RE: Auto-rotation skins on Free42 v3.0.7 - Thomas Okken - 11-08-2021 04:30 PM Ah, right... the trouble with storage access started with Android 11, but there was a transitional option you could use in the app manifest, requestLegacyExternalStorage=true. But that only works for apps targeting api level 29 or less, so now that I'm forced to target 30 or higher, the work-around no longer works, and this issue needs to be dealt with. I assume it is still possible to store skins under /data/data/<package_name>/files, since that's where the state files are as well? RE: Auto-rotation skins on Free42 v3.0.7 - rprosperi - 11-08-2021 05:37 PM (11-08-2021 04:30 PM)Thomas Okken Wrote: Ah, right... the trouble with storage access started with Android 11, but there was a transitional option you could use in the app manifest, requestLegacyExternalStorage=true. But that only works for apps targeting api level 29 or less, so now that I'm forced to target 30 or higher, the work-around no longer works, and this issue needs to be dealt with. There is no 2nd data under /Android/data, unless it's hidden. I do see /Android/data/com.thomasokken.free42/files but that folder is empty. The files I can access appear to be in /Free42, which looks like a top-level folder under the root, but I'm confident that's just some 'user' view of things. RE: Auto-rotation skins on Free42 v3.0.7 - Thomas Okken - 11-08-2021 06:58 PM There are two commonly used directories that Android apps should have access to even without being granted any special permissions: /data/data/<package_name>, which is in the main filesystem, and /sdcard/Android/data/<package_name>, in external storage. The former, or rather, /data/data/<package_name>/files, is where Free42 stores its state files, so if that /Free42 directory you can see in the file manager contains files named "state" and "print", and the *.f42 state files, it's the right one. I should probably add a note to the documentation that that's the right place to store skins. I don't see any strong reason to jump through hoops to allow Free42 to access other corners of the filesystem, as long as users are able to store skins in the standard data directories without a lot of trouble. As long as it's documented! All this is a bit annoying for people who still remember when Android apps basically had the run of the entire filesystem. BTW, the built-in skin loader will load skins to /data/data/<package_name>/files, so as long as you're trying to use skins that are available for download from an HTTP server somewhere, that method of putting skins in the right place should always work. RE: Auto-rotation skins on Free42 v3.0.7 - johanw - 11-08-2021 07:04 PM (11-08-2021 04:30 PM)Thomas Okken Wrote: I assume it is still possible to store skins under /data/data/<package_name>/files, since that's where the state files are as well?It should be. However, what is often far worse, SAF prevents you from working with absolute file paths and most of the File API. There is a way around that on Android 11+ (not 10), using the MANAGE_EXTERNAL_STORAGE permission, but apps using this who do not strictly need it (like file managers) are refused in Google Play. It does work well however: I use it myself in an app that I don't intend to publish there anyway. RE: Auto-rotation skins on Free42 v3.0.7 - johanw - 11-08-2021 07:07 PM (11-08-2021 05:37 PM)rprosperi Wrote: There is no 2nd data under /Android/data, unless it's hidden. I do see /Android/data/com.thomasokken.free42/files but that folder is empty.You obviously have not rooted your device. There can, in fact, be 3 such directories: [root]/data/data/[package name] [internal storage]Android/data/[package name] [removable storage]/Android/data/[package name] On a non-rooted device with Android 11 you won't be able to access the first 2. On Android 10 and below you are only blocked from accessing the first. RE: Auto-rotation skins on Free42 v3.0.7 - Thomas Okken - 11-08-2021 09:56 PM (11-08-2021 07:07 PM)johanw Wrote: [root]/data/data/[package name] Yes, and the first directory is the one where the skin loader puts the files it downloads (to open the skin loader: Main Menu -> Select Skin -> Load...), and the third is the one that the file selection dialogs in Free42 go to when you press the Home button (next to the directory drop-down menu). RE: Auto-rotation skins on Free42 v3.0.7 - rprosperi - 11-09-2021 12:00 AM Ok, got it working by using the built-in Main Menu -> Select Skin -> Load... process. I can't see the 'right' folder via File Manager (it's not rooted), so can't confirm where it is in A12, but the right files are now there and 3.0.7 is working properly, auto-rotating skins as needed. I'm honestly confused as to why 3.0.6 worked before if nothing in this area changed, but the discussion and prod to "use it the way it's supposed to be used" advice has solved the problem. Thanks to Thomas, johanw and SammysHP! RE: Auto-rotation skins on Free42 v3.0.7 - Thomas Okken - 11-09-2021 12:25 AM (11-09-2021 12:00 AM)rprosperi Wrote: I'm honestly confused as to why 3.0.6 worked before if nothing in this area changed The target sdk change from 29 to 30 must have stopped the requestLegacyExternalStorage=true parameter in the app manifest from working. That's documented behavior, but I had forgotten about that and didn't realize that side effect would happen. It does make sense that you'd see Free42 load the standard skin if your custom skin suddenly became inaccessible to the app. (Although it is a bug that it loads the built-in portrait skin when loading the skin fails while in landscape mode!) Apparently, this doesn't have anything to do with the 2.5.24a fix, even though I implemented that because of a problem with the exact same symptoms. Now that I think about it, the issue that time may have been a Samsung quirk of some sort. RE: Auto-rotation skins on Free42 v3.0.7 - rprosperi - 11-09-2021 02:41 AM (11-09-2021 12:25 AM)Thomas Okken Wrote:(11-09-2021 12:00 AM)rprosperi Wrote: I'm honestly confused as to why 3.0.6 worked before if nothing in this area changed Thanks again. I wish I had noticed and reported earlier that 3.0.7 was loading the default skin (and not the custom one that worked the day before) as that may have been an earlier clue as to what was happening. Also, discussion of the various folders led me to wonder where .raw files (and others) are exported to by default, since the prior folder you mentioned isn't accessible. When you Export, it now defaults to /storage/emulated/0/Android/data/com.thomasokken.free42/files, which apparently is the new "Home". Thanks RE: Auto-rotation skins on Free42 v3.0.7 - SammysHP - 11-09-2021 05:36 AM (11-09-2021 02:41 AM)rprosperi Wrote: Also, discussion of the various folders led me to wonder where .raw files (and others) are exported to by default, since the prior folder you mentioned isn't accessible. When you Export, it now defaults to Please note that this directory is deleted automatically when you uninstall the app! It can't be used for backups. RE: Auto-rotation skins on Free42 v3.0.7 - ijabbott - 11-09-2021 08:44 AM (11-09-2021 05:36 AM)SammysHP Wrote:(11-09-2021 02:41 AM)rprosperi Wrote: Also, discussion of the various folders led me to wonder where .raw files (and others) are exported to by default, since the prior folder you mentioned isn't accessible. When you Export, it now defaults to Can custom skins be stored in the same places as state files and exported programs? (Preferably somewhere that doesn't get deleted when the app is uninstalled.) RE: Auto-rotation skins on Free42 v3.0.7 - rprosperi - 11-09-2021 01:22 PM (11-09-2021 05:36 AM)SammysHP Wrote:(11-09-2021 02:41 AM)rprosperi Wrote: Also, discussion of the various folders led me to wonder where .raw files (and others) are exported to by default, since the prior folder you mentioned isn't accessible. When you Export, it now defaults to Not an issue for me, Free42 is never uninstalled... |