Android Question Directory /RASPBERRYPI/CartellaCondivisa doesn't exist.

Angelo Messina

Active Member
Licensed User
Longtime User
Hi everyone, I can't access a file located on a Raspberry Pi that I need to update with B4A. I keep getting an error like android.database.sqlite.SQLiteCantOpenDatabaseException: Cannot open database '/RASPBERRYPI/CartellaCondivisa/Fotovoltaico.db' with flags 0x10: Directory /RASPBERRYPI/CartellaCondivisa doesn't exist.

DB.Initialize("//RASPBERRYPI/CartellaCondivisa","Fotovoltaico.db",False)

From Windows, I can see the directory and all its files.
From Android File Manager, I can see the directory and all its files.

B4A Version: 13.40
Java Version: 19

Do you have any advice?
Thanks
 

Cableguy

Expert
Licensed User
Longtime User
You can try to see if you have rights to the folders by testing it's existence....

1755949748889.png
 
Upvote 0

Angelo Messina

Active Member
Licensed User
Longtime User
The problem is that the fotovoltaico.db file is on a Raspberry Pi and I can't update the database because it keeps telling me: Cannot open database '/RASPBERRYPI/CartellaCondivisa/Fotovoltaico.db' with flags 0x10: Directory /RASPBERRYPI/CartellaCondivisa doesn't exist.
However, it does exist and I can update the database even from Windows applications.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I am missing something, I guess... from where are you trying to access the DB, from outside the RaspBerry pi, or from within, as in running your app inside it?
You keep saying that from windows you can access and update the file from windows, and on your first post, you say you need to update it from a B4A app...
So you are trying to access a file from a different device than the one you are running your app from, right?
I think you have a permission issue when accessing from the B4A app (File access is something Google's has made way too complicated).
If you can't get access permission when working from Android, I would suggest you to create a middleware, running inside the Raspberry pi, to which the Android app can connect, and then the B4J app can execute the needed operations.
 
Upvote 0

Angelo Messina

Active Member
Licensed User
Longtime User
Then I'll write Java code for a server that will update the database through get/put/delete. Thanks for everything and for your replies.
 
Upvote 0
Top