I would like to know if you can send/recieve information from a Bluetooth device such as a headset or something of the sort. As well as if this is possible using JavaScript. The app I use to code JavaScript is called "DroidScript", which allows you to make apps using JavaScript and HTML.
If you are using DroidScript then you will probably need to create a DroidScript plugin in Java (assuming DroidSCript does not already do what you want).
Note: The latest alpha version of DroidScript can generate template AIDE projects for creating DroidScript plugins.
Related
I want to use a JavaScript library in my mobile Flutter project. Here is the link for this library on github.
Library
How can I use this library and a function(aboutnumber()) from it in my project? How can I import this library to a project and how to access its function?
You can use https://pub.dev/packages/flutter_js package.
It allows to evaluate pure javascript code inside mobile and desktop flutter apps. By pure, I mean the package is not a browser engine, so no web API , localstorage or another browser api are available. But you can bundle some javascript code containing javascripts libraries like moment, ajv and maybe the one you related in your question if it relies only in javascript. The flutter_js injects into the javascript engine, things like console.log, xhr and fetch. But it is all. There is a send message channel which you could use to inject objects into the engine which you could provide objects which will be implemented and dart, but will be shared into the javascript global space.
In Flutter web, the javascript integration is possible using the package:js, mentioned in another answer.
Disclaimer: I'm the author of the flutter_js package
This is not possible on any platform other than the web, as described in the JS interop documentation.
On the Web, package:js can be used.
As mentioned in this other similar question, there's also webview_flutter, which embeds a whole web view onto Flutter, and that's an official Flutter package as well.
I am using React native to create an iOS app; So my code is in javascript and some objective-c.
Now i wan't to implement KISSmetrics in my project, i have done the proper setup based on kissmetrics documentation, but when it comes to create events and user identifications etc… i have to use data from my javascript code.
Does anyone knows how to do that? for example:
the objective-c code to identify the user is this: [[KISSmetricsAPI sharedAPI] identify:#"name#email.com"]; but how can i get the code that gets the identity of the user and replace the name#email.com from my javascript code?
I would look here to find out how to build a native module bridge. The way it works is that you create an iOS native module with methods that you can actually call from JavaScript by which you can send your data from JS to Obj-C.
Here's an example project that does this:
https://github.com/idehub/react-native-google-analytics-bridge
You don't need to turn it into a full-fledged NPM library, you can just simply create the necessary native files and JS files on the fly in your project.
Also, if you don't know already, remember to rebuild the iOS project (hit the Play button) to see your changes because the native side doesn't have Live Reloading.
Node.js v6 includes a module that provide cryptographic functionality, including sign and verify functions.
If there isn't a way to sign or verify signatures maybe is there a way to port Node.js module to Cordova or Phonegap?
Basically what i need is way to sign messages and verify the signature from a Cordova App.
https://nodejs.org/dist/latest-v6.x/docs/api/crypto.html#crypto_class_sign
I found what i was looking for:
http://kjur.github.io/jsrsasign/
Here a demo of how to generate,sign and verify keys:
http://kjur.github.io/jsrsasign/sample-ecdsa.html
Incredible, it's pure javascript. So is going to work in both platforms iOS and Android.
My only concerns is to know how secure is use this library for key generation. At least i can generate the keys and send it using secure channel, later sign/verify using the App.
Android has a class to to sign and verify signatures, aptly named Signature.
IOS has similar functionality.Write a cordova plugin which wraps these classes.
Apart from some basic functionality that is provided by webview, everything in cordova is provided via plugins that uses underlying native platform. Thus, it is possible to to sign or verify signatures in Cordova. But it may be more effort than you are willing to do.
It is not possible to execute Node code inside a cordova app, only in hooks, but there are several cryptographic libraries in javascript, which maybe can help you
Check cryptojs, or this plugin for cordova
I need to create an internal admin app. The app needs to be able to:
For V1
- Wrap and execute javascript code
- Will not rely on any iOS code other than perhaps the code necessary to load the javascript.
- Uses local storage
For V2
- Work offline (which means javascript code needs to be loaded in)
Any ideas on how to go about implementing such a thing?
By far the easiest and best supported way is to use Apache Cordova. They did all the work of wrapping a Webview in a native app and have a rich set of plugins for integration with all kinds of mobile APIs.
Since the app will be running in an embedded browser you can simply access the normal Localstorage APIs.
The Cordova tutorial by #ccoenraets may be a good way to get started.
From my findings the following two are great solutions:
Ionic
Apache Cordova
Iam using PhoneGap/Cordova + Backbone for developing a cross platform mobile application. Using phonegap i can access almost all the functions of the device. Is there somehow possible to access or change the device's profile using PhoneGap or using backbone ? I searched a lot but couldn't find any relevant results..!!
Is there any documentation available on this ?
Any help will be very much appreciated..!!
I didnt get what you means about "device's profile". You talking about accounts?
About Phonegap/Cordova you can do everything that a native app can. But sometimes you need to write a native plugin to interact with device. I already had to do that to do push notifications using a third lib.
You write a native class to do something, register it in plugins, give permissions and then call it with your javascript.
You can find documentation here: http://cordova.apache.org/docs/en/3.4.0/guide_hybrid_plugins_index.md.html#Plugin%20Development%20Guide
Add this cordova plugin into your project.
https://github.com/apache/cordova-plugin-device
Put these line of codes into your view page
alert(device.cordova);
alert(device.model);
alert(device.name);
alert(device.platform);
alert(device.uuid);
alert(device.version);