How to use Javascript Core (JSC) on Android? - javascript

I am trying to run a JSC (https://github.com/facebook/android-jsc) on an Android app. I can't find any API to use it with. Can you guide me to any resource?

Using gradle
implementation 'org.webkit:android-jsc:r174650'
But if you download aar file e.g. http://central.maven.org/maven2/org/webkit/android-jsc/r174650/android-jsc-r174650.aar Then classes.jar will be empty in it. There are avaliable only jni binaries

Related

How to mimic node.js loading mechanism of node_modules in chrome extension

I recently started working on a chrome extension project.
I need to consume some third party libraries and I am planning on adding their minified version to my project.
In node.js there is a loading mechanism that allow me to import any package in node_module without adding that path to the node_module.
I'm trying to mimic this behavior in my extension. My question is how to do it? I've read and investigated plenty in MDN and many other site but the only reference I found for this use case was in Typescript and in Webpack, which I cannot use in this project.

Can you use a npm package without using NodeJS

I found a library on github that I would like to use but the download instructions only mention using npm but I am not using a NodeJS project (just a basic html,css,javascript front-end with no back-end server). Am I still able to use that library or is it a lost cause? Is there another way to download it without using npm?
Is there another way to download it without using npm?
If it's on github, then you can checkout or fork the repository as you can with any other git repo.
Am I still able to use that library or is it a lost cause?
Whether or not the library will work without Node will depend on the library.
If it presents itself as a Node module, then you'll probably have to modify it (or find a compatible module loader for browser-side JS).
If it depends on NodeJS features (such as the filesystem API) then you'll be out of luck (unless, for example, you polyfill them to work across HTTP)
If you use a build tool such as browserify, or webpack, you can author scripts that require node modules and the build tool will generate a script that includes all the necessary dependencies (assuming that the necessary dependencies are compatible with client-side JavaScript environments).
Downloading dependencies would still be done via npm, but only for local development. Your server would only need the generated script.
Alternatively, if the script is on github or any other repo online you may be able to download it directly. Many modules are published using UMD, which would allow you to use the script using various inclusion methods.

Can I access Device-Hardware when compiling Apps using PhoneGap-Build

I´m building my first App(HTML, CSS & JS) for iOS and Android and I´d like to use PhoneGapBuild for compiling my App so I don´t need to install Android and iOS SDK and PhoneGap on my Machine.
Can I use the Phone-Hardware? Do I have to include some cordova.js to get those objects n functions?
thx
You can access accelerometer, camera, compass and other features of the device.
Currently, PhoneGap 2.7.0 is supported by PG Build. API documentation can be found here:
http://docs.phonegap.com/en/2.7.0/index.html
For PhoneGap Buld, you don't need to include cordova.js, it will be injected by the build service, automatically. You can include the following code as a placeholder, but don't include the actual file in your source.
<script src="phonegap.js"></script>

Need to make a packaged app for Chrome using eclipse

I've been having a hard time trying to figure out how to create a packaged app using eclipse. I have the GWT plugin installed and I can make a web application. I looked at the tutorial and looked to see how to do that. Is there any way for me to convert that web app into a packaged app that has the .html, .css, the manifest, ect. If not, what plugins do I need to write a packaged app in eclipse. Thanks for the help
You can easily push a GWT app (with normal restrictions) as a Chrome extension.
For a Start Read these -
Tutorial 1 - http://blog.tomtasche.at/2011/08/chromegwt-building-chrome-extensions.html
Tutorial 2 - http://tech-drum.blogspot.in/2012/06/building-chrome-extensions-with-gwt.html
You can also try and use this for reference - gwt-chrome
Note - There is a issue logged against GWT for making this process easy. "Star" it please.
The difference between a Packaged App and a Hosted App is the offline behavior
a Packaged App is an install able application on browser and an Web App is hosted from a web server and wont offline.
But you are able to run the packaged when the browser is offline with help of .json file ..hardly calling as manifest.json
Helloworld Packaged App
Chrome article on Packaged apps
Finally you need not to use Eclipse to create a packaged file because all of them are normal files (.html,.js,.css......).If you want use to browse the files easily and for better maintanace you can use it .
I

Run JavaScript file in NetBeans/Eclipse?

Is there a way to run a JavaScript file directly in NetBeans or Eclipse?
I feel it's time consuming to fire up a terminal, browse to that file and run it with node all the time.
Another NetBeans Node.js plugin with a Node.js project type and npm integration (I am the author of it) is described in NetBeans Tools for Node.js
Yes, you can debug using Rhino in "Run As" without leaving Eclipse:
http://wiki.eclipse.org/JSDT/Debug
http://www.eclipse.org/webtools/jsdt/debug/
If you'd like to debug it remotely on a Node.js instance, you can use:
https://github.com/ry/node/wiki/Using-Eclipse-as-Node-Applications-Debugger
If you'd like to remote debug a Chrome/Chromium browser:
http://code.google.com/p/chromedevtools/wiki/EclipseDebugger
The latter two options will use V8, which is Google's JS engine behind Chrome, which has also been implemented in Node.js. The first option will use Rhino, which is Mozilla's JS engine.
Yes, you can run a JavaScript file directly from the NetBeans IDE with the Node.js plugin:
Download NodeJS plugin from netbeans.org

Categories