I am developing an app for University.
I have bought a Nexus 7 google tablet for the task (I wanted a tablet anyway :P)
I need to convert data I record on the app onto a text file that can be moved onto a PC.. Now, from what I can tell android has high security on 'Internal Storage' which is the only type of storage the Nexus 7 has, and I cant seem to be able to write a text file to a folder or anything.. and I can't even find the app's data folder on the windows explorer so I presume its hidden..
It appears its possible with 'External Storage' such as an SD card but the Nexus 7 does not have an SD card slot..
what should I do? Is it possible to be done on the Nexus 7?
All Android devices have "external storage" regardless whether or not they have SD card support (http://developer.android.com/guide/topics/data/data-storage.html#filesExternal). The naming is unfortunately misleading.
If you save your data to app's default external storage, you can access them on a PC in /Android/Data/[your app's package name]/files
Related
I created an Android app sometime ago. What the app does is basically download a list of files (images and videos) and play them in a loop (like a Playlist).
These files are saved in the default Android External Storage Directory. I get it using this method:
Environment.getExternalStorageDirectory().getAbsolutePath();
Until now I never had storage problems but testing the app on an old device (which has less storage capacity) I realised that I have a problem when the files (PlayList) size is bigger than the device storage capacity.
I have thought (and research) about using an USB stick, but I don't think that would be a good solution since I cannot know 100% sure the USB path (it can be different for each device).
Any ideas about how handle this problem? Maybe another solution instead of using the USB ?
Here is what I have researched:
How to access USB Path in android?
How to find USB storage path programmatically?
android How to write files to a usb memory?
Do you need to store the actual images and videos on the device - why not just store their location and get them dynamically. I've not used a recyclerView but I thought that it could do something like this, but could be wrong.
I am taking an Android app and making it run on Chrome using the ARC Welder. For best results we're only targeting the Chromebook / Chrome OS, not Windows or OSX.
The app is running with some minor glitches, but I need to enumerate photos on an inserted SD card.
The problem is that the /mnt folder accessible within Android Runtime only contains the virual sdcard folder, and does not reflect the real SD Card or USB Flash Drives attached to the Chromebook.
How can these photos be automatically loaded from the SD Card into the Android App in the Android Runtime.
I know that I could use a CRX (Chrome Extension) to read the SD Card photos, but how could they be passed to the Android app? And can this be in the same CRX as the ARC Welder creates or must it be a separate CRX?
I found a workaround which is to use the Additional Metadata section and add
{ "enableExternalDirectory": true }.
When the app first launches, it prompts the user for the folder. One must select the SD card.
Then my app works as expected, as the 'emulated sd card' becomes the 'real sd card'. This is not the most user-friendly approach, but it works.
I'd still prefer if we could load the files from a CRX into the Android Runtime...
The Problem
My app supports 4.0+ and it is all about file handling. It works perfectly in all Android versions except Kitkat.
In Kitkat, my app is unable to modify or write any files in SD card. But I see various apps like,
1) Solid Explorer
2) ES File Explorer
3) CamScanner
4) UC Browser
All of these apps give write access to SD card even in Kitkat devices without even root access.
Requirements
I need to have a fully functional way to create or modify files stored in the SD card in Kitkat. I seems to have troubles a lot of users and a proper solution will help many developers like me.
Yeah I came across that problem as well. After a lot of reading across the web the solution is to write only in your app folder (Ex: /sdcard/Android/data/packagename).
About those apps, on my s4 mini, es explorer cannot delete from external sdcard, so I think is different from device to device.
If the devices is routed change the permissions to gain write access anywhere on the sdcard.
My app records voice and a user complains that he is not able to save the recordings on the external SD card (android 4.4.2).
I know the problem with the KITKAT and I work to adjust this, but until then I want a workaround.
I've instructed him to create a folder on ext. sd card: "extSDcard mount name"/Android/data/myAppPackage/files (using the PC connection) and then to go the app and select the recordings dir to point out to the location above He's telling me isn't working this way...I wonder why, since the path is the app private one?
Is there any solution until I will came up with a new app update?
I am having very Strange problem with my Samsung Nexus with Android 4.0.2. I wrote a simple program which basically create file each time user presses a button. My program is working great on other devices where as on Galaxy Nexus Windows/Mac can not see those files on SD card, but when i do adb shell i see all files on SD Card.
I retest this on another Nexus which has Android 4.0.4 but still same result.
What could be the reason?
You probably need to index your files via MediaScannerConnection. Quoting myself from a blog post from last year:
...the MTP contents are not based on the literal contents of external storage. Instead, MTP contents are based on what files have been scanned by MediaScannerConnection. If you write a file to external storage, until and unless that file is scanned by MediaScannerConnection, it will not be visible to users over MTP.
External storage is scanned on a reboot and possibly on a periodic basis. Users can manually force a scan via utilities like SDRescan. However, the best answer is for you to use scanFile() on MediaScannerConnection to update the media database after you close your file. This will make your file immediately available to the user.