Ionic platform add android adds default cordova files - android

Im doing an ionic project. I have made all the designs and components in the www folder.
But yesterday onwards whenever i tried to run the command ionic platform add android or cordova platform add android it adds the default cordova files.
Its not adding the files in the www folder that i have made.
And also the ionic build android or cordova build android not doing anything.
Please help.
This problems came yesterday.
I didnt updated anything

Related

how to update files in existing cordova project android platform?

how to update files in existing cordova project android platform?
i converted my web app to cordova app to go native -
i uploaded the cordova app to the play store, and now i want to upload a newer version of the app - the problem is that i don't know how to update the files in the existing cordova project without deleting it and start all over again -
i have multiple plugins in the older cordova project and do not wish to start from the beginning and install them.
my OS is windows 10 , and i work with Android Studio
You can make your changes in the www/ folder of the project (where your web code is housed), and then run cordova prepare ... this will essentially copy your www files to the platform (Android in this case) specific location.
You can then rebuild in Android Studio or by running cordova build android
This way your plugins are untouched and only the web code is updated.

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:

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 upgrade from phonegap 2.9 to phonegap 3.5 (project directory could not be found error)

I have an android application that i built on PhoneGap 2.7.I installed phonegap 3.5 using cmd and tried to upgrade an app as shown here
How do I upgrade Phonegap in my Phonegap app?
But when i do it using cmd it gives me the following error:
Unlike phonegap 3.5 the android application that I built in PhoneGap 2.7 does not have a platform folder.So what am I supposed to?and how can I verify if it is upgraded or not?
I had also seen these phonegap documentation
http://docs.phonegap.com/en/3.5.0/guide_platforms_android_upgrade.md.html#Upgrading%20Android
But It does not show how to directly upgrade from 2.7 to 3.5
I don't think phonegap platform update works for upgrading from something older than 3.x.
For phonegap/cordova cli to work it has to detect a project with the structure of 3.x projects.
To upgrade your project in 2.x you have to
install phonegap or cordova cli (which you seem to already have done, but if you don't plan on using phonegap build, I suggest you use
cordova instead of phonegap. if not please replace cordova by phonegap
in next steps)
open a cmd and cd to a folder in wich you will want to put your project
create the new project from the www folder you had in your old project:
cordova create nameforprojectfolder com.test.app Testapp --copy-from=pathtooldwwwfolder
change current dir to the newly created folder
add the android platform:
cordova platform add android
in cordova/phonegap 3.x no plugin is added by default so you will have to add all the plugins you use :
cordova plugin add uri.of.plugin
customize config.xml to your needs
build the android project (this will create files in the platforms/android folder)
cordova build android
You may need to customize AndroidManifest.xml in platforms/android/AndroidManifest.xml
Now you can use the CLI to work with your project.

Eclipse can't create project from existing code android

I've created by command line a new phonegap application.When I try to get it by eclipse from android existing code it can't recognise as a android project.
Have I build my phonegap app before?
Phonegap project's folders are:
.cordova
hooks
merges
platforms
plugins
www
phonegap create [optional params] will setup a blank project space. To add platforms to this project you must run phonegap platform add [ios/android/wp8]. Then depending on the platform and how you wish to develop it, you run either phonegap prepare or phonegap build.
In your case, since you wish to import to Eclipse, you will want to run:
phonegap platform add android
phonegap build
Then in Eclipse you can browse to /PROJECT_PATH/platforms/android and import your project.

Categories

Resources