I have a question, because when I install app, I create .csv file and it's the most important file for my app. When I use this app I always check is this file exists. I put this file on storage, but when I uninstall this app, this file wasn't removed. It's still exits. So what can I do to remove this file automatically? Thanks for response.
All you need do is to locate the file and delete it manually.
Some apps are built to startup from where you left off, especially apps that have regular updates.
Its just a backup plan.
If you're sure you don't need it anymore, simply locate and delete it.
Related
I created an Android app which is storing some info on the database. I copied .apk file to a folder, clicked on it, it was installed and the app is working. But I cannot find in which folder the app is is located - I want to backup the database. Any ideas?
Thanks,
zb
The app will normally be installed in /data/app directory - it would usually be just the copy of your APK, although not always. The databases, unless you explicitly specified a different location in your code, will be in
/data/data/your.package.name/databases
The package name will be something like com.yourcompany.appname.
Note that backing the data by copying the databases is not the right way to backup your files. Use android backup instead. Also, unless your phone is rooted, you may not be able to get to these databases.
Zalek
Here the location for the app to be searched
MyApp/myapp/build/outputs/apk/myapp-debug.apk
Note: "MyApp" is your project name of your app. I just take an example as myapp
I've created an app using Android Studio and it has a database file handler. I've gone through a few post and everywhere they are saying go to data\data\ folder to get the app folder. But mine doesn't show any folder for my app. Do I have to manually set this file location to be created? How can I find my database.db file?
It should be automatically placed in data/data/databases in your app folder unless you specify otherwise. Are you sure it is created?
That is /data/data/package-name/databases/dbfilename
I have another suggestion. If you have enabled backup for your application, you might be able to use ADB BACKUP, like suggested here: http://blog.shvetsov.com/2012/09/backup-your-android-without-root-or.html
The database files are located in the following folders.
/data/data/packagename/databases/
You can access the .db file only on emulator, its not possible on actual device. In the android studio open the DDMS perspective, there on the left hand side you will find the storage structure, there in data/data/ you will get the file you are looking for
Is it possible to automatically write my own config files upon installation of an APK? How do I do that? I realize this might introduce unwanted bugs as user can change these configs. However, I need this functionality in my Android app. I don't want the application to run first then write the file. What I really want is writing my own config files upon installation. Can anybody give pointers? Thanks.
What I really want is writing my own config files upon installation.
That is not possible. There is no hook in Android to automatically set up some sort of files on internal storage. And, if you are "writing [your] own config files", then by definition, then "the application [will] run first", because your application is where the file-writing code resides.
Configuration files? If its related to the APK of your app then chances are, it is gonna be the run first then write the file. A thing for writing file though is the assets folder that an android project has.
I need to know when a file is deleted from an android device, is it possibile? Are there some intents about the request to delete a file from device or SD?
You can register a file observer for files in some locations (though I've heard rumors this may not work for the simulated "external storage" on some recent versions).
But there is no way to "intercept" as in prevent such deletion, short of modifying the installation of android.
If the file is readable to your app, you could presumably make a backup copy ahead of time.
When I download a apk file I need to first save it before I can install. Is there anyway to dirctly install it without saving? Do I need to make any changes in the AndroidManifest.xml?
It think what manifest file hasn't any power here. It is up to OS to do this. And it think (as a user) what download must not lead to auto installation of downloaded program.
AFAIK, an app is not extracted when it is installed, but the whole APK reacts as the self contained application. Thus, you must keep the APK in order to use the application. And if you're keeping it, then downloading it is the only option.