HP Forums
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


RE: Auto-rotation skins on Free42 v3.0.7 - rprosperi - 11-09-2021 01:29 PM

(11-09-2021 08:44 AM)ijabbott Wrote:  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.)

State files are stored in one of the 'protected' folders that you cannot access unless the phone is rooted (also Android version dependent), and this is where skin files are stored when you install them thru the app, while exported .raw files are in the path I noted just above. Per SammysHP's comment above, this latter folder is removed. I honestly don't know if the 'protected' folders are removed during uninstall, but I would assume so, since there is no other way to access them, and apps are supposed to not leave data behind.


RE: Auto-rotation skins on Free42 v3.0.7 - Thomas Okken - 11-09-2021 01:53 PM

As it is now, the only directories that Free42 can access are directories that are deleted during uninstall, so if you want to save raw files on your phone and have those backups be permanent, you'd have to use a file manager to move them to a permanent location. (Or use Share, but I'm assuming we're talking about solutions that don't require such detours.)

I'll try to find out how to get read/write access to a directory that doesn't get deleted when the app is uninstalled. Back when Android wasn't so restrictive, I used to use /sdcard/Free42 for that kind of thing, but I don't know if the current security scheme would allow apps to obtain that kind of access, i.e. full access to a specific directory outside of the standard directories.


RE: Auto-rotation skins on Free42 v3.0.7 - ijabbott - 11-09-2021 08:45 PM

I think the Android file access restrictions are just as confusing to us lusers as they are to developers!


RE: Auto-rotation skins on Free42 v3.0.7 - johanw - 11-10-2021 07:39 PM

(11-09-2021 01:53 PM)Thomas Okken Wrote:  Back when Android wasn't so restrictive, I used to use /sdcard/Free42 for that kind of thing, but I don't know if the current security scheme would allow apps to obtain that kind of access, i.e. full access to a specific directory outside of the standard directories.
Yes that is possible with SAF. Your app has to ask permission to access that folder (you get a nice system file picker to select a folder) and can access files there through SAF. Unfortunately that means that the File api isn't usable anymore and you need a lot of complicated boilerplate code to just copy something there. Stackoverflow should have some examples, and other Android apps like Newpipe or Signal projects use it too.

The only advantage of this method is that it also works for cloud destinations like Google drive. But IMO SAF is a horrible example of over-engineering.


RE: Auto-rotation skins on Free42 v3.0.7 - SammysHP - 11-10-2021 07:42 PM

Also SAF is slow, so file access through SAF should be rare and cached, e.g. don't try to read graphics during every update on demand or write a log for every line (using a new file handle).


RE: Auto-rotation skins on Free42 v3.0.7 - Thomas Okken - 11-11-2021 01:09 AM

SAF sounds a bit redundant, too, doesn't it? I mean, on my iPhone, I could just use sharing for this. When I share a program or a state file, one of the options on the share sheet is to "Save to Files," and everything I save, I can then share again, using the Files app.

That's a pretty elegant API. You get saving to files, sending as email, saving to Google Drive, sending to another app, etc., all using the same code. Can't the Android share sheets do the same thing?


RE: Auto-rotation skins on Free42 v3.0.7 - johanw - 11-11-2021 01:25 AM

(11-11-2021 01:09 AM)Thomas Okken Wrote:  That's a pretty elegant API. You get saving to files, sending as email, saving to Google Drive, sending to another app, etc., all using the same code. Can't the Android share sheets do the same thing?
You can share files on Android. You have to register which file types your app can process and write code what the app does when a file is shared to it. However, with Free42 as sharer and sharing a file to a file manager to save it somewhere is something I've not seen on Android, and I don't know if it is possible on Android 11. It would definitely depend on the file manager.


RE: Auto-rotation skins on Free42 v3.0.7 - SammysHP - 11-11-2021 05:33 AM

With SAF you ask the user for permissions to access a specific file or directory. Afterwards you can access it as long and often as you like, until the user revokes his permission. It's not a "share and forget" type of API, where you just pass the data or URI to the system and don't care about what happens with it.

Sadly I've never worked directly with SAF, only indirectly by following the discussions in multiple projects. Otherwise I'd try to help you with a merge request. Maybe you can get help from RĂ©gis: https://github.com/dgis/emu48android


RE: Auto-rotation skins on Free42 v3.0.7 - johanw - 11-11-2021 07:34 AM

(11-11-2021 05:33 AM)SammysHP Wrote:  until the user revokes his permission.
Or, in the (unlikely) case Free42 is not used often and the user didn't switch it off, the system removes the permission itself. One of the more dumb ideas from Google. With the switch to API 30 this setting became automatically active for Free42.


RE: Auto-rotation skins on Free42 v3.0.7 - Thomas Okken - 11-11-2021 11:07 PM

Losing the permission after a time of non-use, plus slowness even when the OS is allowing access? I think SAF is well and truly out for skin loading.

It seems like the only reason to consider supporting SAF would be to offer alternative mechanisms for importing skins (which the built-in skin loader handles already, at least as long as the skins are somewhere on a web server), and importing and exporting programs and state files (which sharing supports already). And of course a file manager can be used to copy files to and from /sdcard/Android/data/<package_name>.

This has essentially been the state of affairs on iOS since forever, and I have been able to live with that just fine. I think I'll just leave it the way it is...


RE: Auto-rotation skins on Free42 v3.0.7 - johanw - 11-12-2021 01:38 AM

(11-11-2021 11:07 PM)Thomas Okken Wrote:  And of course a file manager can be used to copy files to and from /sdcard/Android/data/<package_name>.
On Android 11+ this only works if you have root (and a file manager that uses root but those are plenty). Otherwise that directory is shielded from view, even for apps with the manage storage permission.


RE: Auto-rotation skins on Free42 v3.0.7 - Thomas Okken - 11-12-2021 09:03 AM

Hmm, so that's even more restrictive than iOS? At least there, the standard "Files" app has access to apps' private directories...


RE: Auto-rotation skins on Free42 v3.0.7 - Peet - 11-12-2021 09:50 AM

(11-12-2021 01:38 AM)johanw Wrote:  On Android 11+ this only works if you have root (and a file manager that uses root but those are plenty). Otherwise that directory is shielded from view, even for apps with the manage storage permission.

I use a Pixel 2XL without root and can access the folder with filemanager+.


RE: Auto-rotation skins on Free42 v3.0.7 - johanw - 11-12-2021 03:38 PM

(11-12-2021 09:50 AM)Peet Wrote:  I use a Pixel 2XL without root and can access the folder with filemanager+.
On Android 11? On my Samsung A50 on Android 11 I can't even see that directory on the removable storage (and definitely not on the internal storage) with the Samsung file manager.

Seems I was partly wrong: when I boot without root access I could indeed access the [internal storage]/Android/data directory but it required a file manager with manage storage permission, and I was prompted to give it access to subdirs in that directory.


RE: Auto-rotation skins on Free42 v3.0.7 - rprosperi - 11-12-2021 05:44 PM

(11-12-2021 03:38 PM)johanw Wrote:  
(11-12-2021 09:50 AM)Peet Wrote:  I use a Pixel 2XL without root and can access the folder with filemanager+.
On Android 11? On my Samsung A50 on Android 11 I can't even see that directory on the removable storage (and definitely not on the internal storage) with the Samsung file manager.

Seems I was partly wrong: when I boot without root access I could indeed access the [internal storage]/Android/data directory but it required a file manager with manage storage permission, and I was prompted to give it access to subdirs in that directory.

Which File Manager app are you using?


RE: Auto-rotation skins on Free42 v3.0.7 - johanw - 11-12-2021 07:13 PM

(11-12-2021 05:44 PM)rprosperi Wrote:  Which File Manager app are you using?
Total Commander: https://play.google.com/store/apps/details?id=com.ghisler.android.TotalCommander


RE: Auto-rotation skins on Free42 v3.0.7 - Liamtoh Resu - 11-12-2021 08:04 PM

The home page for Total Commander:
"https://www.ghisler.com/"

The windows version of Total Commander (TC) has an excellent toolbar bookmarking
mechanism which makes it useful as an alternative program manager. You can use it
to find and bookmark the HP Prime files.

There is an open source program called Double Commander for windows and linux, which is is similar to TC, with slightly different features.

Thanks.


RE: Auto-rotation skins on Free42 v3.0.7 - rprosperi - 11-13-2021 03:17 AM

(11-12-2021 07:13 PM)johanw Wrote:  
(11-12-2021 05:44 PM)rprosperi Wrote:  Which File Manager app are you using?
Total Commander: https://play.google.com/store/apps/details?id=com.ghisler.android.TotalCommander

Thanks! I had no idea there was and Android port of TC, which I've used since the early 90's, one of the first File Managers for Windows (in 3.11 I think).

I don't see built-in ftp server for exchanging files with PC yet, but am still exploring.

Thanks for mentioning this! Smile


RE: Auto-rotation skins on Free42 v3.0.7 - johanw - 11-13-2021 04:14 PM

(11-13-2021 03:17 AM)rprosperi Wrote:  I don't see built-in ftp server for exchanging files with PC yet, but am still exploring.
It support plugins. There is one for SFTP: https://play.google.com/store/apps/details?id=com.ghisler.tcplugins.SFTP and one for FTP: https://play.google.com/store/apps/details?id=com.ghisler.tcplugins.FTP (and many others, like Dropbox and SMB).


RE: Auto-rotation skins on Free42 v3.0.7 - rprosperi - 11-13-2021 06:42 PM

(11-13-2021 04:14 PM)johanw Wrote:  
(11-13-2021 03:17 AM)rprosperi Wrote:  I don't see built-in ftp server for exchanging files with PC yet, but am still exploring.
It support plugins. There is one for SFTP: https://play.google.com/store/apps/details?id=com.ghisler.tcplugins.SFTP and one for FTP: https://play.google.com/store/apps/details?id=com.ghisler.tcplugins.FTP (and many others, like Dropbox and SMB).

The good news just keeps on coming, I was going to go look at plugins for the Android version this weekend. Smile

Thank you!