Android Question app runs smooth in debug but crashes in runtime

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
hi,

i'm facing an odd behavior with my app
when running in debug mode it runs perfectly
when trying to run it in runtime it crashes

edit:
my app is using download directory
it asks for permission and in debug it all runs smoothly

i'm not sure it is related to this feature
maybe i will try to comment the entire part of read/write to download and see what happens
i mention this as i read somewhere that there's a problem with accessing download folder etc...

does this make any sense?
any solution?
 
Last edited:

Sagenut

Expert
Licensed User
Longtime User
I would start posting an example project if possible, but for sure at least the Errors Log.
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
How does it possible that the app runs in debug but crash in runtime?
I don't want to write a stupidity, but I think to remember that Debug Mode enable some Permissions by itself.
But this Permissions then needs to be asked correctly in Release Mode.
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
I don't want to write a stupidity, but I think to remember that Debug Mode enable some Permissions by itself.
But this Permissions then needs to be asked correctly in Release Mode.
Thanks, I see.
Is there any simple example I can see for external_storage permission request?
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
It will be a personal app or it will go on the Play Store?
If it's for personal use I think that setting
B4X:
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
in the Manifest will solve many problems.
But you can take a look here
B4X:
https://www.b4x.com/android/forum/threads/externalstorage-access-sd-cards-and-usb-sticks.90238/
It must be on Google play store
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
OK, managed to solve the problem - I followed Johan's advice from last time and now I got the app running smoothly in runtime as in debug.

The only question now is will it load to play store?
I ask for write_external_memory permission - is that something Google allows?

Thanks
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Oh that's bad
So what's the solution?
How can I get such permission? Or alternatively bypass it?
I can't take my users to private download and installation with permissions they do not know
That's bad

Is there a folder (any folder will do as I just want to share data between my 2 apps) that I can access 'freely'?
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Perhaps you could use External Storage. It can access a folder in main memory as well.
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Perhaps you could use External Storage. It can access a folder in main memory as well.
Exactly what I want, I don't need download folder and any other will do as long as I can access it from my 2 apps. This is critical as I need to share data between then

Any suggestion?
Or just create a folder with name I choose that will be 'neighbor' to download, I see many other apps that create such folders for their use

The question is Google play - will they let me do it or block it?
Do they specifically block aceess to download?
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
OK, great
So I will either create a sub folder under download or even better a specific folder for my use

Thank you so much for this advise
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
OK, great
So I will either create a sub folder under download or even better a specific folder for my use

Thank you so much for this advise
Pal, that worked like charm - thank you!

now last question if i may

for some reason the apk name is result.apk
when install it it is all ok and the app name is correct - it is only the apk filename
i forgot where i set this - so where do i set the apk name to be what i want or it is not relevant?

once again - many thanks
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
The name of the app that you set in Activity Main must be without blank spaces, otherwise you will get result.apk
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
The name of the app that you set in Activity Main must be without blank spaces, otherwise you will get result.apk
my app's name has no spaces...
still the apk's name is result.apk


B4X:
#Region  Project Attributes
    #ApplicationLabel: XXX_YYYzzz
    #VersionCode: 1
    #VersionName:
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

another app that i have do have spaces in the name and the apk's name is perfect
 
Upvote 0
Top