Use phonegap js to access native functionality without compiling an app? - javascript

Does anyone know if it is possible to use phonegap.js to access native functionality like the camera without compiling a mobile app? I would like to use it on a mobile-site and was curious if anyone knew of a way to do this?

If you take a look at the PhoneGap Docs for each OS it says you need to compile in order to work, so no, you cannot use it on a website to access native functionality. The camera cannot be accessed from a website, it needs to be a native app.
See this SO post for a possible workaround. I haven't tested it though. And yes, it still does require a native app to be built.

That isn't possible through any JavaScript interface.

PhoneGap is a JavaScript to native wrapper that maps JavaScript/HTML/css to the mobile platform's native SDK. Since PhoneGap is only a wrapper, a compilation step is required

Related

Is it possible to use JavaScript instead of Dart on Flutter to make cross platform mobile apps?

Is it possible to use JavaScript instead of Dart on Flutter to make cross platform mobile apps ?
Yes you can:
https://github.com/openkraken/kraken
I think this project is from Alibaba, and with it you can use js instead of dart, and then it will be rendered by flutter.
No, you can't. Flutter won't "compile" JS code, it is possible to use platform native code however (Swift, Obj-C, Java, Kotlin) to specific tasks.
Even if you want to use Flutter to create a web application, you need to write it in Dart.

React Native alternative for reCaptcha

First of all, I already check this lib and other similar one which basically wrap everything inside a WebView, that's not useful. Also this one is only for Android based on safetynet. afaik there is no native solution for using reCaptcha for ios. I was wondering what is the alternative solution for avoiding users to spam in our forms inside a React Native mobile app?
I used invisible google reCaptcha for my web app which works fine, but now I making a native app, but couldn't find a solution for this, anyone have a spugestion?
I wondering if somehow we can verify the client by iOS/Android device identifier maybe?

How to provide JavaScript library for mobile native apps?

I am not a mobile developer, hence please excuse me for incorrect assumptions, if any
I have a library which users want to integrate in their native mobile apps. It is written in JavaScript, but I don't want to rewrite for Android and iOS. Hence what I need is some way that this JavaScript library can be used in native apps. Following two ways look promising:
WebViews: The JS files would reside locally and webview will be used to run them
NativeScript: NativeScript allows you to create native apps from JavaScript. But I didn't find anything which suggests that I can create native library too. Can this be used in any way?
You might be looking for React Native
It is a Javascript framework, and when you write your code, most of the time, you can use the same code for iOS and Android. It is a relatively new framework, but can be very powerful for rapid cross-development, but (obviously) has its trade-offs.

Expose Android and iOS native code SDK to Javascript in Ionic

I actually found a third party plugin that I want to use on one of my project. The goal is to create an Ionic application for that to avoid wasting time coding in native for both Android and iOS.
The problem is that the plugin I found has only SDK for Android and iOS. After a discussion on their forum, a technical guy told me it was possible for me to use that on Ionic by creating a plugin to expose the code to the Javascript.
Do you know where I could start ?
Do you have any tips or advice on how I could do that ?
Thanks !
I actually found a third party plugin that I want to use on one of my project.
By plugin I understand you mean a Cordova plugin. A link would be nice.
a technical guy told me it was possible for me to use that on Ionic by creating a plugin to expose the code to the Javascript.
By creating a plugin to expose the code (of the Cordova plugin?) to javascript, I understand you want to make an Ionic wrapper for that Cordova plugin.
If so, first check that your plugin doesn't already have a Cordova wrapper in the list of those over at Ionic Native.
If not, then you can have a look at how all the other wrappers are already written and get started from there.
If you actually want to create your own cordova plugin, then here's a great tutorial by Ionic's CEO to help you out.

Do I need to learn Java to create an android app using phoneGap?

I am a web developer (PHP,javascript,html5) never created an android app with Java or any other language. My question is, do I need to learn Java to create apps for android and what should I know to create an awesome android app using phoneGap.
No unless you need at some step to code a native plugin.
But it would be useful for you to understand how phonegap works behind.
No. All you need to know are the basics of the language like including namespaces/imports, setting up some configuration files and some general familiarity with using IDEs.
You also won't need Java unless you are implementing some native functionality that is not provided by the PhoneGap API. For most simple apps a working knowledge of JavaScript, HTML and CSS will suffice.
you most probably won't need much of Java knowledge (if any), since PhoneGap applications are basically websites with (an optional) extra bit of JavaScript controlling the device
the only thing you might need Java for is when you upgrade your Cordova versions and you have some old plugins which need to update due to code deprecation

Categories

Resources