In school (high school), my partner and I are developing an Android tablet application. We were both issued Acer Iconia A500 tablets to use. I need to pull files created by our application on run-time off the device (adb pull), but because they are not rooted, and I wouldn't want to root school property, is there an effective way to remove files from an android device stored in your applications data/data/packagename/ area? We also did try the emulator, but have had numerous different problems with it, and when it does work, it takes about 4-5 minutes to upload an apk to it every time I change code and re-upload it. Any ideas on a good way to get files off a non-rooted device, in this case a database I'm trying to copy from assets, so I can inspect it?
If you have a choice, I'd definitely recommend writing your files to the SD card because that will be a lot easier to view and handle.
If your file must necessarily be written in /data, what you could do is mirror it to the SD card for debugging purposes. So every time you write the file, you also write exactly the same content to the SD card (if the debug flag is on, otherwise no).
If it's a file that is not being created by your code but by other code, what you can do in your app is copy it to the SD card when you detect that it's been changed.
You could use the external storage permission and write to the SD Card instead. Then you can pull them using the regular windows directory when you plug it in. Also, it should not take that long to update your code via the emulator, are you turning the emulator off every time?
Related
I'm having a problem with my users (Android). They delete the app, and their data is gone. They expect it not to be.
Browsing my phone, I see a lot of apps put a folder right off of /internal shared storage. I.E. I click on internal shared storage and there's a bunch of folders for various apps with data in them that doesn't go away if I uninstall the app.
This is what my customers want. This is what will stop them from writing me and accusing me of destroying their data.
How do I get a path to that folder, and what permission do I need to write there?
First off, deleting when the app is gone is how Android works. Anything else is a bug that you should expect to see fixed.
Secondly, you can't put anything right in / anymore. There was a time you could, but that's long since gone.
Third, have you looked into Android Data Backup? https://developer.android.com/guide/topics/data/backup This will work even on a new device, so its a better path forward anyway
I am developing an app which is a graphical book. Every week, a new chapter is being released and the app will be updated. There are basically images that are going to be shown to the user as slides. The user can subscribe and all chapters will be visible to the user (the image sources are offline and embedded inside the APK file). The images are not saved into the internal SD card (like they are not shown in the phone gallery after installing the app).
I am afraid that it is not a safe way to show the content to the users. What if someone just extracts all the images? I am thinking of the solutions below. Please give me the best option to keep my image files secured.
Obfuscating the app (I'm not sure if this works in this case. I know obfuscating helps to change the codes but I'm not sure if it helps to encrypt the images)
Using an online server and let subscribed users download the images (I think this way it might be saved inside the external storage. Anyway after the download the images must be available offline)
Should I encrypt the images by an encryption method?
Let's explore your options one by one
If you obfuscate the app, it can be deobfuscated
If you use an online server, the images will be downloaded, you can manage to store the downloaded images into the memory instead of the disk and then show directly from memory.
If you encrypt the images, you need to have some decryption method/key implemented in the app, which can be retrieved and bingo,
the user can have decrypted images.
So if downloading the images from an online service will not break your business requirement, then go ahead with that.
Remember that, in any of the cases, if one is determined to save the images, he/she can.
You may need to have multiple methods in place to make it harder for those, seeking to save it.
I want to create an paid app which has a file which can be downloaded.If users buys my application and downloads the file.I want disable the user from transferring that file any other device.Some kind of Cyptography i guess.I have searched everywhere but no luck.Please guys help me to achieve that.
You would either have to hack the Android operating system in order to do that, or you would need to make a program that keeps checking what eachfile the user opens is.
I've got an app that stores few files on sd card. I want my app to remove those files, if user wants to delete the application. How can I do that? Is there a method like onDelete() or something?
I've got an app that stores few files on sd card. I want my app to
remove those files,
Don't store them directly on the sdcard. Use the app's cache space or the directory pointed by getExternalFilesDir. Both are cleaned up by the system when the app is uninstalled
No, there is no way for you app to know when it is being deleted/removed from a device.
Intent.ACTION_PACKAGE_REMOVED
Broadcast Action: An existing application package has been removed from the device.
The data contains the name of the package. The package that is being installed does not receive this Intent.
This comes mostly because if a code would be executed on the app that was about to be removed some might prevent removal etc.
You should provide an option to your users to wipe sdcard data, or use another storage option (that is linked to your app), but I guess you're using the sdcard on purpose.
My app is used in my job to make sales.
This app can remotely update itself (not using Google play), update its data, send information, etc...
In some point, the app reads a heavy catalog of images (several hundreds of MB). To avoid download this data, a micro SD card with all the images has been included in each device.
To read the images in the SD Card I use "Environment.getExternalStorageDirectory()". Until today everything worked ok.
However, the new devices are GalaxyTab 7 Plus, they are very cool machines, but when I use "Environment.getExternalStorageDirectory()" I got the internal SD path. The tablet recognized the External SD card (as "extSdCard") but I don't know how to access it.
I tried with the "vold.fstab" file (following the answer to this question How could i get the correct external storage on Samsung and all other devices?) but I don't trust too much... I mean... is this thing valid? I checked the vold.fstab from a GalaxyTab 10 with android 3.0 and a GalaxyTab 7 Plus with android 4.0 and they are pretty different...
So, in short:
I always want get the external SD card path and if this does not exist, then get the internal SD card path (if exists). I can't do this because java don't let me choose between then when I use "Environment.getExternalStorageDirectory()"
Thanks!
The Android SDK, at least through 4.1, does not support the notion of multiple points of external storage. Hence, there is no documented and supported means for you to get to this secondary card from a directory standpoint.
The contents of that card may be indexed by the MediaStore, through proprietary extensions added by the device manufacturer. Every device that has an external SD card that I have tried appears to do this. Hence, if there is a way you can somehow adjust your logic to not worry about where the files are, but instead to find them via MediaStore, that should work across devices.
Beyond that, you're stuck with guessing games, per some of the answers on the question that you linked to.