Cordova hybrid app (missing files from my project) - android

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.

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:

www folder empty in ionic project

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

Deploy working polymer app to android using cordova

Yes,We have resources for this on net and I searched for that ,But it didn't solve my problem so asking this question here.
I have a working polymer web app and I am able to access this using http://localhost:8080//index.html,My app looks like this
I want to deploy this app in android phone,So I used apache cordova
Below are the steps I followed
Installed cordova using
npm install -g cordova.
create cordova project
cordova create alertsDir com.alerts.net "Alerts" --template=C:/Users/212606402/Learning/Alert client/alert-push-notification-client
cd to alertsDir and add platform
cordova platform add android
build platform
cordova build android
run project
cordova run android
I am not getting any error in above steps
I run this in both android emulator and nexus 5 devise but it showing the same default cordova screen,My app is not shown there,Below is the emulator screen I am seeing
I followed some tutorials and just wondering how it works for them.
tuetorial 1
Can anyone please explain me what I am missing or doing wrong.Thanks in advance.
as far as i know, Cordova only deploy 2 folder platforms folder and www folder but not all in platforms folder will get deployed to your device, usually the cli will merge platform_www and www folder.
so if you want to make a cordova app you need to put all your sourcecode or sourcecode that already bundeled using either polymer-build with gulp or polymer-cli inside www directory.

How to run exsicting ionic app

I have an Ionic app with this folder structure
How can I run this app, knowing that I have node and ionic npm installed in my PC
Type ionic serve to run your app on the browser
Follow steps below:
Open command prompt in windows and goto your app folder using cd command in cmd.
Once you're in, just write ionic serve to see app running in browser.
To run it in device, first build it using ionic platform add android Then ionic build Next ionic run android
It will run application in connected device or emulator.
Make aure you have android setup in your system for this.
You don't have www folder. It's a folder where your html and js and css files are. Without it you don't have an app.
I recommend creating entirely new ionic project with ionic start ProjectName
Then you will be able to run it with ionic serve and see the structure so you can figure out how to run your example
In you have this inside your src folder
css
img
js
lib
index.html
just rename src to www and then run ionic serve.

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