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.
Related
I created a project which uses Fragments, and in one of them I want to add some clickable icons that will allow to download a file (one per icon).
I have the files stored on my computer.
I suppose that they have to be copied into my application.
How I can implement this in the code?
I hope that this picture can explain what I want to do.
will allow to download a file and they have to be copied into my application don't match: If the files are already on the device (once your app is installed), what is the sense of downloading those files again?
Therefore, either provide your files inside your app or use a file server and download them.
If you decide to provide the files in your app, this will increase the installation time.
But it would not require an internet connection to download the files again.
So, simply put your files in the raw or in the assets folder and that's all.
Then simply access your files from that folder.
If the folder isn't already found in your project, simply create it and drop your files in it.
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?
Using PhoneGap 3.2 and the File API, I'm downloading a set of images to display in the app. I create a folder named "Appname" and put all the files there. On Android this folder is accessible through the file manager, and on some models the images show up in the users image gallery.
Is it possible to save files locally, but prevent them from showing up to the user outside of the app?
Technically, no. Especially if the client has root access.
You may try the followings to mitigate the problem:
a) Name your files to start with a DOT (.) so that it is recognized as hidden file. (Still, a file manager configured to show hidden files can show it).
b) Store the file instead on some databases in the /data/data/your.app.packages path, which is by default only accessible to your app. (Still a root user can see it).
c) A linux trick. Create a file, open it, hold the file descriptor but remove the file. In this way the file is removed from the directory structure so that it doesn't show up in the FS layer (and thus inaccessible). To make it permanent, use the file descriptor you hold to create a link (or dig into the /proc directory tree to make links with files under fd.
Since this trick works on linux, I guess it should work on Android. But it's probably overkill.
d) Other stopgaps include encryption, obfuscation, etc. But they don't exactly fall into the kind you are looking for.
I have an application for Android built using Flex. I need to save some configurations and data so I want to know how I can access the package-specific folder for my app instead of creating my own folder and writing there.
The package-specific folder I'm talking about is at /sdcard/Android/data/com.mysite.myapp/. Do I just access it directly via that path or is there a variable for File class that I'm not aware of?
The reason why I want to save onto this folder is because, if I create my own folder and save there, that would require my app to request the permission to access SD card contents. Something I don't want to include in my permission list.
For app specific files, you can choose either applicationDirectory (read only), or applicationStorageDirectory.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html
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.