Where are content files stored in a monodroid application? - xamarin.android

I've got a monodroid application that has several files with configuration data that needs to be accessed at runtime. I'm porting this over from Monotouch and there I have a directory "Stuff" that is off the root project directory. All the files are marked as Content.
In monotouch, these files are copied to a subdirectory off the root, so just opening "Stuff/MyFile.txt" is working correctly. In monodroid I'm getting file not found exceptions.
What is the base path for content files with Mono Droid?

In Mono for Android (and regular Android), you need to place all these files in the Assets folder for them to be accessible from your application:
http://mono-android.net/Documentation/Guides/Using_Android_Assets

Related

Changing file path in .dpr file in delphi

We are using Delphi 6. Currently, we have kept all the different application folders under one main folder.
We have below folder path for one of the applications:
C:\dev_GIT\MyApplications\Delphi\Sales_Applications\Member_Joining
For some reason, we would like to move this folder to below folder path:
C:\dev_GIT\Member_Joining
Issue we are getting is that we have some common files which are kept in separate folders and which are used in so many other applications as well.
Since we are moving this folder outside of the current folder path, we are getting compile error, which is expected.
The real issue is, as there are so many files which are in common folder path, we need to change their path in .DPR file one by one. Is there any better way by which we need not to change path for all the files in the .DPR file?

Unity: resources.bundle isn't added to xcode

I used to copy/paste my IOS plugin files inside Plugins/IOS folder on my Unity project, but it doesn't work for bundles (as it has directory structure).
I can't beleave there is no way to generate xcode project from unity with .bundle inside?
Any help appreciated
Unity3D will not contains folders in the Plugins/iOS to Xcode project. In fact Unity3D will only auto merge source file and .a library for you, as described by Unity3D's doc:
Automated plugin integration Unity iOS supports automated plugin
integration in a limited way. All files with extensions
.a,.m,.mm,.c,.cpp located in the Assets/Plugins/iOS folder will be
merged into the generated Xcode project automatically. However,
merging is done by symlinking files from Assets/Plugins/iOS to the
final destination, which might affect some workflows. The .h files are
not included in the Xcode project tree, but they appear on the
destination file system, thus allowing compilation of .m/.mm/.c/.cpp
files.
Note: subfolders are currently not supported.
But you can use the PostprocessBuildPlayer attribute to implement this yourself. I made a tool for this purpose called XUPorter, which can make exporting and libraries setting easier from Unity3D to Xcode. You may want to see it on GitHub. There is a demo in the package and you may set your bundle under the 'folders' tag.

How to add large number of static files to MonoTouch bundle?

I have (quite a bit of) static files that I need to deploy with my application that is built on top of a legacy .NET library. These include several XML and config files, and a read-only database in the 10's of Megabytes.
Most forums I have seen indicate that the best way to accomplish this is to reference the needed files in a project, and set them to Content and "Copy to Output Directory".
I have two issues/questions dealing with this:
Adding these files, and setting them to "Content" seems to not only copy the files over, but embed them into the .dll as well. In other words, I have 40 MB worth of files, and a 40MB dll (this project's only goal is to import these files, there is no substantial code).
How can I prevent this extremely large dll from being made?
Is there an alternative way to get files into the App bundle? I would love to use a custom build command, and although I can copy files into the target directory ${AppDirectory}, but this does not result in these files ending up in the app bundle. Is this approach possible?
Any help is appreciated in advance.
You need to include your files from the main .exe project. You do this by using MonoDevelop's Build Action to Content on each file. They should be copied to the .app without being included inside an .dll (or the .exe).
An alternative (for development) is to use iTunes sharing to copy once your files to your device. This allows you much faster deployment times while developing.
Of course you can't submit such build to the app store (unless the files are not required to make the application work, unlikely). What I do (for my nearly 80MB read-only database) is to use this hack (loading from /Documents) inside #if DEBUG. The release build load the files from the normal location.
I have not automated the process (still debugging the app ;-) but it should be possible to script this so modifying the project options (for each file) is not required when switching from Debug and Release builds.

How can I add jpg files to ipa and load them with FileStream class

I'm developing a tile engine with actionScript-3 for IOS machines. Is there a way to package JPG files with IPA and then read them with Adobe Air's FileStream Class. I need to read files asynchronously. Embeding them or putting them in a swc wouldn't help.
I understand how it works on desktop.
var file:File = File.documentsDirectory.resolvePath("myfile.txt");
On desktop, means:
[user_dir]/Documents/myfile.txt
On IOS:
[app_dir]/Documents/myfile.txt
How can I package the IPA that has "myAsset.jpg" in "[app_dir]/Documents/" directory?
I tried to open a "Documents" directory and put some files in it and include it in the package content section of the run configration of flash builder 4.5.1. But that didn't work.
Thank you.
When you package the image files with your application, they will be in the application directory, which you can access with the File.applicationDirectory property. You should be able to load your images directly from there. If you want the images in the documents directory, you will have to copy them there after installation.
One Addition to Joes answer:
When you add a folder over adt the actual folder is added not its contents.
So if you add the Folder assets you access your images like this:
File.applicationDirectory.resolvePath("assets/image.jpg");

Type of files created in a blackberry project

I created my first Hello world project for BlackBerry and following files were created in the deliverables folder:
- HelloWorld.cod
- HelloWorld.cso
- HellowWorld.debug
- HelloWorld.jad
- HelloWorld.jar
- HelloWorld.rapc
What is the purpose of each of these files? I know at least that the jar file must be deployed as a mobile application. But what about all other files?
The .cod file is basically BlackBerry's proprietary version of the .jar file. (This is usually the version downloaded from the App Store.)
The .cso file is a helper file used when signing the application. (It says which keys are needed.)
The .debug file is a helper file used when running the application in the debugger.
The .jad file describes the application to help the device know if it's compatible. (If you were downloading onto a BlackBerry from a website instead of the App Store, this is the file you'd point your link at, which would contain the path to the cod/jar.)
The .jar file is the main application file for MIDP, which is sort of a generalised mobile java runtime environment.
The .rapc is a helper file used by the BlackBerry JDE when it's compiling/building the project.

Resources