I have an app that allows exporting files to a non-standard folder on the device's file system.
I put the exports in a folder separate from the application data, because I want the user to be able to navigate to the files using a file-system explorer, and the application data folders/files are not accessible that way.
However, when the application is uninstalled, those non-application-data folders, the folders separate from the application-data file structure, are left behind.
Is there anyway to call an uninstall script, and if so, how is the script called/executed when uninstalling through Android Market or through the device's uninstall in the settings for 'Manage Applications'?
Intent.ACTION_UNINSTALL_PACKAGE
I believe this should work for you. Unfortunately, it's for API 14. I don't know it that falls into your needs.
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
In the app I was helping developing, the users seen that each time they use apps like CM Security to clean 'junk', the files inside the folder associated with the app were instead considered as 'junk' and are deleted.
The app itself would create the folder in the C side of the code instead of using Java.
Firstly, when the app is first launched, custom C code will check if the app folder (e.g. 'Game') exists. If it doesn't, it makes it (regardless of OS. The app is cross-platform, sorry I forgot to say it.) It puts it in the external SD card ('sdcard/'). When it's seen, it can now run the app.
I get about the getFilesDir, but since the directory is made using C code and not through the java activity, it doesn't count as its app directory.
Is there a way to link the folder to the Android code so that it would be recognized as the app folder?
I have created an Android Application that should be used in different social environments (shops, airports, etc.)
Each of those wants their own profile (their own background, button colours,etc.). I recieved .bak files which hold this Profile`s, but I need to somehow include them inside the Application Folder, so that they get detected.
I cannot find the Application Folder on my Computer, when I connect my Android Device to it via USB cable (so that I can copy / paste the .bak to that folder). Can anyone help me out here?
You can access your app folder like this
getContext().getExternalFilesDir(null).getAbsolutePath()
For using permissions WRITE_EXTERNAL_STORAGE and/or READ_EXTERNAL_STORAGE are required.
And for first-time application launch is not better to put your .bak file with profiles to assets, and when apk will start first time copy to app-folder in background? Usually app-folder have path like "sdcard/Android/data/your_app_package_name/files" but if u did not write something to this folder, folder will not be created.
Just out of curiosity, I wanted to know where on the file system of an Android device the application icons are stored.
Like I have shortcuts to various applications on the homescreen of my device, where those icons files (or images) are stored. Is it only inside the application package (.apk) or Android stores it some where else?
If it is in application package only does Android loads all the imagess from each of the apk and loads it when it is started for the first time?
When an app file is installed, the .apk file is analyzed and various items of information are extracted by the launcher. (This process does not involve loading and running the app itself.) Among these items is the app icon, which the launcher typically caches in its own private area. Exactly how this is done depends on the launcher currently active on your device. You might be able to browse through the source for your launcher to find out more details about how it caches these items extracted from the app .apk files, but I'm not sure what practical use there would be to that exercise.
The launcher's use of its own cache greatly speeds up start-up, as otherwise every installed app would have to be scanned at every reboot to extract the requisite information for the launcher to show itself. However, the cache is the source of occasional problems, such as the icon not updating right away when an updated app (with a new icon and possibly a new app name) is installed. (See, for example, this thread and this one.)
Think about what happens when you create your own app. Typically, you create icons for your app for all drawable resource buckets (or at least the ones you want to support). Then these files get packaged with AAPT into the apk with the rest of your project. Then after installing your app, the OS will pick the icon that matches your phone configuration and create a shortcut on your installed apps page.
I want to store music files downloaded from server in my application installation directory. I noticed that several android phones has different path to application installationo directory.
Such as Android/data, data/data and etc.
I develop the application with phoengap. I checked their api but coudnt get a methode that return application installaitn folder path.
Can anybody help me on this?
thanks
Due to security reasons, you cannot write to application install or the assets directory, instead you can write files in application data folder.
http://cordova.apache.org/docs/en/2.9.0/cordova_file_file.md.html