پایگاه داده SQLite را بین 2 دستگاه به اشتراک بگذارید
این فقط اثبات مفهومی است که نشان میدهد دستگاه A مانند سروری است که یک پایگاه داده را میزبانی میکند و دستگاه B با دسترسی به پایگاه داده مشترک به آن متصل میشود. پاسخی به این سوال است .
دستگاه A - سرور (شامل پایگاه داده)
دستگاه B - سرویس گیرنده (پایگاه داده ندارد)
ایده با پیاده سازی مثال شبکه با استفاده از AsyncStreams و B4XSerializator است که در اینجا توضیح داده شده است .
برای کامپایل سرور از پیکربندی ساخت سرور استفاده کنید.
برای کامپایل کردن کلاینت، از پیکربندی ساخت «پیشفرض» استفاده کنید.
در برنامه مشتری، IP سرور را برای اتصال وارد کنید.
شما همچنین می توانید با B4J تست کنید.
برگردان مستقیم از سایت مرجع
Share SQLite database between 2 devices
This is just a proof of concept to show that Device A behave like a server hosting a database and Device B connects to it accessing the "shared" database. It is a response to this question.
Device A - Server (contains database)
Device B - Client (does not have database)
The idea is by implementing the Network example using AsyncStreams and B4XSerializator as explained here.
Use "Server" build configuration to compile the server.
Use "Default" build configuration to compile the client.
In client app, enter the server's IP to connect to.
You can also test with B4J.
Device A - Server (contains database)
Device B - Client (does not have database)
The idea is by implementing the Network example using AsyncStreams and B4XSerializator as explained here.
Use "Server" build configuration to compile the server.
Use "Default" build configuration to compile the client.
In client app, enter the server's IP to connect to.
You can also test with B4J.