How to Delete a Target Folder with it's All Files in Windows Phone 7 - windows-phone-7.1

I want to delete a folder with it's all files in windows phone. In the wp7.1 SDK, I just found follow APIs:
public void DeleteDirectory(string dir);
public void DeleteFile(string file);
If a folder is not empty and I call the DeleteDirectory method, there is an exception.
So, is there any way to delete the files in the target folder?

Using GetFileNames get all the filenames in a directory. Then Iterate and delete all the files. thereafter when the folder is empty delete it too. I hope this helps.

Related

How to access .dll or .so files in an android project Xamarin

I have a folder with a lot of .so files which I'm trying to use while my code is running.
I place them in a folder called "External" and then I try to access them like this:
[DllImport("External\\libvocon_ext_heap.so", EntryPoint = "ph_CreateWin32PrivateHeap", CallingConvention = CallingConvention.Cdecl)]
public static extern PH_ERROR ph_CreateWin32PrivateHeap(ref LH_HEAP_INTERFACE pHeapInterface, out IntPtr ppHeapInst);
I've also tried to place the files in the Assets folder, but i still get the same System.DllNotFoundException
This is a late answer but I did find the solution to my problem. The main issue was how I stored the library files in the project. In order to locate the library files they have to be stored under specific directories. Instead of storing them in the "External" directory as I did, they must be stored in a directory with the name "libs" and a specific subdirectory like the following:
libs>armeabi>libfoo.so
libs>armeabi-v7a>libfoo.so
libs>x86>libfoo.so
Because Android CPUs can be based on 3 different ARM architecture, there has to be a directory for each of those architectures (armeabi, armeabi-v7a, x86). I imported the library files like this:
[DllImport("libvocon_ext_heap.so", EntryPoint = "ph_CreateWin32PrivateHeap", CallingConvention = CallingConvention.Cdecl)]
You only need to write the name of the library file since it will locate the right directory path by itself. You can also write the name like "vocon_ext_heap" since it can automatically add the "lib" and ".so" to the file name if it is missing.
I also re-installed the Xamarin SDK manager because I found a possible solution asking to re-install it, but I don't know if it fixed anything related to this problem. Also, the libraries of course has to be build as AndroidNativeLibrary as Softlion mentioned.
Have you set the build action of your so file to AndroidNativeLibrary ?
See https://developer.xamarin.com/guides/android/advanced_topics/using_native_libraries/

How to send Xcode project via email

I am trying to attach an Xcode project to an email and send it to someone. I cant attach the file and an error shows up saying: The file size is 0 bytes. I don't want to use dropbox because it only shows the files, but the person cant run the project. Is there a way I can send the full project and the person receiving the app will be able to run the project and not just be able to see the individual files.
Simply zip the folder your project is in.
Navigate to the folder that contains your .xcodeproj file, and zip that folder using "compress" as shown below. Make sure you zip the folder containing the .xcodeproj, the projects files, tests, etc. do not just zip the files which are located in the folder with the same name.

File With Same Name From different folder in ios

I am using "xcode 6.1.1" and "cocos2dx-3.2".
I need to access same file name from different folder.
In Resource i have 3 folder "A,B and C" and all this folder contain image with same name "1.png".
If i need to access 1.png of folder "A" ,How i can do this in cocos2dx please help?
following code is working fine in Android but not working in iOS
helpImage->setTexture("A/1.png");
Thanks.
Didn't used cocos for some time now, but it is pretty easy to do.
Do this:
Prepare directory with your game data. Here lets call it "GameData". Pick name you like.
Drag and drop that directory to the xcode, probably best location is Supporting files. Dialog will show up. Select "Create folder references", deselect copy if needed.
And basically you are done. During build process all resources will be copied to bundle with paths as is in that directory "GameData". So you can have files with same name without problems.

ACE library and files system

How can I manage files and directories with ACE library? I tried to delete files with ACE_OS::unlink, but it didn't work. I also failed to create directories by using ACE_OS::mkdir. I need to find a way to create and delete directories, delete files and move files from one directory to another
See ACE_wrappers/tests/OS_Test.cpp for code how to create, move, and delete files. Use ACE_OS::mkdir/rmdir to create/remove directories. See ACE_wrappers/tests/Dirent_Test.cpp for code how to retrieve the content of a directory

I deleted a folder out of my xcode project by mistake, where does it go to?

I deleted it out of the folder view in the left sidebar. It's gone from inside the apps folder and it isn't in the trash. It isn't letting me undo inside xcode either. It's a phonegap project and I deleted the 'www' folder.
Normally, the folders in XCode do not represent real folders in your filesystem.
Did the folder contain certain files? Can you check if these files are still present in the root of your project folder (via finder)?
If yes, the simplest way would be to just create a new folder an drag the files into it again.
I hope you have a backup. Xcode 4 deletes the files directly, rather than moving them to the trash. Please, file a bug report about this at bugreport.apple.com!

Resources