Post Reply 
Auto-rotation skins on Free42 v3.0.7
11-09-2021, 01:29 PM
Post: #21
RE: Auto-rotation skins on Free42 v3.0.7
(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.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
11-09-2021, 01:53 PM
Post: #22
RE: Auto-rotation skins on Free42 v3.0.7
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
11-09-2021, 08:45 PM
Post: #23
RE: Auto-rotation skins on Free42 v3.0.7
I think the Android file access restrictions are just as confusing to us lusers as they are to developers!

— Ian Abbott
Find all posts by this user
Quote this message in a reply
11-10-2021, 07:39 PM (This post was last modified: 11-10-2021 11:55 PM by johanw.)
Post: #24
RE: Auto-rotation skins on Free42 v3.0.7
(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.
Find all posts by this user
Quote this message in a reply
11-10-2021, 07:42 PM
Post: #25
RE: Auto-rotation skins on Free42 v3.0.7
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).
Visit this user's website Find all posts by this user
Quote this message in a reply
11-11-2021, 01:09 AM
Post: #26
RE: Auto-rotation skins on Free42 v3.0.7
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?
Visit this user's website Find all posts by this user
Quote this message in a reply
11-11-2021, 01:25 AM (This post was last modified: 11-11-2021 01:26 AM by johanw.)
Post: #27
RE: Auto-rotation skins on Free42 v3.0.7
(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.
Find all posts by this user
Quote this message in a reply
11-11-2021, 05:33 AM
Post: #28
RE: Auto-rotation skins on Free42 v3.0.7
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
Visit this user's website Find all posts by this user
Quote this message in a reply
11-11-2021, 07:34 AM (This post was last modified: 11-11-2021 07:40 AM by johanw.)
Post: #29
RE: Auto-rotation skins on Free42 v3.0.7
(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.
Find all posts by this user
Quote this message in a reply
11-11-2021, 11:07 PM
Post: #30
RE: Auto-rotation skins on Free42 v3.0.7
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...
Visit this user's website Find all posts by this user
Quote this message in a reply
11-12-2021, 01:38 AM
Post: #31
RE: Auto-rotation skins on Free42 v3.0.7
(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.
Find all posts by this user
Quote this message in a reply
11-12-2021, 09:03 AM
Post: #32
RE: Auto-rotation skins on Free42 v3.0.7
Hmm, so that's even more restrictive than iOS? At least there, the standard "Files" app has access to apps' private directories...
Visit this user's website Find all posts by this user
Quote this message in a reply
11-12-2021, 09:50 AM
Post: #33
RE: Auto-rotation skins on Free42 v3.0.7
(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+.

My calculators - former: CBM PR100, HP41CV, HP11C, HP28S - current: HP48G, HP35S, Prime, DM41X, DM42, HP12C
Find all posts by this user
Quote this message in a reply
11-12-2021, 03:38 PM
Post: #34
RE: Auto-rotation skins on Free42 v3.0.7
(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.
Find all posts by this user
Quote this message in a reply
11-12-2021, 05:44 PM
Post: #35
RE: Auto-rotation skins on Free42 v3.0.7
(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?

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
11-12-2021, 07:13 PM
Post: #36
RE: Auto-rotation skins on Free42 v3.0.7
(11-12-2021 05:44 PM)rprosperi Wrote:  Which File Manager app are you using?
Total Commander: https://play.google.com/store/apps/detai...lCommander
Find all posts by this user
Quote this message in a reply
11-12-2021, 08:04 PM
Post: #37
RE: Auto-rotation skins on Free42 v3.0.7
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.
Find all posts by this user
Quote this message in a reply
11-13-2021, 03:17 AM
Post: #38
RE: Auto-rotation skins on Free42 v3.0.7
(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/detai...lCommander

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

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
11-13-2021, 04:14 PM
Post: #39
RE: Auto-rotation skins on Free42 v3.0.7
(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/detai...ugins.SFTP and one for FTP: https://play.google.com/store/apps/detai...lugins.FTP (and many others, like Dropbox and SMB).
Find all posts by this user
Quote this message in a reply
11-13-2021, 06:42 PM
Post: #40
RE: Auto-rotation skins on Free42 v3.0.7
(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/detai...ugins.SFTP and one for FTP: https://play.google.com/store/apps/detai...lugins.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!

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
Post Reply 




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