Android Question ContentChooser, ContentResolver, and RDC

tdocs2

Well-Known Member
Licensed User
Longtime User
Greetings, all.

The question may be a foolish one, but it intrigues me...

Can a combination of ContentChooser and ContentResolver replace RDC (see RDC drawback below)

CONTENT CHOOSER AND RESOLVER
1. Content Chooser allows me to select a specific type of content using other installed applications.
*** If the user has installed a file manager then the ContentChooser can be used to select general files.
2. Content Resolver allows me to access "content providers" applications.
***"The features of ContentResolver are similar to SQL features. The main operations are: Query, Insert, Update and Delete.", quote from Erel.

I have ES File Explorer (latest version) in Android installed in all my devices. ES provides access to the LAN, i.e., it shows me the IP addresses of all devices in the LAN.

In my environment, the PC's which share drives and folders appear in this window of ES.

I tested all of this using SQLite Viewer and choosing Open external file manager and was able to view a SQLite data base on my Android device from the PC (it does not behave the same way all the time in different devices - do not know why).

RDC
I have managed to understand and was successful with RDC - SQLite. It is a great feature!
One drawback:
Let's say, I wanted to offer an app single user and multiuser - I would need two sets of SQL commands, one for the local SQLite DB and a corresponding set for Remote Data Base (unless I missed one of the building blocks)...

*****

My purpose in this inquiry is then to have a single set of SQL statements for my app that would point to a local db or a remote db.

*****

Any and all help is welcomed.

Thank you.

Sandy
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You are comparing two different things. ES File Explorer downloaded the database file for you and saved it in a temporary folder. You can do the same thing with SMB library (and there are other ways).

RDC lets you access remote databases.

The question is whether you want to access a local database or a remote database. If you want to access a local database then you don't need RDC. You only need a way to download the database to the device.
 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
You are comparing two different things. ES File Explorer downloaded the database file for you and saved it in a temporary folder. You can do the same thing with SMB library (and there are other ways).

RDC lets you access remote databases.

The question is whether you want to access a local database or a remote database. If you want to access a local database then you don't need RDC. You only need a way to download the database to the device.

Thank you, Erel.

I did not realize that "ES File Explorer downloaded the database file". Indeed I was comparing two different things - "foolish question on my part related to Content Chooser" - as I cautioned at the beginning of the thread.

Although I have been using RDC for a couple of days, I do understand how RDC works - great tool - thank you, indeed! It works quite well - I was able to load, sort, and display 1500 records in less than 2 seconds.

My question is related to SQL coding in an app for a single user vs. multiuser. For a single user environment, I want a local Android based DB so that the user only needs one ANDROID device and does not need to have a "server" device. For a multiuser environment, RDC seems to be the best solution - a "server" and one or multiple ANDROID devices.

To accomplish this, in the same app, it seems that I need two identical sets of DB requests - the single user via local SQL commands and the multiuser using RDC commands. Is this the best way to accomplish this?

Best regards.

Sandy

PS: Obviously, my rationale stems from the Windows environment where SQL is the same in a single or multiuser environment. The application "reads" a table and the resolution of the DB location is determined by the drive mapping.
 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
You definitely don't need to use RDC for your single user solution. Just download the database or distribute it in your APK.

Note that you should be careful with sharing a SQLite database on a network drive on Windows. It can easily lead to database corruption.
Thank you again, Erel.

To accomplish this, in the same app, it seems that I need two identical sets of DB requests - the single user via local SQL commands and the multiuser using RDC commands.

I understand how to do it for single user environment. The question is related to the same app for a single or multi user environment.

Best regards.

Sandy

PS Thank you for the tip on SQLite in A network Windows environment. Good to know. My PS was an illustration to amplify the explanation to my question - sorry about that.
 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
Hello, Erel.

I apologize for seeking clarification on a point from your reply.

Note that you should be careful with sharing a SQLite database on a network drive on Windows. It can easily lead to database corruption.

Is it safe to use SQLite on Windows with RDC without the risk of corruption?

Thank you in advance.

Sandy
 
Upvote 0

tdocs2

Well-Known Member
Licensed User
Longtime User
Thank you, Erel.

I have already set the configuration for RDC per those specifications.

I assume then that if I use SQLite with that configuration for RDC, the data base integrity will not be compromised.

Best regards and thank you again.

Sandy
 
Upvote 0
Top