How do i build a phonegap app for webapp? - phonegap-plugins

I created a phonegap project in my machine and deployed it as a web app. when i browse it shows cordova is not defined. if i place the cordova.js inside the root folder then it throws some plugins are missin. anyone guide me how to host a webapp
using phonegap project.

Use this command to add the browser platform to your Cordova project,
cordova platform add browser
Now if you check inside your platforms directory there will be a new directory called browser.
Now run this, to get a browser compatible build.
cordova build android
Inside the "platforms > browser > www" directory you will find you web assets. You can host them on your server.

Related

How to run angular Application without node.js

I want to create the Angular application using Visual Studio 2019 Angular template in Asp.net core but without Node.js as External tool installation. I found that NuGet package manager also providing Node.js and NPM Packages for building Angular app.
So I created the asp.net core projected and selected Angular Template and add NuGet Node.js 5.3.0 that too is saying in readme.txt "Node.js itself is deployed by NuGet, so there is no need to install it locally on dev machines or build servers."
But when I tried to run the angular project then build is failing.
If anyone knows the solution with exact steps so please help me on this.
There is one extra step is required after the Nuget Node.js package installed in the project, which is missing in the node.js document.
Step: Add node.js installed path in PATH Environment Variable (One-time activity per dev system)
e.g: set PATH=%PATH%; C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VisualStudio\NodeJs
or node.js install path can be set manually in the PATH Environment Variable

create a mobile app from my web site using reactjs (not native)

I need to develop a mobile application which will be same for my web site (already create with reactjs). I was researching on reactjs. Can I convert my reactjs code from web-site to reactjs for mobile application ?
need a solution please
Thanks
No bro, a PWA cannot be uploaded to the apple store, by the way you can bypass this problem using ionic capacitator!
Capacitor is a cross-platform app runtime that makes it easy to build
web apps that run natively on iOS, Android, Electron, and the web. We
call these apps “Native Progressive Web Apps” and they represent the
next evolution beyond Hybrid apps.
According with this tutorial written by Manish Mandal to do so u have to:
1 - First, go to the root of your existing react app and create a file capacitor.config.json and inside that put the below code
{
"appId": "io.ionic.yourapp",
"appName": "yourapp",
"bundledWebRuntime": false,
"npmClient": "npm",
"webDir": "build",
"cordova": {}
}
2 - Now create another file name ionic.config.json and inside that insert the below code.
{
"name": "yourapp",
"integrations": {
"capacitor": {}
},
"type": "react"
}
3 - Now we need to build our react project. To build your react app open your terminal to the root of the project and run the below-mentioned command
npm run build
Note: this will create the build folder in your root porject and the
name of the folder should match the webDir name inside
capacitor.config.json file
4 - Now we will install ionic globally in our machine. To install ionic globally in your machine open your terminal and run the below command.
npm install -g #ionic/cli
5 - Now install the capacitor core in our project.
npm install #capacitor/core --save
ANDROID
6 - After that, we will first create an android app with our existing react app. Open your terminal and type
ionic capacitor add android
This will create the android folder in your root project and install all the required dependencies.
7 - Now run the below command to open your android project in android studio.
npx cap open android
Wait some time and then it will ask you to update the Gradle. Just update the Gradle to the latest version and run the project in the emulator. You can also connect your mobile to run the project live on your mobile phone.
8 - Now open the build menu from the android studio and build your apk file.
IOS
9 - To create ios app run the below command
ionic capacitor add ios
This will install all the required dependencies and ios folder to your project.
10 - Now run the below command to open your ios project in Xcode.
npx cap open ios
11 - Now open the app in emulator or physical device and build the app.
More info about capacitator:
https://capacitorjs.com/
so you need to create progressive web app , all it takes a mainfest.json file in your meta tag WebApp Manifest
with some splash screens and icons chrome will make you install mobile app like on client devices. And try to implement a service worker to handle the offline mode Service Worker
This course from egghead is very good PWA
You could create an "app" that is really just a webview that shows your website but it won't really have the same experience as a native app.
As mentioned a PWA would be a good approach. This way you can keep all your ReactJS code and have an app-like experience.
Android even supports submitting PWAs to the store.
You can't perform code conversion from react-js to react native directly, even though there are many similarities between them. Web application built with React.js can be easily converted to a React Native mobile app, and some source code can be reused
if you want to develop a single app for both mobile and web either,
create a web app that mobile browser friendly
or
create PWA(Progressive Web app) using React, PWA can access Native Mobile api like GPS

Ionic 3 and Razorpay - can we use the same Cordova plugin for web app

I have integrated Razorpay in my Ionic 3 application using the Cordova plugin at https://github.com/razorpay/razorpay-cordova.git.
I am using my Ionic 3 app as a web application also. It's working perfectly fine on mobiles.
What should I do to make it work in web?
Hi if you want to test your app on browser with cordova functionality hit,
>cordova run browser
Add a file in your src folder by the name "declaration.d.ts" and add the below code
declare var RazorpayCheckout: any;

Tabris.js developer app not loading my app

When I try to access my app via the URL in the Tabris.js 2 Developer app, I briefly see the message below, and the app returns me back to the URL screen:
"Could not load boot.min.js or boot.js file from tabris module 'node_modules/tabris'"
I tried running the basic out-of-the-box tabris test app (using tabris init in an empty directory) and the same issue happened, so I am confident that this is not something to do with my app.
Some other details:
Using v2.0.0 of tabris.js, although this is happening with 2.0.0-rc2 as well
The last time this worked with the same code base for me was prior to my phone (a Nexus 5X) being upgraded to Android Oreo. I wonder if the Tabris.js 2 Developer app has any issues running in Oreo?
I know that the http-server is running correctly on my development machine, as I can navigate to http://[development-ip]:8080/package.json and get that file on my mobile device
I can confirm the issue with a project created with the CLI (version 2.0). The latest tabris dev app (2.1) does not work with tabris 2.0. You'd have to upgrade your projct to tabris 2.1:
npm install --save tabris#^2.1.0
The reason is that as of tabris 2.1 a bootstrapping file (boot.js) is now read from the tabris module. This file was included in the dev app before.
When you upgrade tabris-cli to the latest version, projects created with tabris init will not be affected by this problem.

JXCore not running on browser platform

I want a JXCore application that can run on android, ios and the browser platforms.
I have used the express sample project provided by JXCore and tested it on my android tablet without any problems. However when I run it on the browser platform, it doesn't seem to work. There are no errors but the output on the web page just says:
JXcore plugin: Device type is unkown. Defaulting to Android
Are there any additional configuration or plugins required for JXCore to run on the browser platform or is it not possible?
Cordova's "browser" platform just runs local nodejs server which hosts static files. Instead you can run nodejs server as hosted app and reach from browser.
You can see this jxcore cordova project which works without cordova too, just running jx www/jxcore/app.js command.

Resources