Re: [sword-devel] New shared common SWORD path on Android

2023-10-29 Thread Timothy Allen

On 29/10/23 19:16, Tobias Klein wrote:

What makes it complicated in my case is the following.

Ezra Bible App on Android is a Cordova app. When it comes to 
permissions, etc. I depend on Cordova Plugins.


The one that I had been using is this:
https://www.npmjs.com/package/cordova-plugin-android-permissions


It seems like to store files in a shared directory on Android you'll 
need to use a plugin like 
https://www.npmjs.com/package/cordova-plugin-saf-mediastore instead. 
That plugin can ask the user for permission to read and write a 
directory, but it's not at all clear to me if there's a way to list the 
contents of a directory. Obviously it's possible using the native 
Android APIs, but I can't find anyone saying "here's how to manage a 
directory tree from within Cordova", even in the Cordova tech-support 
threads talking about handling files. :(


I appreciate not wanting to dive into yet another language, just to add 
a somewhat niche feature. Thank you for taking the time to respond!



Timothy.

___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page


Re: [sword-devel] New shared common SWORD path on Android

2023-10-29 Thread Tobias Klein

Hi Timothy,

yes, that's the user perspective and it is clear.

What makes it complicated in my case is the following.

Ezra Bible App on Android is a Cordova app. When it comes to 
permissions, etc. I depend on Cordova Plugins.


The one that I had been using is this:
https://www.npmjs.com/package/cordova-plugin-android-permissions

I believe that is the one that Troy is using, too.

When I tried last I couldn't get it to work with Android 11/12 and I 
have not tried Android 13 yet. In general, the plugin authors seem to be 
dealing with a long list of issues:

https://github.com/NeoLSN/cordova-plugin-android-permissions/issues

Now, I could put in the effort to fix that plugin or create my own. But 
that would add another technology/programming language to the list of 
technologies/programming languages I need to keep myself familiar with 
and where I would need to maintain it for future Android changes ... and 
that's currently too much. In case of Ezra Bible App, I already need to 
deal with peculiarities of Windows and macOS ... aside from the Cordova 
platform and I am supporting two different "development contexts" (C++ 
for SWORD, JavaScript for the app).


At some point I checked whether the "scoped storage" could be handled 
from C/C++ side, but I didn't find any easy enough entry points.


So, unless the Cordova world evolves further (including the respective 
plugins) ... it's going to be difficult with shared storage in Ezra 
starting from Android 11.
Maybe Troy has more luck and comes up with a reproducible approach ... I 
am open to learn and discuss!


Best regards,
Tobias


On 10/29/23 4:44 AM, Timothy Allen wrote:

On 29/10/23 05:50, Tobias Klein wrote:
If you happen to figure out a reliable solution for >= 11 and the new 
Scoped Storage model, I'd be happy to learn.


For >= 11 I am thinking about introducing a Cloud sync feature for 
the sword directory. This could then work with Dropbox and maybe also 
OneDrive.


As an Android user, my understanding is that apps can ask the user for 
a a shared directory to store their stuff in[1] and then read and 
write arbitrary files within that directory. If this option were 
available, I could point any SWORD apps to the same directory, and 
they would share modules. Personally, I would point apps to a 
subdirectory of my SyncThing directory, taking care of the cloud-sync 
problem too.



Timothy

[1]: 
https://developer.android.com/training/data-storage/shared/documents-files#grant-access-directory


___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page


Re: [sword-devel] New shared common SWORD path on Android

2023-10-28 Thread Timothy Allen

On 29/10/23 05:50, Tobias Klein wrote:
If you happen to figure out a reliable solution for >= 11 and the new 
Scoped Storage model, I'd be happy to learn.


For >= 11 I am thinking about introducing a Cloud sync feature for the 
sword directory. This could then work with Dropbox and maybe also 
OneDrive.


As an Android user, my understanding is that apps can ask the user for a 
a shared directory to store their stuff in[1] and then read and write 
arbitrary files within that directory. If this option were available, I 
could point any SWORD apps to the same directory, and they would share 
modules. Personally, I would point apps to a subdirectory of my 
SyncThing directory, taking care of the cloud-sync problem too.



Timothy

[1]: 
https://developer.android.com/training/data-storage/shared/documents-files#grant-access-directory


___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page


Re: [sword-devel] New shared common SWORD path on Android

2023-10-28 Thread Tobias Klein

Hi Troy,

I did not re-attempt to fix the shared data path idea for Android >= 11.

Since Google introduced their scoped storage model ... I gave up on it.

On Android versions <= 10, I use the SWORD path /sdcard/Documents/sword.

On versions >= 11, I store everything in the internal app directory, and 
therefore there is no shared data path anymore.


If you happen to figure out a reliable solution for >= 11 and the new 
Scoped Storage model, I'd be happy to learn.


For >= 11 I am thinking about introducing a Cloud sync feature for the 
sword directory. This could then work with Dropbox and maybe also OneDrive.


Best regards,
Tobias

PS: I had a long summer break this year and was not very active on this 
mailing list. Hopefully my participation will increase again now.



On 10/22/23 11:51 AM, Troy A. Griffitts wrote:


Hi Tobias and others with Android SWORD apps.

I am trying to bundle up a new version of Bishop for Android with the 
some exciting improvements in the libsword (I'll post another email 
about those, Lord willing, soon), and I would like to check on the 
latest status for a shared sword path for us.


I have tried again to read about the current ways for apps to share 
data and am still unclear what is allowed, without performing experiments.


Tobias, where did you end up with your data path?  I'll do some 
investigations with the latest versions of Android images available 
from Google and see where the current logic in Bishop creates data 
files and report back.


Hope you are all having a wonderful weekend!

Glory to God for salvation in Jesus!  And thanks to Him for life and a 
warm bed and a roof over our heads and relative peace.  Many don't 
have those things.


Troy


On 10/4/21 13:10, Troy A. Griffitts wrote:

Hi Tobias,
So, I did a bunch of reading when choosing this location and couldn't 
find anything that specifically listed which folders where standard 
"top level" folders under /sdcard, only that the changes to the API 
in newer versions of Android prevented creation of top level folders 
under /sdcard. This article suggested to use 'Music':


https://www.reddit.com/r/androiddev/comments/jn5azi/android_11_dodges_a_bullet_apps_creating_a_folder/?utm_source=amp&utm_medium=&utm_content=post_body 



I didn't think Music was appropriate for us, but Iooked on my 
developer images from Google on the latest version of Android and a 
few versions back (I only need to go back as far as until Android 
still lets me store to /sdcard/sword, because I try that next if 
/sdcard/Documents/sword fails), and on my physical phone, and they 
all had /sdcard/Documents/ available.


I am open to better suggestions.

Again, to sum up where I understand things now:

Android, pre-10 lets us store to /sdcard/sword

Android 10 was kind of a mess and wanted everyone to use the new 
storage api instead of file paths but still allowed /sdcard/sword


Android 11 and later, Google recanted because of pressure from the 
community and settled on: file path are officially blessed again, but 
no top level folders created by apps under /sdcard, so we need to 
choose a folder.


/sdcard/Documents/sword seemed to exist on all versions of Android I 
checked, later than the versions which still supported /SD 
card/sword, so I settled with the logic:


Try in this order to test write access to:

/sdcard/Documents/sword
/sdcard/sword
[private unshared app storage]/sword

That's my best attempt. If you have a better suggestion, I am all ears.

Troy


On October 3, 2021 10:56:34 AM MST, Tobias Klein 
 wrote:


Hi Troy,

I can certainly consider /sdcard/Documents as a new base also for
Ezra (haven't tried it yet).

I just did a quick search and I didn't find any official Android
documentation on that particular filesystem path. Is there
something you can point me to?

Best regards,
Tobias

On 9/13/21 12:38 PM, Troy A. Griffitts wrote:


Thanks Michael, yes, I also feel we need to not swim against the
Google flow.  The problem is that the Google flow seems to turn
at each new release of Android.  Be assured, my goal is to find
a common means for us to share a single install of SWORD modules
and to do it the way Google wants and for as many versions of
Android as practical.

Tobias,

I've had no trouble writing to /sdcard/... from our C++ code, as
long as I don't write to the root of /sdcard/. My change from
/sdcard/sword to /sdcard/Documents/sword/ works fine on Android 11.

Can you give /sdcard/Documents/sword/ a try?  You can grab my
exact C++ code from the cordova plugin if you have trouble.

https://crosswire.org/svn/sword/trunk/bindings/java-jni/jni/swordstub.cpp

static void init(JNIEnv *env);

On 9/13/21 10:32 AM, Tobias Klein wrote:


Dear Troy,

We shoul

Re: [sword-devel] New shared common SWORD path on Android

2023-10-24 Thread Troy A. Griffitts
One new good thing I've found: Google now has a system to distribute binary 
libraries for C++ builds. It's called Prefab, and the example they give is 
exactly why I was looking: libcurl

Here's a link:

https://android-developers.googleblog.com/2020/02/native-dependencies-in-android-studio-40.html

Up till now, the Cordova SWORD bindings have used the included libftp in SWORD 
for package install. My plan is to bump this up to libcurl to take advantage of 
some of the new features in libsword trunk.

Hope it works!

Troy

On October 22, 2023 11:51:56 GMT+02:00, "Troy A. Griffitts" 
 wrote:
>Hi Tobias and others with Android SWORD apps.
>
>I am trying to bundle up a new version of Bishop for Android with the some 
>exciting improvements in the libsword (I'll post another email about those, 
>Lord willing, soon), and I would like to check on the latest status for a 
>shared sword path for us.
>
>I have tried again to read about the current ways for apps to share data and 
>am still unclear what is allowed, without performing experiments.
>
>Tobias, where did you end up with your data path?  I'll do some investigations 
>with the latest versions of Android images available from Google and see where 
>the current logic in Bishop creates data files and report back.
>
>Hope you are all having a wonderful weekend!
>
>Glory to God for salvation in Jesus!  And thanks to Him for life and a warm 
>bed and a roof over our heads and relative peace.  Many don't have those 
>things.
>
>Troy
>
>
>On 10/4/21 13:10, Troy A. Griffitts wrote:
>> Hi Tobias,
>> So, I did a bunch of reading when choosing this location and couldn't find 
>> anything that specifically listed which folders where standard "top level" 
>> folders under /sdcard, only that the changes to the API in newer versions of 
>> Android prevented creation of top level folders under /sdcard. This article 
>> suggested to use 'Music':
>> 
>> https://www.reddit.com/r/androiddev/comments/jn5azi/android_11_dodges_a_bullet_apps_creating_a_folder/?utm_source=amp&utm_medium=&utm_content=post_body
>>  
>> 
>> 
>> I didn't think Music was appropriate for us, but Iooked on my developer 
>> images from Google on the latest version of Android and a few versions back 
>> (I only need to go back as far as until Android still lets me store to 
>> /sdcard/sword, because I try that next if /sdcard/Documents/sword fails), 
>> and on my physical phone, and they all had /sdcard/Documents/ available.
>> 
>> I am open to better suggestions.
>> 
>> Again, to sum up where I understand things now:
>> 
>> Android, pre-10 lets us store to /sdcard/sword
>> 
>> Android 10 was kind of a mess and wanted everyone to use the new storage api 
>> instead of file paths but still allowed /sdcard/sword
>> 
>> Android 11 and later, Google recanted because of pressure from the community 
>> and settled on: file path are officially blessed again, but no top level 
>> folders created by apps under /sdcard, so we need to choose a folder.
>> 
>> /sdcard/Documents/sword seemed to exist on all versions of Android I 
>> checked, later than the versions which still supported /SD card/sword, so I 
>> settled with the logic:
>> 
>> Try in this order to test write access to:
>> 
>> /sdcard/Documents/sword
>> /sdcard/sword
>> [private unshared app storage]/sword
>> 
>> That's my best attempt. If you have a better suggestion, I am all ears.
>> 
>> Troy
>> 
>> 
>> On October 3, 2021 10:56:34 AM MST, Tobias Klein  wrote:
>> 
>> Hi Troy,
>> 
>> I can certainly consider /sdcard/Documents as a new base also for
>> Ezra (haven't tried it yet).
>> 
>> I just did a quick search and I didn't find any official Android
>> documentation on that particular filesystem path. Is there
>> something you can point me to?
>> 
>> Best regards,
>> Tobias
>> 
>> On 9/13/21 12:38 PM, Troy A. Griffitts wrote:
>>> 
>>> Thanks Michael, yes, I also feel we need to not swim against the
>>> Google flow.  The problem is that the Google flow seems to turn
>>> at each new release of Android.  Be assured, my goal is to find a
>>> common means for us to share a single install of SWORD modules
>>> and to do it the way Google wants and for as many versions of
>>> Android as practical.
>>> 
>>> Tobias,
>>> 
>>> I've had no trouble writing to /sdcard/... from our C++ code, as
>>> long as I don't write to the root of /sdcard/. My change from
>>> /sdcard/sword to /sdcard/Documents/sword/ works fine on Android 11.
>>> 
>>> Can you give /sdcard/Documents/sword/ a try?  You can grab my
>>> exact C++ code from the cordova plugin if you have trouble.
>>> 
>>> 
>>> https://crosswire.org/svn/sword/trunk/bindings/java-jni/jni/swordstub.cpp
>>> 
>>> static void init(JNIEnv *env);
>>> 
>>> On 9/13/21 10:32 AM, Tobias 

Re: [sword-devel] New shared common SWORD path on Android

2023-10-22 Thread Troy A. Griffitts

Hi Tobias and others with Android SWORD apps.

I am trying to bundle up a new version of Bishop for Android with the 
some exciting improvements in the libsword (I'll post another email 
about those, Lord willing, soon), and I would like to check on the 
latest status for a shared sword path for us.


I have tried again to read about the current ways for apps to share data 
and am still unclear what is allowed, without performing experiments.


Tobias, where did you end up with your data path?  I'll do some 
investigations with the latest versions of Android images available from 
Google and see where the current logic in Bishop creates data files and 
report back.


Hope you are all having a wonderful weekend!

Glory to God for salvation in Jesus!  And thanks to Him for life and a 
warm bed and a roof over our heads and relative peace.  Many don't have 
those things.


Troy


On 10/4/21 13:10, Troy A. Griffitts wrote:

Hi Tobias,
So, I did a bunch of reading when choosing this location and couldn't 
find anything that specifically listed which folders where standard 
"top level" folders under /sdcard, only that the changes to the API in 
newer versions of Android prevented creation of top level folders 
under /sdcard. This article suggested to use 'Music':


https://www.reddit.com/r/androiddev/comments/jn5azi/android_11_dodges_a_bullet_apps_creating_a_folder/?utm_source=amp&utm_medium=&utm_content=post_body 



I didn't think Music was appropriate for us, but Iooked on my 
developer images from Google on the latest version of Android and a 
few versions back (I only need to go back as far as until Android 
still lets me store to /sdcard/sword, because I try that next if 
/sdcard/Documents/sword fails), and on my physical phone, and they all 
had /sdcard/Documents/ available.


I am open to better suggestions.

Again, to sum up where I understand things now:

Android, pre-10 lets us store to /sdcard/sword

Android 10 was kind of a mess and wanted everyone to use the new 
storage api instead of file paths but still allowed /sdcard/sword


Android 11 and later, Google recanted because of pressure from the 
community and settled on: file path are officially blessed again, but 
no top level folders created by apps under /sdcard, so we need to 
choose a folder.


/sdcard/Documents/sword seemed to exist on all versions of Android I 
checked, later than the versions which still supported /SD card/sword, 
so I settled with the logic:


Try in this order to test write access to:

/sdcard/Documents/sword
/sdcard/sword
[private unshared app storage]/sword

That's my best attempt. If you have a better suggestion, I am all ears.

Troy


On October 3, 2021 10:56:34 AM MST, Tobias Klein  
wrote:


Hi Troy,

I can certainly consider /sdcard/Documents as a new base also for
Ezra (haven't tried it yet).

I just did a quick search and I didn't find any official Android
documentation on that particular filesystem path. Is there
something you can point me to?

Best regards,
Tobias

On 9/13/21 12:38 PM, Troy A. Griffitts wrote:


Thanks Michael, yes, I also feel we need to not swim against the
Google flow.  The problem is that the Google flow seems to turn
at each new release of Android.  Be assured, my goal is to find a
common means for us to share a single install of SWORD modules
and to do it the way Google wants and for as many versions of
Android as practical.

Tobias,

I've had no trouble writing to /sdcard/... from our C++ code, as
long as I don't write to the root of /sdcard/. My change from
/sdcard/sword to /sdcard/Documents/sword/ works fine on Android 11.

Can you give /sdcard/Documents/sword/ a try?  You can grab my
exact C++ code from the cordova plugin if you have trouble.

https://crosswire.org/svn/sword/trunk/bindings/java-jni/jni/swordstub.cpp

static void init(JNIEnv *env);

On 9/13/21 10:32 AM, Tobias Klein wrote:


Dear Troy,

We should certainly align on the directories and keep it simple.

However, starting from Android 11 Google makes it really hard
for us due to the "Scoped Storage" concept, see
https://developer.android.com/about/versions/11/privacy/storage

I couldn't figure out a way to write to /sdcard any more in my
C++ context on Android 11.

As a consequence at the moment I am not using /sdcard from
Android 11 anymore, but only the private app folder.

For Android < 11 I am using */sdcard/sword*, but for Android >=
11 I have completely disabled this including the permissions
request for WRITE_EXTERNAL_STORAGE.

I wonder whether there is still any way to still use /sdcard/*
in Android >= 11 in the C++ context ... I haven't found a
solution yet and it seems rather complicated.

Best regards,

Re: [sword-devel] New shared common SWORD path on Android

2021-10-04 Thread Troy A. Griffitts
Hi Tobias,
So, I did a bunch of reading when choosing this location and couldn't find 
anything that specifically listed which folders where standard "top level" 
folders under /sdcard, only that the changes to the API in newer versions of 
Android prevented creation of top level folders under /sdcard. This article 
suggested to use 'Music':

https://www.reddit.com/r/androiddev/comments/jn5azi/android_11_dodges_a_bullet_apps_creating_a_folder/?utm_source=amp&utm_medium=&utm_content=post_body

I didn't think Music was appropriate for us, but Iooked on my developer images 
from Google on the latest version of Android and a few versions back (I only 
need to go back as far as until Android still lets me store to /sdcard/sword, 
because I try that next if /sdcard/Documents/sword fails), and on my physical 
phone, and they all had /sdcard/Documents/ available.

I am open to better suggestions.

Again, to sum up where I understand things now:

Android, pre-10 lets us store to /sdcard/sword

Android 10 was kind of a mess and wanted everyone to use the new storage api 
instead of file paths but still allowed /sdcard/sword

Android 11 and later, Google recanted because of pressure from the community 
and settled on: file path are officially blessed again, but no top level 
folders created by apps under /sdcard, so we need to choose a folder.

/sdcard/Documents/sword seemed to exist on all versions of Android I checked, 
later than the versions which still supported /SD card/sword, so I settled with 
the logic:

Try in this order to test write access to:

/sdcard/Documents/sword
/sdcard/sword
[private unshared app storage]/sword

That's my best attempt. If you have a better suggestion, I am all ears.

Troy


On October 3, 2021 10:56:34 AM MST, Tobias Klein  wrote:
>Hi Troy,
>
>I can certainly consider /sdcard/Documents as a new base also for Ezra 
>(haven't tried it yet).
>
>I just did a quick search and I didn't find any official Android 
>documentation on that particular filesystem path. Is there something you 
>can point me to?
>
>Best regards,
>Tobias
>
>On 9/13/21 12:38 PM, Troy A. Griffitts wrote:
>>
>> Thanks Michael, yes, I also feel we need to not swim against the 
>> Google flow.  The problem is that the Google flow seems to turn at 
>> each new release of Android.  Be assured, my goal is to find a common 
>> means for us to share a single install of SWORD modules and to do it 
>> the way Google wants and for as many versions of Android as practical.
>>
>> Tobias,
>>
>> I've had no trouble writing to /sdcard/... from our C++ code, as long 
>> as I don't write to the root of /sdcard/.  My change from 
>> /sdcard/sword to /sdcard/Documents/sword/ works fine on Android 11.
>>
>> Can you give /sdcard/Documents/sword/ a try?  You can grab my exact 
>> C++ code from the cordova plugin if you have trouble.
>>
>> https://crosswire.org/svn/sword/trunk/bindings/java-jni/jni/swordstub.cpp
>>
>> static void init(JNIEnv *env);
>>
>> On 9/13/21 10:32 AM, Tobias Klein wrote:
>>>
>>> Dear Troy,
>>>
>>> We should certainly align on the directories and keep it simple.
>>>
>>> However, starting from Android 11 Google makes it really hard for us 
>>> due to the "Scoped Storage" concept, see 
>>> https://developer.android.com/about/versions/11/privacy/storage
>>>
>>> I couldn't figure out a way to write to /sdcard any more in my C++ 
>>> context on Android 11.
>>>
>>> As a consequence at the moment I am not using /sdcard from Android 11 
>>> anymore, but only the private app folder.
>>>
>>> For Android < 11 I am using */sdcard/sword*, but for Android >= 11 I 
>>> have completely disabled this including the permissions request for 
>>> WRITE_EXTERNAL_STORAGE.
>>>
>>> I wonder whether there is still any way to still use /sdcard/* in 
>>> Android >= 11 in the C++ context ... I haven't found a solution yet 
>>> and it seems rather complicated.
>>>
>>> Best regards,
>>> Tobias
>>>
>>> On 9/12/21 3:51 PM, Troy A. Griffitts wrote:
 Dear all,

 I've been updating Bishop to work on newer versions of Android and have
 found that we are running into problems trying to create the
 "Nonstandard top-level folder" 'sword' at the root of the common storage
 folder.

 Tobias, I know a while back you mentioned that you had to update Ezra
 for Android recently, but it has been a long while since we talked about
 it and I'd like to know if you've had any updated thoughts on what
 you're doing there.

 Any other mobile Android devs have any thoughts.

 For now, I have updated our cordova plugin (and thus Bishop) to check
 and if possible use paths in this preferred order:

 "/sdcard/Documents/sword"

 "/sdcard/sword"

 ((android.app.Application)
 app).getApplicationContext().getFilesDir().getAbsolutePath();

 And we are augmenting modules from AndBible:

 "/sdcard/Android/data/net.bible.android.activity/files"

 ... but I'd prefer no

Re: [sword-devel] New shared common SWORD path on Android

2021-10-03 Thread Tobias Klein

Hi Troy,

I can certainly consider /sdcard/Documents as a new base also for Ezra 
(haven't tried it yet).


I just did a quick search and I didn't find any official Android 
documentation on that particular filesystem path. Is there something you 
can point me to?


Best regards,
Tobias

On 9/13/21 12:38 PM, Troy A. Griffitts wrote:


Thanks Michael, yes, I also feel we need to not swim against the 
Google flow.  The problem is that the Google flow seems to turn at 
each new release of Android.  Be assured, my goal is to find a common 
means for us to share a single install of SWORD modules and to do it 
the way Google wants and for as many versions of Android as practical.


Tobias,

I've had no trouble writing to /sdcard/... from our C++ code, as long 
as I don't write to the root of /sdcard/.  My change from 
/sdcard/sword to /sdcard/Documents/sword/ works fine on Android 11.


Can you give /sdcard/Documents/sword/ a try?  You can grab my exact 
C++ code from the cordova plugin if you have trouble.


https://crosswire.org/svn/sword/trunk/bindings/java-jni/jni/swordstub.cpp

static void init(JNIEnv *env);

On 9/13/21 10:32 AM, Tobias Klein wrote:


Dear Troy,

We should certainly align on the directories and keep it simple.

However, starting from Android 11 Google makes it really hard for us 
due to the "Scoped Storage" concept, see 
https://developer.android.com/about/versions/11/privacy/storage


I couldn't figure out a way to write to /sdcard any more in my C++ 
context on Android 11.


As a consequence at the moment I am not using /sdcard from Android 11 
anymore, but only the private app folder.


For Android < 11 I am using */sdcard/sword*, but for Android >= 11 I 
have completely disabled this including the permissions request for 
WRITE_EXTERNAL_STORAGE.


I wonder whether there is still any way to still use /sdcard/* in 
Android >= 11 in the C++ context ... I haven't found a solution yet 
and it seems rather complicated.


Best regards,
Tobias

On 9/12/21 3:51 PM, Troy A. Griffitts wrote:

Dear all,

I've been updating Bishop to work on newer versions of Android and have
found that we are running into problems trying to create the
"Nonstandard top-level folder" 'sword' at the root of the common storage
folder.

Tobias, I know a while back you mentioned that you had to update Ezra
for Android recently, but it has been a long while since we talked about
it and I'd like to know if you've had any updated thoughts on what
you're doing there.

Any other mobile Android devs have any thoughts.

For now, I have updated our cordova plugin (and thus Bishop) to check
and if possible use paths in this preferred order:

"/sdcard/Documents/sword"

"/sdcard/sword"

((android.app.Application)
app).getApplicationContext().getFilesDir().getAbsolutePath();

And we are augmenting modules from AndBible:

"/sdcard/Android/data/net.bible.android.activity/files"

... but I'd prefer not to do this any longer, once we all agree and
implement storing files in a common location.

Any thoughts?

Troy


___
sword-devel mailing list:sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page


___
sword-devel mailing list:sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page


___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page
___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Re: [sword-devel] New shared common SWORD path on Android

2021-09-13 Thread Troy A. Griffitts
Thanks Michael, yes, I also feel we need to not swim against the Google
flow.  The problem is that the Google flow seems to turn at each new
release of Android.  Be assured, my goal is to find a common means for
us to share a single install of SWORD modules and to do it the way
Google wants and for as many versions of Android as practical.

Tobias,

I've had no trouble writing to /sdcard/... from our C++ code, as long as
I don't write to the root of /sdcard/.  My change from /sdcard/sword to
/sdcard/Documents/sword/ works fine on Android 11.

Can you give /sdcard/Documents/sword/ a try?  You can grab my exact C++
code from the cordova plugin if you have trouble.

https://crosswire.org/svn/sword/trunk/bindings/java-jni/jni/swordstub.cpp

static void init(JNIEnv *env);

On 9/13/21 10:32 AM, Tobias Klein wrote:
>
> Dear Troy,
>
> We should certainly align on the directories and keep it simple.
>
> However, starting from Android 11 Google makes it really hard for us
> due to the "Scoped Storage" concept, see
> https://developer.android.com/about/versions/11/privacy/storage
>
> I couldn't figure out a way to write to /sdcard any more in my C++
> context on Android 11.
>
> As a consequence at the moment I am not using /sdcard from Android 11
> anymore, but only the private app folder.
>
> For Android < 11 I am using */sdcard/sword*, but for Android >= 11 I
> have completely disabled this including the permissions request for
> WRITE_EXTERNAL_STORAGE.
>
> I wonder whether there is still any way to still use /sdcard/* in
> Android >= 11 in the C++ context ... I haven't found a solution yet
> and it seems rather complicated.
>
> Best regards,
> Tobias
>
> On 9/12/21 3:51 PM, Troy A. Griffitts wrote:
>> Dear all,
>>
>> I've been updating Bishop to work on newer versions of Android and have
>> found that we are running into problems trying to create the
>> "Nonstandard top-level folder" 'sword' at the root of the common storage
>> folder.
>>
>> Tobias, I know a while back you mentioned that you had to update Ezra
>> for Android recently, but it has been a long while since we talked about
>> it and I'd like to know if you've had any updated thoughts on what
>> you're doing there.
>>
>> Any other mobile Android devs have any thoughts.
>>
>> For now, I have updated our cordova plugin (and thus Bishop) to check
>> and if possible use paths in this preferred order:
>>
>> "/sdcard/Documents/sword"
>>
>> "/sdcard/sword"
>>
>> ((android.app.Application)
>> app).getApplicationContext().getFilesDir().getAbsolutePath();
>>
>> And we are augmenting modules from AndBible:
>>
>> "/sdcard/Android/data/net.bible.android.activity/files"
>>
>> ... but I'd prefer not to do this any longer, once we all agree and
>> implement storing files in a common location.
>>
>> Any thoughts?
>>
>> Troy
>>
>>
>> ___
>> sword-devel mailing list: sword-devel@crosswire.org
>> http://crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>
> ___
> sword-devel mailing list: sword-devel@crosswire.org
> http://crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Re: [sword-devel] New shared common SWORD path on Android

2021-09-13 Thread Tobias Klein

Dear Troy,

We should certainly align on the directories and keep it simple.

However, starting from Android 11 Google makes it really hard for us due 
to the "Scoped Storage" concept, see 
https://developer.android.com/about/versions/11/privacy/storage


I couldn't figure out a way to write to /sdcard any more in my C++ 
context on Android 11.


As a consequence at the moment I am not using /sdcard from Android 11 
anymore, but only the private app folder.


For Android < 11 I am using */sdcard/sword*, but for Android >= 11 I 
have completely disabled this including the permissions request for 
WRITE_EXTERNAL_STORAGE.


I wonder whether there is still any way to still use /sdcard/* in 
Android >= 11 in the C++ context ... I haven't found a solution yet and 
it seems rather complicated.


Best regards,
Tobias

On 9/12/21 3:51 PM, Troy A. Griffitts wrote:

Dear all,

I've been updating Bishop to work on newer versions of Android and have
found that we are running into problems trying to create the
"Nonstandard top-level folder" 'sword' at the root of the common storage
folder.

Tobias, I know a while back you mentioned that you had to update Ezra
for Android recently, but it has been a long while since we talked about
it and I'd like to know if you've had any updated thoughts on what
you're doing there.

Any other mobile Android devs have any thoughts.

For now, I have updated our cordova plugin (and thus Bishop) to check
and if possible use paths in this preferred order:

"/sdcard/Documents/sword"

"/sdcard/sword"

((android.app.Application)
app).getApplicationContext().getFilesDir().getAbsolutePath();

And we are augmenting modules from AndBible:

"/sdcard/Android/data/net.bible.android.activity/files"

... but I'd prefer not to do this any longer, once we all agree and
implement storing files in a common location.

Any thoughts?

Troy


___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page
___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Re: [sword-devel] New shared common SWORD path on Android

2021-09-12 Thread Michael Johnson
My main thoughts on this are:
1. The less we fight the way Google wants Android to work, the better.
2. Within the constraints of the above, backward compatibility is good.

On 9/12/21 3:51 AM, Troy A. Griffitts wrote:
> Dear all,
>
> I've been updating Bishop to work on newer versions of Android and have
> found that we are running into problems trying to create the
> "Nonstandard top-level folder" 'sword' at the root of the common storage
> folder.
>
> Tobias, I know a while back you mentioned that you had to update Ezra
> for Android recently, but it has been a long while since we talked about
> it and I'd like to know if you've had any updated thoughts on what
> you're doing there.
>
> Any other mobile Android devs have any thoughts.
>
> For now, I have updated our cordova plugin (and thus Bishop) to check
> and if possible use paths in this preferred order:
>
> "/sdcard/Documents/sword"
>
> "/sdcard/sword"
>
> ((android.app.Application)
> app).getApplicationContext().getFilesDir().getAbsolutePath();
>
> And we are augmenting modules from AndBible:
>
> "/sdcard/Android/data/net.bible.android.activity/files"
>
> ... but I'd prefer not to do this any longer, once we all agree and
> implement storing files in a common location.
>
> Any thoughts?
>
> Troy
>
>
> ___
> sword-devel mailing list: sword-devel@crosswire.org
> http://crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page


-- 
signature

Aloha,
*/Michael Johnson/**
26 HIWALANI LOOP • MAKAWAO HI 96768-8747*• USA
mljohnson.org  • eBible.org  • 
WorldEnglish.Bible  • PNG.Bible 
Signal/Telegram/WhatsApp/Telephone: +1 808-333-6921
Skype: kahunapule • Telegram/Twitter: @kahunapule • Facebook: fb.me/kahunapule 


___
sword-devel mailing list: sword-devel@crosswire.org
http://crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page