browse sqlite database from device - java

I need help to create an android application as I completely new to android.
I want to develop an application which will be able to perform database related operations on my android phone using that application.like it should allow user to see how many databases are there in my device.
when I select database,tables should display on my device and allow user to perform insert, delete, update operations. And also allow user to create new database.anybody is there to help me ? thanks .

Databases are application-specific in Android. One app can't touch the database of other app hence you cannot retrieve ALL the databases present in the system.(And i guess you shouldn't do that too) An android app can manipulate only its own database (There is something called as content-provider to use other app's database but other app should permit to do so).
Hence,you will not be able to create your desired application which you have mentioned.

user cant able to see database from device... so you have to get data from database programmatically and then inflate all data from database in to your application so that user can able to see the data which is resides in DATABASE

Related

Do I need a server to send PDFs created in my app to the same app (different account) on another device?

Beginner here.
I'm creating an app in Android Studio (Java) where the user can create and store PDFs on the app and send these to another account on the same app, on a different device.
The user will have a list of contacts stored in a database.
Do I need a server to do this? Are there any tutorials online showing one how to code this? (I've been searching for hours but can't find anything specific to my problem. Maybe I'm wording it wrong...)
I was looking into Firebase but I'm completely lost on where to start.
Thanks!
For simple use cases you don't need a server, you can use firebase instead. Currently, they have a storage feature that lets you store files on their servers and retrieve them later.
Here is the official documentation firebase cloud storage
One thing you could do is upload the file from android device and download from another one.

How to create an online database for an android app?

How can I make an online database for an android app?
I am making an android app about the impressive speech and I want to make a database storing accounts of users so they can retrieve their progress anytime anywhere. But how can I make it online so it is accessible from every device?
You have to use a service such as Firebase or write a backend-server which runs a database (for example using Spring Boot and a simple H2 database would solve it).
the best solution for your problem is to use Firebase and especially Firebase Database.
Another solution is to use Parse Server.

Update database on server when app is being uninstalled

I know there might be many questions like my question. But It is different. Actually, I am making a static chart that will show how many devices currently having my Android app installed and how many devices have uninstalled it.
For this, I am creating a uniqueID when the app is installed on a device and saving uniqueID along with FCM token to SQL database on the server.
To Create uniqueID:
uniqueID = UUID.randomUUID().toString()
Now, while I am saving every device with a token and uniqueID to the database. Of course, the device will be considered to have active app installation even when uninstalled the app.
So, I want to add a field in the database as inactive against the device that has uninstalled the app. To achieve this, I am thinking to send a request to the database and update the information when the app uninstallation is triggered.
Is this possible? And if yes, then can anyone please tell me how. Or are there any other method to achieve this. Thanks in advance.
Yes it it possible. You can send a push notification to your app to all your active users everyday from your backend side, and on your Android side, call an API on your server to confirm that you exist. If a client does not confirm his existence in a period of time (like 3 days), you know they have uninstalled the app. This is what Adjust and other statistics do for uninstall statistics.
You can't easily run your own code when an app is uninstalled. It is possible to run code in another app, but that requires that you get the user to install both apps.
In addition to the approach Adib described, you can consider using Google Analytics for Firebase to detect uninstalls of your app by Android users. As shown in the answer to this question, Firebase automatically tracks uninstalls in that case.
Maybe you want to use Firebase Analytics and the event app_remove. Mark it as a conversion and use Functions to remove the user from your Firebase Project(if anonymous) and/or any other data associated with the user(Storage, Database, Firestore, etc.) or anything else you might want to do upon user removal of the app.

Are multiple Firebase Database Child/Value Listeners efficient for mobile app?

I've been reading about Firebase Realtime Database for a while now I'm just wondering about the whole idea of event-driven data fetching from database. If data is downloaded from the database only when there was a change made to it, then it should be much less demanding on the device resources like battery or Internet connection. I thought I could remap the whole database fragment I need in my Android activity with my model objects that reflect the structure of my database and update its values with Child/Value listeners. Then I would have the whole data I need in a flexible form of POJOs and it would update every time there was a change in the database. So it is actually a real-time solution. But I wonder if such number of listeners would slow down or overload user's device in any terms like battery life or data transfer.
So, would It be a good solution to reflect database state in my Java model objects or should I go another way?
Could anyone resolve my doubts?
Thanks!
The listeners are triggered only when something is changed in the database. So you get data only when needed. It is expected that your app will lose their socket connections when there is no visible activity. That's the way the Firebase SDK works. Also, Android will aggressively pause background applications so they don't consume data and battery when the user isn't actively using it.
When you restart an activity for example, the Firebase SDK attempts to restore the websocket that it uses to communicate with the server. This websocket is fully managed by the SDK.
Hope it helps.
Firebase.addvalueeventlistener() only work when there is any change or update in database you are requesting. And it is a good way to move with JAVA objects or you can also use HashMaps<>.
As far as there is concern for device battery and performance then instead of requesting whole database you try to get only that part whose change event you wanna track.
And if you also want to have grabbing data on background as Whatsapp you can you Broadcast Receiver for internet and startservice() for where Firebase.addvalueeventListener() used.

Android | RESTful + (SyncAdapter or AsynTask)

I am building an application that will communicate with a server through a RESTful api and I'm not sure which one to use (SyncAdapter/Asyntask).
Basically, I have to update my SQLite database everytime the user logs in (in fact, I believe I could do without the SQLite dabase as the data in the Sever DB is very volatile and changes quickly). (the app would be holding on to old data)
Right now, I'm just saving data on local variables (arraylists) I don't mind then getting lost when the user leaves the app. Also, I'm making http requests using an Asyntask. Is this a good approach? I'm not really sure.
Is SyncAdapter a good fit for my use case? Should I use a SQLlite DB? despite the fact that I don't want to persist data in my app.
Thank you

Categories

Resources