storage

Saving ORB feature vectors using OpenCV4Android (java API)

六眼飞鱼酱① 提交于 2019-12-18 15:54:35
问题 I have a training set of images, for each of which I've detected and computed their feature vectors (using ORB feature descriptors and extractors. The questions is : since I need to save those features to reutilise them for matching against test images (using SVM classifier); what is the best way to store the feature vectors, locally on the Android device? The feature vectors to be saved are of variable size per image, and are thus those with non-maximal sizes are padded with zeros to unify

Python Storing Data

六月ゝ 毕业季﹏ 提交于 2019-12-18 14:51:53
问题 I have a list in my program. I have a function to append to the list, unfortunately when you close the program the thing you added goes away and the list goes back to the beginning. Is there any way that I can store the data so the user can re-open the program and the list is at its full. 回答1: You can make a database and save them, the only way is this. A database with SQLITE or a .txt file. For example: with open("mylist.txt","w") as f: #in write mode f.write("{}".format(mylist)) Your list

Sharing images that are stored on internal memory

有些话、适合烂在心里 提交于 2019-12-18 13:31:23
问题 I have an application in which an ImageView is set and can be clicked to be opened in the gallery. By default, I use the following code to get a file directory from the external storage to store my jpegs: File picsDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),"MyCameraApp"); But! Suppose the external storage is not mounted or simply does not exist (Galaxy Nexus), this doesn't work. So I wrote an if-statement around it and get the internal cache

Trouble writing internal memory android

做~自己de王妃 提交于 2019-12-18 12:45:46
问题 void launchImageCapture(Activity context) { Uri imageFileUri = context.getContentResolver() .insert(Media.INTERNAL_CONTENT_URI, new ContentValues()); m_queue.add(imageFileUri); Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageFileUri); context.startActivityForResult(i, ImportActivity.CAMERA_REQUEST); } The above code, which has always worked, is now generating this exception for me at insert(). java.lang

The Difference Of Location Storage File in air

非 Y 不嫁゛ 提交于 2019-12-18 11:58:01
问题 I want to ask the difference between air.File.documentsDirectory.resolvePath, File.userDirectory.resolvePath, air.File.applicationDirectory.resolvePath.. Can anybody explain when does the file will be store..... especially in windows 回答1: AIR's applicationStorageDirectory will automatically target these locations depending on which OS the application is running: Windows 7 / Vista: c:\users\USERNAME\appdata\roaming\APPLICATIONNAME Windows XP: c:\Documents and Settings\USERNAME\Application Data

how to create a file with world readable permission under subdirectory of files directory

做~自己de王妃 提交于 2019-12-18 11:47:44
问题 I need to create files under myapp/files/subdir with global permission in my application. I do this because I use external applications to open some files Using this FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_WORLD_READABLE); creates file only under files folder. Using File dir=new File(Constants.TASK_DIRECTORY); dir.mkdirs(); File file=new File(dir, FILENAME); file.createNewFile(); FileOutputStream fos=new FileOutputStream(file); creates files under subdirectories but with

Storing a String array in the SharedPreferences

孤者浪人 提交于 2019-12-18 11:33:11
问题 I was wondering if it could be possible to save in the shared preferences an array of Strings, in a way that, every time we save a certain String, we store it in that array. For example I have a list of locations with a certain ID that I want to mark as favorite. The ideal situation would be, having an array and saving a certain location ID (let's call it Location1) in that array, so next time I want to mark a new location as favorite (let's call it Location2), I retrieve that array (which so

Photo does not show up to gallery

我怕爱的太早我们不能终老 提交于 2019-12-18 09:41:38
问题 I'm trying to take a photo using the android camera and telling it to save to the phone's gallery. I think i messed up on the path, but i can't seem to find my error. Could someone help me? I'm very novice at android. Code to call camera Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); String uriToFileInExternalStorage = null; cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriToFileInExternalStorage); startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);

iphone write to file fails

你说的曾经没有我的故事 提交于 2019-12-18 09:39:39
问题 I'm writing some data to a plist file but it fails on the device but not in the simulator. I'm lost, don't know where to look for a solution. This is my code: NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; [dict setObject:nameField.text forKey:@"name"]; [dict setObject:emailField.text forKey:@"email"]; BOOL ret = [dict writeToFile:[[NSString alloc] initWithString:[[NSBundle mainBundle] pathForResource:@"settings" ofType:@"plist"]] atomically:YES]; NSLog(@"%d",ret); [dict

saving pictures taken by camera in android app

元气小坏坏 提交于 2019-12-18 07:24:15
问题 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