This is my first ever app I’m trying to deploy using Apache Cordova (PhoneGap) and I’m having issues referencing the CSSs files. I followed this guide since I would like to work using IntelliJ Idea. As a first step, I’m trying to deploy the app on the Android emulator.
I’ve been able to deploy the app to the emulator successfully, the only problem is that it doesn’t seem to load the CSS files, so the result is a black and white unstyled application. I reference the CSS files using:
<link rel="stylesheet" href="_styles/main.css" />
The folder hierarchy is:
– assets
— www
— _styles
—- main.css
— index.html
The main activity looks like the one in the guide:
public class MyActivity extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
}
Please note that the same thing happens on Eclipse as well.
Any help greatly appreciated.
Thanks
You are running into an issue with AAPT. The Android package manager which compiles your app into a .apk file ignores any files or directories that start with ‘_’. Try renaming your directory to “styles” and updating your references. That should fix the issue with the CSS not being loaded.