AndroidJS | Develop native Android applications with JavaScript
kandi X-RAY | AndroidJS Summary
kandi X-RAY | AndroidJS Summary
androidjs === author native and hybrid applications for the android operating system with pure javascript. androidjs a web tech abstraction orgy on top of android enabled by the crazy awesome droidscript project by mikael kindborg. rhino features --- - commonjs modules 1.1 implementation. - es5 compliant javascript interpreter. droidscript features --- - near complete access to the entire android sdk and then entire underlying java stack from javascript. - clean binding of rhino to the android lifecycle. - helpers for evaluating javascript from various sources. androidjs features --- - native android api wrappers to make things more natural to javascript. (and less java!) - awesome examples for creating native controls,
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates the application javascript
AndroidJS Key Features
AndroidJS Examples and Code Snippets
Community Discussions
Trending Discussions on AndroidJS
QUESTION
I will try to explain better, I made a NodeJS backend with integrated react UI that call localhost for local API/function integrated in NodeJS. Is there a way to make a porting of this solution to an APK? For now the only way to make NodeJS works on android is manually or with obsolete library like Androidjs
...ANSWER
Answered 2022-Feb-09 at 15:22Yes we can use Node.js using Termux however it is not quite recommended to run a backend server on Android.
QUESTION
I'm working on an Android app that allows non-programmers to program an educational robot using a visual programming language (Blockly based). This robot runs a lua virtual machine and can set up his own wifi network which I will connect to from my Android device.
The problemI need to send the code to the robot and I need to do this from inside the Android webview because it's important that the user can continue to see the block-based program while the robot executes it and sends back feedback to the mobile device (which will highlight the code blocks being executed in real time). So basically: I need to send and receive data from inside an Android webview through a raw tcp socket using my own communication protocol.
What have I tried?I've been searching information on how to solve this. So far I've learnt:
- Plain javascript: you can only use websockets which work with http protocol and don't support my custom protocol.
- React native: I think it would enable me to solve this since it's node.js based and node.js offers libraries that support raw sockets. (Discarded because apparently react native doesn't use webview)
- Androidjs: it's a framework that apparently would let me use node.js on my android app, the problem with this framework is that it doesn't seem to be very popular and the github seems to be a little abandoned, not sure if I should use this. Another problem is that I am not 100% clear on if it allows me use node.js packages inside the android webview.
ANSWER
Answered 2022-Feb-24 at 02:54I didn't find a way to use raw tcp sockets inside the webview.
However I was able to work around this problem binding a javascript interface to my webview which allows communication between the webview and the interface (a Java class), then in the interface I implemented the tcp socket easily since it's Java.
JavascriptInterface info: https://developer.android.com/guide/webapps/webview.html#BindingJavaScript
The way I used to communicate from Android to the webview was defining a javascript function in the js file running inside my webview, let's call it "myJsFunction()", which will be called using the WebView's loadurl() method, like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install AndroidJS
You can use AndroidJS like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the AndroidJS component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page