storage

Android Storage Locations

♀尐吖头ヾ 提交于 2019-11-29 14:11:15
Can someone explain in detail about the various storage locations in Android, /sdcard/ (along with /root/ directory and other system-level directory) /storage/emulated/0/ /storage/emulated/legacy/ /storage/sdcard0/ Really confused with these? And are there any methods to access them programatically whenever needed? AnV I can't speak for storage paths on all phones. But I can explain you clearly with respect to my phone; Coolpad Note 3 - running on Android 5.1. Because, the storage locations or paths may vary on other mobile phones depending on your vendor/manufacturer and different versions of

How to save an object with circular references?

不羁的心 提交于 2019-11-29 14:04:52
I want to save locally an object which has circular references. What are my options? My first thought was using HTML5 local storage but I can't stringify this object due to the circular references. Specifically I'm trying to save the DOMSelection object of the current selection. Example: var sel = window.getSelection(); var selstring = JSON.stringify(sel); // Breaks here ... localStorage.setItem("selection",selstring); The only way I could get the stringify to work now is by ignoring certain objects like so: var selstring = JSON.stringify(sel,function(k,v){ if( k=="anchorNode" || k=="baseNode"

Using osmdroid without getting access to external storage

荒凉一梦 提交于 2019-11-29 13:53:23
In my app I am using osmdroid for working with map. Map tiles are downloaded and kept in /storage/osmdroid . The application requires permissions WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE . If I deny access to storage, map is not shown. Is any way to show map without access to phone memory? https://github.com/osmdroid/osmdroid/wiki/FAQ Fresh off the wiki press. Yes you can change the location to application private storage, in which case it should work just fine. Pro tip: set these before loading any map views. OpenStreetMapTileProviderConstants.setCachePath(...)

saving pictures taken by camera in android app

ぐ巨炮叔叔 提交于 2019-11-29 12:52:28
I have been stuck on this for a while now and have looked at various tutorials for help but have not yet succeeded. I have essentially utilised the camera function in my app to take pictures and display a preview of it BUT it can't save taken picture. Here is the java code containing my attempt to get it functioning according to tutorials: public class Activity_Camera extends Activity implements View.OnClickListener { ImageButton ib; ImageView iv; Intent i; public static final int cameraData = 0; Bitmap bmp; @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R

2.23: Apps must follow the iOS Data Storage Guidelines or they will be rejected [closed]

社会主义新天地 提交于 2019-11-29 12:45:06
问题 By uploading the app to the app store have given me this error. 2.23: Apps must follow the iOS Data Storage Guidelines or They Will be rejected I've been watching what is wrong is that one of the files I'm using does not meet the storage requirements. To be more specific it is a sqlite for loading maps offlines mode with route-me library. I am using sqlite for loading map in offline mode, it seems that this map is stored as backup in iCloud, so I'm skipping storage restrictions. Do not know

App's path for external storage in native code

只愿长相守 提交于 2019-11-29 12:06:47
I am trying to write a native library for my application so that i can do all file operation in the native code. I read that getExternalStorageDirectory() give the path of the external storage of directory. My question is how can i access the same without hard-coding the location to some string? Is there any function in android ndk that can give the same function as getExternalStorageDirectory() of java in C++ code? JNI is your friend, and this isn't too complicated, as getExternalStorageDirectory is a static method. This function gets the value, and changes the working directory to it, for

can't create a folder in external storage on android device

梦想的初衷 提交于 2019-11-29 11:57:52
I am trying to create a folder in external storage and I followed a couple of other threads here. However, even though I seem to be doing what they indicate, creation fails. Here's a piece of code boolean mExternalStorageAvailable = false; boolean mExternalStorageWriteable = false; String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { mExternalStorageAvailable = true; mExternalStorageWriteable = true; } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) { mExternalStorageAvailable = true; mExternalStorageWriteable = false; } else {

Read an ArrayList from Internal Storage

走远了吗. 提交于 2019-11-29 08:44:45
I have an Android application and I would like to read and write an ArrayList<MyClass> to the Internal Storage. The writing part works (I believe, haven't tested it yet :-) ) : ArrayList<MyClass> aList; public void saveToInternalStorage() { try { FileOutputStream fos = ctx.openFileOutput(STORAGE_FILENAME, Context.MODE_PRIVATE); fos.write(aList.toString().getBytes()); fos.close(); } catch (Exception e) { Log.e("InternalStorage", e.getMessage()); } } But what I want to do now is read the whole ArrayList from the Storage and return it as an ArrayList like so: public ArrayList<MyClass>

Options-enabled content-script Chrome extension without background page?

非 Y 不嫁゛ 提交于 2019-11-29 08:18:13
I'm making a content script extension for Google Chrome, it adds functionality to a website's page. I want to add a couple of options, not big deal really, I'd just need two strings (none of which are sensitive user data). From this answer , I assume I need a background page, which I'd rather not add to my extension - I don't want it to gain unnecessary weight. Do I really need a background page, or I could have an options page without it (and which storage could I use)? UPDATE As of Chrome 20 you can now use the Storage api..... http://code.google.com/chrome/extensions/storage.html Old way

Best way to store data for your game? (Images, maps, and such)

半世苍凉 提交于 2019-11-29 07:32:34
I'm creating a basic 2D game (well a game engine) and I've currently been developing the file formats for my data. Of course, for this game to run, I will need cache. I find it quite unprofessional to leave all the data for the game to not be in a single file (well not necessarily, as long as the files are in a cache format of some kind). So that's why I've came here to ask. I was thinking of doing a zip file but I feel like that isn't the best way at all. I was also thinking of doing another binary writer which will have headers (type of file, "location") and an enclosing tag for each of the