storage

Difference between getExternalStorageDirectory and getExternalStoragePublicDirectory?

☆樱花仙子☆ 提交于 2019-12-11 01:43:28
问题 According to google one returns the primary shared/external storage directory and the other gets a top-level shared/external storage directory for placing files of a particular type. Can anyone explain in simple language and example? 回答1: I am going to assume that you have used a Windows computer sometime in your life. Environment.getExternalStorageDirectory() , if this were Windows, would return C:\ . Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES) , if this were

Ionic storage “get” returns null only on the second call within method

老子叫甜甜 提交于 2019-12-11 00:32:38
问题 I am facing a very strange issue with Ionic Storage. I have a method that reads a value from the storage and returns an a promise containing an object corresponding to that: private getAuthorizedOptions(): Promise<RequestOptions> { return this._storage.get('bdAccessToken') .then(v => { console.log("access token: ", v); let token = v; let header = new Headers({ 'Authorization': 'Bearer ' + token }); let ro = new RequestOptions({ headers: header }); let options = new RequestOptions(); if

Greasemonkey + jQuery: using GM_setValue() within an event callback

*爱你&永不变心* 提交于 2019-12-10 19:47:30
问题 I'm trying to set data in long-term storage in a GreaseMonkey script, except that GM_setValue() seems to fail silently: $("a#linkid").click(function() { GM_setValue("foo", 123); // doesn't work, but does not generate error }); GM_setValue("bar", 123); // works properly, value is set 回答1: I think this is a specific Greasemonkey security issue. Please see 0.7.20080121.0 compatibility. GM does not allow user pages to call GreaseMonkey APIs, and that's what you're doing there (you're registering

Storing Scientific Data in a Relational Database

一曲冷凌霜 提交于 2019-12-10 19:16:55
问题 I want to store hierarchical, two-dimensional scientific datasets in a relational database (MySQL or SQLite). Each dataset contains a table of numerical data with an arbitrary number of columns. In addition, each dataset can have one or more children of the same type associated with a given row of its table. Each dataset typically has between 1 and 100 columns and between 1 and 1.000.000 rows. The database should be able to handle many datasets (>1000) and reading/writing of data should be

get removable sd card path in android

社会主义新天地 提交于 2019-12-10 18:48:05
问题 How can i get extSdcard path in android? There are 2 storage, first external storage in which all the phones have it but there is second storage which is called removable storage (micro sdcard). I want to get the path to the micro sdcard in android, how is that possible? 回答1: Starting from KitKat, you have access to a method to get that directory : Context.getExternalFilesDirs() Note that it may return null if the SD card is not mounted or moved during the access. Also, you might need to add

How to get TOTAL memory and internal storage size Android?

旧时模样 提交于 2019-12-10 18:46:39
问题 I'm attempting to get the total memory (RAM) and internal storage size, but every method I have used is reporting it too low. I'm aware the kernel may take up some of it but I need to know how much there is installed in total. For the memory I first just read from /proc/meminfo/ then used the getMemoryInfo . Each of these reported less than the amount of memory installed (700MB instead of 1GB). for the internal storage size I am using Environment.getDataDirectory , getBlockSizeLong and

How are Cassandra's 0.7 Secondary Indexes stored?

£可爱£侵袭症+ 提交于 2019-12-10 16:45:20
问题 We have been using Cassandra 0.6 and now have Column Families with millions of keys. We are interested in using the new Secondary Index feature available in the 0.7 but couldn't find any documentation on how the new index is stored. Is there any disk-space limitation or is the index stored similar to keys in that it's spread over multiple nodes? I've tried combing through the Cassandra site for an answer but to no avail. 回答1: Secondary indexes are stored as Column Families that are not

file.canWrite() says “true” but I can't write on removable storage (kit kat)

核能气质少年 提交于 2019-12-10 16:36:39
问题 I recieve a intent from camera with a photo taken in this path: /storage/extSdCard/DCIM/Camera/photoCaptured.jpg And I want to resize (already does) of the image and overwrite in the same path... I can do it on 2.3, 4.1 and 4.3, but... not in 4.4 so... maybe the problem is the permission on this folder, so I check with this... if( myFile.canWrite() ){ Log.e("myMethodToSave", "you have permission: " + myFile); } else { Log.e("myMethodToSave", "forget it!: " + myFile); } ...and I have

How to store public/private key securely

安稳与你 提交于 2019-12-10 14:48:08
问题 Looking to store public/private key information securely on an iOS device. I know I want to store this in the KeyChain however I am not 100% sure what sort of attributes I need to populate in the SecRecord . I was going to do something like: // private key SecKeyChain.Add(new SecRecord(SecKind.Key) { Accessible = SecAccessible.AlwaysThisDeviceOnly, KeySizeInBits = 512, KeyClass = SecKeyClass.Private, CanSign = true, ValueData = privateKeyValue, Account = publicKeyValue }); Which would store

Do temporary files get deleted even while the app is running?

倾然丶 夕夏残阳落幕 提交于 2019-12-10 14:39:01
问题 Background On android, you can create temporary files as such (link here and here for documentation) : final File temp = File.createTempFile("myFile", ".tmp", context.getCacheDir()); I'm developing an app that uses temporary files and when it's done with them (and on start of the app), it deletes them. The question The documentation says : When the device is low on internal storage space, Android may delete these cache files to recover space. Does it mean that files can get deleted even while