My application records some data from a sensor of my phone, and it store the data to a file in the application's directory.
I run my application under the debug mode. And I was trying to find the application's folder and open the file with the saved data. However, I was not able to even find the app's folder.In the log information, it said the app's location is
" '/data/app/myAppPackage.apk' (success) ---"
but I can not find it anywhere by browsing the phone's disk.
Any hints?
thx in advance
From my understanding you will not be able to view this data on the mobile device. When you test the app in eclipse you will be able to see in the applications folder the new data sets, But on your phone, it is encapsulated by the APK.
Try saving the values to sd card?
Related
For my app I want to send the user a text file of data on an e-mail which they save in the download folder on their Android device.
The app will then pull the data from that file and use it in the app. In the desktop version URLLoader works fine with the file copied into the app source directory, but that method does not work on an Android device.
Storage permission is set.
I have tried using the Filestream method and manually copying the file into the app directory on the device, but that does not seem to work.
Ideally I want to be able to set path for the file to the device's download folder so that the user experience is as simple as it can be.
And before you ask, usage will be on wifi only tablets with questionable wifi access - sending e-mails with the file upfront is the only reliable way to handle this.
Thanks for any suggestions.
Adam
In mobile devices the File.applicationDirectory , is a read only folder, try to use File.applicationStorageDirectory
https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html#applicationDirectory
https://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7fe4.html
Can anyone confirm that the documents directory file storage method with Flutter is secure or whether the AppData directory is where/how Android stores its Internal Storage files?
I'm looking at storing some persistent local data on the device but I want to make sure the data I write is not plain text or accessible by anyone/anything else. If this was a regular Android application, I'd be using Android's Internal Storage which says data stored is "private to your application and other applications cannot access them (nor can the user). When the user uninstalls your application, these files are removed."
Flutter has its own platform-agnostic way to read and write files and its documentation says saving things to its documents directory stores files "only it can access. The system clears the directory only when the app is deleted. On iOS, this corresponds to NSDocumentsDirectory. On Android, this is the AppData directory."
It looks like these are talking about the same thing and would therefore meet my security criteria, but these are things I'm not very familiar with and I don't want to take a risk with my users' data. I tried googling to find out what gets saved in the "AppData" directory on Android but mostly found people talking about their Android Studio installations.
Yes, NSDocumentDirectory on iOS and AppData on Android are secure locations.
This line from the example gives you the correct path for storing files which can only be accessed by your app:
String dir = (await PathProvider.getApplicationDocumentsDirectory()).path;
On Android dir resolves/data/data/com.yourcompany.AppName/. On iOS devices the folder is /var/mobile/Containers/Data/APP_ID/Documents.
Check the Android Security Tips , the section on Internal Storage:
By default, files that you create on internal storage are accessible
only to your app. Android implements this protection, and it's
sufficient for most applications.
The exception here is that when your app runs on a rooted Android device, the app data folder is not secure any more, see https://stackoverflow.com/a/8184699.
How to find junk files in android. I don't want someone to code for me.
I just want to know how could i know whether a file is junk or not.
Or what are the criteria for checking a junk files. Or where must be
junk files stored .As in windows some files are stored in TEMPDATA and some data is stored in APPDATA. Where does android store these files.
And when can i delete these files. These can be shared by some
app.How could i know whether to delete it or not.
As this app does.
Due to the security mode in each Android app runs in its own sandbox. Temporary or junk files created by the app are stored in the apps own data folder located at:
storage/data/data/apppackagename
There may be any kind of file stored in this location including databases and preferences for the app.
This system allows android to remove the files easily when the app is uninstalled, or when the user goes to android settings for the app and selects clear data.
On non-rooted devices no other apps will have access to this folder.
It is possible for an app to write a file to the to external storage on the device. These files will persist after the app has been uninstalled, but you will have no way of knowing where the file has come from and if it is still needed.
How to make folder and files that consists of database in .TXT and .XML appear after installation?
I know it was silly question, but I am creating an offline application using SQLite Database. If user submits the data from apps (e.g: insert to do list, create purchase order), the data will be saved and then TXT file is generated.
This .txt has role as database. The apps will get new data from .txt they recieve via email / cable data and upload .txt users generate to email. This feature is really important, so how to make those files appear in file directory? They have to be seen in order to do so.
Beside that, when I installed my apps I cant find my package folder installed. Though I did install my application from file explorer. I know that I can do it with USB Driver, but my PC couldnt update USBDriver to the phone since it said that my current one was newer. So I had to install it using package installer in my files.
I am very new in learning Android, so I hope you wouldn't mind to tell me what I need to do in my code.. Thanks.
my related previous question: Cant generate folders contains Offline Database after Android APK installation
I have a document file stored in my application's data folder, which is a kind of private folder to the application. It is a .doc file. I have doc viewer application installed in the device. Now, how can I open the file with the Action_view intent. As the viewer application can't access file stored in my application data folder, it is throwing an error saying file can't be accessed. I have no interest to copy the file to phone public folders like sdcard. Is there anyway to open that doc file. Any clue on embeded apk in android.
Thanks & regards,
Suman
You can't do this directly. Either copy the file temporarily to the SD card (external storage) or set permission temporarily to WORLD_READABLE. There are no embedded APKs in Android, but if the viewer is available as library you can include it in your app. Of course the problem with changing permissions temporarily is that you don't really get notified when the user has finished viewing it, etc.
The whole thing begs the question: why is it a private file if it needs to be viewed by third party applications? If it is meant for the user of the device, there is not much point in hiding it from them...