Accessing SQLite from another device - android

Background:
I don't have any knowledge in Android. I want to develop an app with 2 forms, one is to take customer data and one is to search the data. I can do this app in web or in Jface/SWT but just want to check feasibility of writing it in Android.
Problem statement:
Can we create an app in Android like mentioned above with SQLLite DB? but the data should be accessible from another android device with same app. i.e. my DB will be hosted on one Android device and I should be able to access that from another device also. The architecture is shown in below image.
Can we do something like this in android?

So I have two ways to do that:
Conver your csv file to db or sqlite using SQLite Database Browser and than paste this file into your assets folder of your project and than on create of your Application or Activity write it in the Data folder/directory of your app property and so that you can get your Database on each device.
If it does not help follow this one:
https://www.b4x.com/android/forum/threads/remote-database-connector-rdc-connect-to-any-remote-db.31540/

Related

Android save custom data in APK

I have developed (Offline) Android app in which i have to save some employee's data into Local SQLITE database, when i send the apk into another andoird phone the data in the database dose not appear due to local storage of both the devices is different.
My goal is to send the data with the apk file to who ever i send the apk. How can i achieve the goal ?
The problem is i do not have the idea of how to do it, or never have done this kind of project before.
Please guide me.
If Your database is read only - You can use raw folder of project for Your SQLite database file, than, after .apk was installed, copy it, for example to external storage. But if You need changes in database and synchronized data on all devices - You should use only one server-side database.

can we identify in the mob app what are the database is using?

I dont know how to ask this question, I know sqlite exists on every android system and I understand how to work with sqlite database
My question , can I know what are the database and tables any mobile application is using in my sqlite android. lets say facebook app using sqlite in my android , can I know what are the tables is using ?
for that you have to root your android device then you will be able to fetch all the applications data in your phone. all the applications are located under /data/data/ directory

custom database into project

I have finished the notepad tutorial on the android site. I did this because i want to create a DB for my app. Once i finished i found out where the data is located in the DDMS. Then..
I downloaded the SQLite browser database i created a mini DB. Know i am trying to put this data into my project.
Can i put this new saved database file(i made with browser)into the notepad database file & and delete the old one. So when the emulator loads it will load my data.
Because i made a database with android notepad with all the code etc. with this SQLite browser i am thinking the code is done for me(table, columns,)
I guess am asking you is can i just make a full database with sql browser and just input it so how in my project.
Your database class needs to be specifc to your database, so you cannot just change databases on the back end and expect the handler class you wrote for the notepad tutorial on the front end to work properly with it.
That being said, you can create a handler to run your custom db. It's rather round-a-bout though. After you get the helper class created, you have to put your db into the assets folder. In your db helper you need code to copy the file out of assets to it's proper home in your applications data directory.
You can find instructions on how to set up your database so the Android framework can use it properly as well as code for copying it out of assets to your data directory here.

How to distribute Android app with DB data?

I'm writing my first serious Android App, which basically is interface to three DB tables.
Data in those tables are predefined by me, so, user should install those app with those data.
What is the best way to include those data in application package? Maybe there is a way to embed SQLite into my application distribution?
Or is the only way is to define array of "insert into" strings somewhere in class and execute them to fill internal SQLite storage?
Would appreciate any recommendations.
I am currently doing the same thing in my app. Having a sqlite database file in my assets folder and copying it into the SD card at startup if it's not in there. There's a nice tutorial there and I use part of its code.
Put the database file in your assets and then copy it over to your application's data directory.
Your can check out this tutorial

how to open Iphone's database(created) in Android?

Database is created in Iphone using SQLite.Now I want to use same database file in Android and insert the data into tables.How to do that?
Android Developer
The easiest way is to copy the file in your applications folder say assets folder and copy the database from the local file, first time the app is loading.
this link will give you a solution.

Categories

Resources