assets

Where should a site's assets go in a MVC website?

Examples given are from Kohana 3, but the question is not limited to the framework. I've always put my assets in a file structure like this application - classes - views assets - css - js - swf - images -- layout -- content system - classes I've started reading a few forums where people always mention their asse...

Rails Routing INSIDE CSS

Is there any way I can route assets inside of my css to where the rest of the views are pulling them? I mean, inside the CSS can I call url_for or css_for or something like that in order to have the images go through the assets router? Thank you in advance! ...

Getting the image URL without the HTML in Rails

Hi, In Rails is there a way to get the URL to the image (going through the assets_host) and just return the URL of the image? I want to use assets_host data in my Javascript, but I just need to insert the URL into the JS, not the whole image_tag. Thank you in advance! ...

Using user editable image URL in application. Security issues.

Hi there. I am writing an application where users are required to show their photo, however as my server resources are very limited I can not let them upload it to the server. So I have three major questions: 1. How to properly validate photo URL? At least I can validate with regexp, however I need to check for file ending: `validat...

Loading package html + resources into webview

I would like to know how I can display a HTML page in webview with references to relative/local images. The goal is to have the html page and all linked images contained in the android application package itself. Where would I need to place the assets (assets directory?) and how do I reference these so they load into the webview? Than...

Packaging "hidden" asset files

I'm placing the file '.nomedia' into a folder in order to avoid Android's MediaScanner from detecting the media files in the folder. I need to copy this folder (including '.nomedia') from the APK's assets to the SD card (so other apps can make use of these media files, etc.). When I package the APK in Eclipse, it doesn't package the '.no...

Determining filetype of file in assets folder

Question: How do you programmatically distinguish between directories and regular files in the assets folder? When using AssetManager to access files in the assets folder, it seems impossible to determine if a file is in fact a file or a directory. You get the list of files from the list method and then open the file using the open meth...

Store database in /assets and access it

Hi i have very large database so i am not able to store it in... \data\data\"PACKAGE_NAME"\databases so i want to store database in Assets and access it from there .I do not want to copy database from assets into \data\data\"PACKAGE_NAME"\databases .. So any fertile brain there to plant solution..... ...

How to create a "dependency graph" for IT assets

One of my customers is trying to create an interactive "matrix" of interdependencies for the various applications used in their company (it's a travel&leisure company with around 2500 employees). The idea (still at the prototype stage) is to create a sort of Map, based on Visio or similar tool, which traces the communication and interde...

How to play videos in android from assets folder or raw folder??

I am trying to play a video in android emulator I have the video in my assets folder as well as the raw folder But after doing some research still i cant play video in my emulator i am working on android 2.1 My video format is mp4 so i don't think that should be a problem Could anyone just give me an example code so that i can understa...

Android Assets with sub folders

InputStream myInput = myContext.getAssets().open("MyFolder/" + "MyFile.db3"); I have a file in the assets folder in a sub folder as above. It doesn't get the file though, is there a special way to specify a sub folder in the assets folder? Ian ...

Android Assets - Unable to access

Using this code it should return a list of the assets. But it crashes, with a "Source not found, Edit Source Lookup Path..." message in the debugger when I call the list method: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); AssetManager ass...

Android Assets No Value Read?

AssetManager assets = myContext.getAssets(); String[] files = assets.list("MyFolder"); InputStream myInput = assets.open("MyFolder/" + files[0]); int i = myInput.read(); in this case 'i' is -1 meaning nothing read. Why would nothing be there if the file is there, the variable 'files' has the file as we...

Rails packing CSS yslow import directive

I have an RoR application with multiple CSS files. YSlow complains about to many http request for the css files. Now I have installed Jammit, to compress my css files into one file. That works, but when some CSS file has an "import" directive, i get still an http request instead of simply get an single css file with all the included f...

use a style.css file from a .swc and build the Flex project with ANT

I have an .SWC library with a style.css file inside. The .SWC file is added to my project and the style.css is used this way: <fx:Style source="assets/style/style.css" /> If I want to build my project with an ANT-script it says that "the external stylesheet couldn't be found". In ANT you need to write the path for assets with an leadi...

Embed many graphics using an array

In AS3 you can embed a graphic into a Class variable: [Embed(source="MenuAssets.swf", symbol="topSquare")] public var TopMenuItem:Class; I have hundreds of assets in this one website project I'm doing, so I want to embed assets into an array for quick access. Can I do something like this? Its not compiling so I'm wonderi...

question regarding retina display assets on older handsets running 4.x

So I'm building an app for 4.x devices and I'm wondering if I can just use one set of assets at double resolution instead of one set with a @2x id and another set without. Basically im asking can the older 3g and 3gs just use the @2x assets? and do the right thing with them? anyone have experience with this? Thanks ...

Play audio file from the assets directory

I have the following code: AssetFileDescriptor afd = getAssets().openFd("AudioFile.mp3"); player = new MediaPlayer(); player.setDataSource(afd.getFileDescriptor()); player.prepare(); player.start(); The problem is that, when I run this code, it starts playing all the audio files in the assets directory, in alph...

Accessing the Catalyst object $c from MyApp.pm

I'm using the Assets plugin in my Catalyst app, and I would like some javascript and css files included in the assets of every page. My first thought is call $c->assets->include('file.js') from MyApp/lib/MyApp.pm where I do setup and config, but I don't know how to get a hold of $c there. My next idea involves using the WRAPPER stu...

Cakephp images from css using themes

im using themes in an app im doing, and need a global css/img/js folder i have tried using app/webroot as this folder, but cant get any css from a theme to show the images. I have a setup like :: /app/views/themed/my_theme/webroot/css/file.css With some css that looks like: ... body{ background-image: url('../img/file.jpg'); } ...