I am now learning cordova and i wanna know something.
Example, I have index.html & index.js in my cordova project.
I will build app and install it in my phone.
So the question is those two files index.html & index.js will be in app package folder inside phone local storage?
Thanks
Yes, the files show up in a hidden area on Android and iOS. Anyone with a rooted phone can see them. Don't store security keys in your code.
All Cordova really is is on Android and iOS is a reference to the embedded browser available on both systems and hook to load whatever page you specify in the config.xml. You can even set the config.xml starting file to be your webpack dev server. Therefore your html and JS files have to exist somewhere for the web browser to open them.
Related
I am making a Cordova app using Framework7 for iOS/Android. I'm trying to add the social sharing plugin and the barcode scanner plugin but the plugin functions can not be called. However when I made a Cordova app with plain HTML and JS (without Framework7) the plugins would work. Is there anything I have to modify on the Framework7 side to enable these Cordova plugins to work?
cordova.js file need not be there in your project root directory. Everytime you do a particular platform build, it gets automatically created in the platform build's project root directory.
For instance, if you build android platform using 'cordova build android' command, the cordova.js file will be generated under 'platforms\android\assets\www' folder. This js file is very much required to use any of the cordova plugins as it is the one which is responsible for triggering 'onDeviceReady' event once the cordova is ready and all plugins are loaded. You can also have a look at the generated file once to get more info on the same. Hope it helps.
So I am running Apache Cordova on Ubuntu trying to create a multi-platform hybrid application. So far I am done with the steps of:
Installing Codova
Assigning the Andoird Home, configuring the sdk and the avd
Being able to export the project on the browser and as an apk file
Testing the apk file and making sure it's working fine on a real device
After unzipping the mobile template written in (HTML/CSS/JS) into the application's directory and removing the default index.html to make sure the full files of the templates are functional, everything seem to be working fine.
The question is, is this normally how it should work? or is there something that I have to do within the cordova's app directory's default files (like the default index.html) in order to not miss with the installed cordova plugins like (camera, geolocation .... etc) ?
In other words, do I treat the cordova's app's www directory just like I treat a regular website files on a server, or are there other steps?
I developed an application on Apache Cordova, I followed all the steps to generate the .apk to upload on Google Play. I tried many times but Google's response is the same:
We rejected APP, package ID com.xxx.app, for violating our dangerous products policy. If you submitted an update, the previous version of
your app is still available on Google Play. This app uses software
that contains security vulnerabilities for users. Below is the list of
vulnerabilities and the corresponding APK versions that were detected
in your recent submission. Please upgrade your app(s) as soon as
possible and increment the version number of the upgraded APK.
Vulnerability Apache Cordova: The vulnerabilities were fixed in Apache Cordova v.3.5.1.
I have the latest version of Cordova (5.4.1).
The following will detail the steps that I followed for installation and project development:
Start the download of Cordova from the console Node.js using the command npm install -g Cordova.
Install Java: version 1.8.0_65.
Install Android SDK.
Add Java and SDK to PATH.
I downloaded the necessary components of the Android SDK.
Create the project through the commands. (Cordova create Projectxxxx).
Add the Android platform.
I copied my application code in the www folder.
Add the plugins needed for my project: splashscreen and sqlite.
I tested the application on the Android emulator and other mobile phones. All good. Runs perfect.
To create the signed APK file, these are the steps:
-Cordova build --release android. (This generated the android-release-unsigned.apk on platforms / android / build / outputs
/ apk).
-Then, I generated the keystore.
-After the jarsigner.
-Finally: zipalign.
I upload end-app.apk to Google Play.
Another detail that I have is that cordova.js generated version is 4.1.1. But the console version is 5.4.1 (Command: Cordova -version).
I did everything by node.js console.
Attemps:
I uploaded an APK without js components. Only with cordova.js and it not worked.
I installed all over again in a newly installed windows and neither worked.
My version is higher than 3.5.1. I can not find the solution.
The big problem is not just that PLATFORM_VERSION_BUILD_LABEL is wrong, but the default cordova used is ancient ( it was 3.7.1 on mine ). To resolve this you need to install a newer version in the project. You can specify this on the command line, much like npm does.
cordova platform update android#4.1.1
Or you can specify it in your config.xml
<engine name="android" version="4.1.1" />
That may need 'spec' instead of 'version' depending on how current you cordova install is. At this point, they are up to 5.1, and you can use 'latest' instead of a specific version number.
The next headache will be the point of the patch, which locks down network access. I am now getting 404 errors on all my ajax calls to our server. Access was the root of the security problem, so this isn't a big surprise. I am still working on that.
I had the same problem, I found a previous corodva version in a plugin, in my case was facebook connect; I deleted this plugin and upload again, its work form me. You may search PLATFORM_VERSION_BUILD_LABEL in your project, is posible that some plugin have other cordova version.
I was trying to solve this problem almost for a week. Solution:
There was a cordova.js file within www/lib/cordova folder that doesn't get updated when you update cordova and ionic. Open the file and look for var PLATFORM_VERSION_BUILD_LABEL. If the version is not 4.1.1 at the time of this post, update it with another copy of the file that is somewhere in your main directory.
I am building and Hybrid Application, that will run on Android and iOS platform, My application has a feature for downloading content from web server and then use the same for loading the GUI in respective platform, now my question is, how can i access the application installed directory where my application is installed, so I can have a control over the content.
I know how this can be done in Adobe AIR, but I am very new to this Arena, any help will be really very helpful.
Thanks & Regards,
RS.
You shouldn't know where your application is installed to download and save files and to use them in application. All that you have to know - where is folder for your application data (including downloaded/created files).
Have a look at http://cordova.apache.org/docs/en/2.9.0/cordova_file_file.md.html
According to docs, you can operate with fileSystem.root directory (create/modify/delete files and folders in it). On Android, fileSystem.root is usually SD Card root directory, while on iOS it is separate "sandbox" folder for each application.
I am trying to upload some code html and javascript code into phonegap to develop this app however when I update the files the program still runs the old code as to what was in the html file before. I have even started a new project and it will not change the old index.html image even though the code behind it is different. I'm really confused as to why this is and I was wondering what I could do to solve this. I even searched through the workspace index.html file and it is the correct file that I want in there but upon running it i am given the same your device is ready hello world. I checked the location of the files and everything is correct. It is very confusing. I am using eclipse by the way not phonegap build if that helps.
you need to build your project again.
cordova build android
But make sure you edit your files in www folder in parent folder.
Make sure you are updating the WWW file in the root Phonegap folder. Then you can run the command:
$ cordova build
or
$ phonegap build