Cordova plugins not working when using Framework7 - javascript

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.

Related

How to install a mobile template in apache cordova 6.1.0

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?

Phonegap Build plugin not recognised, js not loading

I've been tasked with learning how to build Phonegap Apps through AEM 6.0. So far i managed to create an empty starting point app and get some features fro the ootb geometrixx app back in.
Now i've been trying to add the phonegap camera plugin without success.
I've added the required line to our config.xml:
<gap:plugin name="org.apache.cordova.camera" version="0.3.2" />
and to our installPlugins js that's called as a before_platforms_add cordova hook.
I've checked CLI build and the contents of the apk we're getting from phonegap build and all the files that should be present are present. However I'm still getting File Not Found errors on the js files and a Plugin Does Not Exist Cordova error.
screenshot link for browser console & file structure of apk
Googling hasn't gotten me any real pointers so far, perhaps somebody here can help me out?
After after even more searching and delving into the apk provided by Phonegap Build, a solution has turned up:
As it turns out, there was a third place where the loading of the js files was controlled, namely the contentsync-file-list.js.jsp file located in the splash page component.
Somehow, although the files were present in the phonegap builds and known to cordova, the list of a plugin's js files not being included in the contentsync-file-list.js.jsp prevents them from actually being loaded by the app.

Phonegap - Should I include JS vendor files in my git repository?

If I want to use Adobe build cloud for my Phonegap application should I commit the vendor js files like jquery-mobile in my git repository?
Is there a way to avoid it like specifying dependencies?
1) You dont need to commit it to git.. After installation of app it can still download jquery and jqmobile if you specify the script src in your html. But if you put it i side your app then the app will initialize faster compared to download from cdn.
2) there is nothing like dependency.. Yes if you are using plugins from phonegap you can specify only dependency in config.xml. but not for js libraries.

Phonegap Android HTML wont update

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

Creating basic apps with PhoneGap

I installed PhoneGap with nodejs, and I sent the create command to create a folder with the basic files needed for the first app. When I open the index.html file there is a script tag that points to a file called phonegap.js. The problem is that this does not exist in the folder, where is it? The app is running if built without that file or not?
That is my folder:
My object is to create a basic app working.
Thanks.
The file is created when you add a platform to your project (because its content is different for each platform)
For example, for an android project it should be in platforms/android/assets/www/phone gap.js.

Categories

Resources