How to create webview in apache cordova for all platforms - apache

I want to create an mobile webview application in Apache Cordova using Visual Studio 2013; also, I want to handle features of mobile like camera,back button.
I have gone through the following Apache Cordova documentation:
https://cordova.apache.org/docs/en/4.0.0/guide_hybrid_webviews_index.md.html
According to this link ,3 different webviews need to be created but I want to know whether it is possible to create just one webview which will support Windows phone, Android and iPhone?

The embedded webview you're referring to is really a special case where you want to have a Cordova-based webview inside of a native app. Is that what you really want to do? If you just want to build a normal Cordova app that will run on your three platforms it's easily doable, just follow the instructions here: https://cordova.apache.org/docs/en/4.0.0/guide_cli_index.md.html

Related

Can we use a signle ionic-4 app for mobile and desktops

I am developing an ionic-4 app, Ionic provides cross platform apps but I am a bit confused and my confusion is can I use a single ionic-4 application for mobiles(e.g. Android and IOS) and desktops browsers(Chrome, firefox etc.) as website. Is it possible by using ionic version 4.
Yes, Ionic 4 provides a single code for the execution of multiple platforms.
Ionic Doc
here is help for you. You can check everything.
Yes, you can use Ionic for Android, IOS and Browser. Once the coding is done, you can add any platform to make its build. For example, if you add Android platform then you can take an Android build(APK).Before that you need to setup an environment for that . For example, you need Android studio for taking Android build and Xcode for taking IOS build. It's all depends on the platform that you use.
Please go through Ionic documentation and Youtube tutorials to get a correct picture.
Thank you

How to test mobile apps on different devices

I want to test my IOS,Android and hybrid apps on various virtual devices. Please suggest me a good tool that can perform these functions.
We currently use Genymotion for testing with Android and XCode's simulator for iOS. These will allow you test a wide range of iOS/Android devices.
If you are looking for one tool to test both iOS and Android I believe Visual Studio's Xamarin supports both, there is also a browser based solution with appetize.io. I haven't used either of those so can't comment on if they are any good.
You can make use of chrome developer toolbar it has most of the device options like device horizontal/Vertical, Zoom
You get the different versions along with the different screen sizes in the simulator which you are working.
Eg: IOS(xcode) when you build it you get which version to build when running the application. Same for Android and hybrid apps

Difference between React-native and Electron

I want to build a simple read-only app which should run on Android, iOS, Windows, OSX and Linux.
Does electron support mobile platform?
I couldn't figure out which one should I go for.
Electron include chrome engine to render web pages as Native apps with support for different plugins to add desktop apps features.
Electrino doesn't include any render engine it uses the Safari engine on the Mac so the installation file is smaller than Electron.
There's no support for Windows yet.
React Native is using a cross-platform render to Android and iOS.
Example: <Text> on Android will be TextView and on iOS will be UITextField
React Native Web made React Native work on web
Example: <Text> on web will be <p> or <label> not sure
and after that, it can work on the desktop by electron
You can build universal apps by using this template by React Native code.
Also if you want a specific target you can add component.web.js or .electron.js
or .android.js or .ios.js so it will render to this target only
https://github.com/react-everywhere/re-start/tree/react-16
Take a look at PWAs. These can be installed on almost all the major mobile and desktop platforms plus it is a web app.
https://developers.google.com/web/progressive-web-apps
Electron does not support mobile platforms, but it will be difficult to use one framework for mobile apps and computer apps.
I would recomment to use phonegap for mobile and electron for the computer application

Cordova Plugin to be used in Worklight, for geofencing in Background even if the app is suspended/terminated and also when the phone restarts

I have been investigating in this feature for a long time. All I can find is a pure iOS native code that checks for the key "UIApplicationLaunchOptionsLocationKey" from the LaunchOptions, if it is found it calls the LocationManager to start it and keep on listening to the location updates.
You can find this code in this github:
https://github.com/voyage11/GettingLocationWhenSuspended
I need the same concept, but with a way to integrate it in Worklight, through cordova plugin or something. As I'm already creating the geofencing triggers using the hybrid Worklight APIs, I need to keep the geofencing alive even when the app is suspended/terminated and also if the phone is restarted.
Please I need you support urgently. Thanks
Worklight provides the ability to create Cordova plug-ins.
You could implementing your own native code then, mimicking that from the Xcode project you've found on GitHub.
Read more here: Adding native functionality to hybrid applications

Getting sproutcore application files to use them in a native app via Appcelerator Titanium

I would like build a app using sproucore framework, but i also want to integrate it with Titanium to have some desktop capability like file system, packaging, offline working etc...
I know that with sproutcore 2 this would be pretty easy since it allows to use the framework like a normal javascript library. But the project is still in beta and the docs are patchy at most (I consider patchy even the 1.x docs, actually).
So, I want to ask, which would be the best way to go to integrate sproutcore and Titanium API?
Titanium's main mission is to use JavaScript to build native apps, not to provide a OS-access layer for web apps. It would be hard to mix native and SproutCore UI elements.
That being said, here's some information that might help you:
Titanium has reversed it's application model starting with version 1.0:
http://developer.appcelerator.com/question/71/what-happened-to-html--css
The main app doesn't run in a web view anymore, instead it runs directly in JavaScriptCore and creates only native UI elements. One of the native UI elements is a web view
(http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.WebView-object)
and it's possible to make that full screen and run your SproutCore app inside of the web view. From there, you can call out to Titanium to call Titanium methods for file system access and the like.
Also, if you only target the desktop, you could even access the JavaScript context object of a webview and use it directly in JavaScriptCore.
Johannes