www folder empty in ionic project - android

I am trying to create a basic ionic project. I have used the command
ionic start myProj blank to create myself a blank project. I am referring to a tutorial where is shows that the www folder should have css, js and other folders in them. I don't see ay in my project structure.
I have tried reinstalling ionic. Did not help. Currently I have installed
Ionic - 2.2.3
Node - v6.10.2
I am using Atom editor to view and edit the contents

ionic start mproj blank will create files in src directory..
www folder will get files once you build for eg: ionic serve.
This will have build folder containing transpiled and minified css and js files.
ionic has changed considerably from 2 to 3.x.. Your code should work with minor changes if it is old tutorial..just compare with official docs

Related

Cordova not copy fonts when generate APK

I use Cordova 8.0 and it is my www project tree:
When I run cordova run android for test my app in my phone I get the next project tree:
(I show it thanks to Chrome Dev Tools)
So cordova completely omited my fonts folder How can I avoid it?
EDIT:

Ionic 3 not finding assets when built for Android

When I serve my project there is no problem, but when I build it for android it fails.
It even fails to load its fonts: E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/assets/fonts/roboto-bold.ttf and gets stuck on splashscreen.
When I change asset path from ../assets to /../../assets or ./assets it loads, but fonts and background images are still not found.
I'm using the latest version and the default assets folder in src
Solved
Now after reinstalling cordova etc I tried a blank project - It works.
1) In my scss I had:
$assets: "../assets/";
$font-path: $assets+"fonts";
Looks like android did not like that (but I added it later)
I removed android platform + cordova
deleted package-lock.json and node_modules
ran npm-check-updates just in case ran `
ran npm install
added back cordova and android platform
deployed to android
There are some bugs, but images are now showing

Cordova hybrid app (missing files from my project)

Im working on a hybrid app on cordova 6, I added android, Ios and browser, currently working on android only. My project is in c:/myApp/www and the same content of it is in c:/myApp/platforms/android/assets/www , when I run cordova on browser everything is there and I can see the project from Chrome DevTools => source; but when I run it in android, deploy it to my phone (samsung s5), debug with cable, I look into Chrome Devtools => source, I see only index.html and assets folder, while there has to be a login.html and images folder and other JS files. I even moved the images folder to assets folder but the assets folder is there and images folder is not in it!!!
All your html and images should be in your main www folder or subfolders of it.
Make sure your images folder exists here:
c:/myApp/www/images
If that's not working, you could try removing and re-adding the platform using the CLI:
cordova platform remove android
cordova platform add android
You shouldn't edit your c:/myApp/platforms/android/assets/www folder directly, and you should just let the CLI automatically copy files there when you run cordova run android.

In phonegap On adding a new plugin if I rebuild my app it is removing the total project and creating a new one

Im trying to add a new plugin in phonegap, in order to work a new plugin we should rebuild the app. But if i rebuild the app my entire project is removed and it is creating a new one.
how can i use the plugin without rebuild or how can i rebuild app without loosing my code.
Im trying to add the splashscreen plugin.
First off all: I would recommend you to get a deeper look into Cordova. Therefore you need to read the Cordova Documentation.
The reason for just having a clear index and things like that is, that the command cordova build will copy all files from the root www folder into your platforms. That means, that you probably have worked in the www folders from your platforms.
Your folder structure is sth like this
So if you run the cordova build command it will copy all files from the www folder (2.) in your folders for your platforms (1.). If you now have not worked in the root www folder, it'll just copy the files which were created while you build the project the first time.
Normaly the Plugins you installed are available directly after you installed them - without a rebuild. So i would first recommend you to update your cordova (npm update -g cordova). After that you should create a new project and copy your files from your last project into the root www folder. A workflow for that should look like follows:
cordova create testProject com.example.com testProject
cd testProject
cordova platform add [platform you need]
cordova plugin add org.apache.cordova.splashscreen [plugins you need] - please note: Since Cordova is on V5, all Plugins are available via npm so the new command for installing plugins looks like: cordova plugin add cordova-plugin-splashscreen.
After you added all now you're copying the index and css file from your project into your new www root folder
Now you run cordova build
If you want an extra plugin now, which you have not installed when you created your project, you close all files your IDE (Xcode or Android Studio) and then move into your project with your terminal/console. There you can add a plugin now and it should be available after it is installed with cordova plugin add cordova-plugin-* without the build command!
Hope that helped you, let me know if you need further information!

Apache Cordova and ADT - Update 'www' folder

I am developing an Android app using Apache Cordova 3.6.0.
I have followed the instructions available here and here to create, build and run my app.
I realized there are two folders which store HTML, CSS and JS files: www and platforms/android/assets/www:
According to this answer, I should modify only www because the command $ cordova run android will overwrite platforms/android/assets/www.
When I run my app through ADT, the folder platforms/android/assets/www is not updated.
How can I make ADT update this directory? What am I missing?
The linked answer is correct. You should only modify the content of the root www folder.
But you will have to build your app before you run it to make your changes take effect in the platforms/android/assets/www folder by running:
$ cordova build
or cordova build android.
FIRST SET OF WWW folder:
it contains your customized file ,from which you are developing the application.U must make the changes here.
SECOND SET OF WWW folder:
these are generated when u install a plugin with sample.(A working example)

Categories

Resources