Comments (27)
Yes it support both Single Page Application and Multi Page Application as well.
If you have any doubts feel free to write us!
Thanks!
from androidjs.
I have tried to use vue but it is giving me blank screen, can you please add an example using SPA?
from androidjs.
This is the Hello World Example of Vue JS
build on Android JS
https://github.com/android-js/sample-app/tree/master/vue-js-example
no need to create server at all this is very simple example just by using html and vue js
if you have any doubts, feel free to write us !
Thanks!
from androidjs.
for debugging first run your app in browser.
open index.html
file in browser
and run main.js
file using node
from androidjs.
thank you sir, let me test it now
from androidjs.
when building the app, it always copy the phonon boilerplate app even thou i'm not using it and it increase the bundle size
from androidjs.
Did you generate the project with androidjs g
from androidjs.
If you are generating project like this, it will generate the sample phonon app
You should generate project from scratch
Try this: https://blog.usejournal.com/how-to-build-android-apps-with-node-js-using-android-js-2aa4643be87b
from androidjs.
I generated it from scratch but when I run androidjs build
in the /dist/app-debug/assets
folder, I always found that boilerplate even thou I don't have it in my views
folder
from androidjs.
from androidjs.
Update the androidjs-builder
to the latest version and delete the dist
folder and build again
from androidjs.
You can generate scratch app via androidjs g --example helloworld
from androidjs.
I updated the androidjs-builder
and now I'm getting this error
from androidjs.
User force command
androidjs b -f
from androidjs.
The main.js
does not run when I install the apk on my device.
from androidjs.
How do you come to know main.js
does not run?
from androidjs.
because when I try to invoke the functions in the main.js
there's no response
from androidjs.
Did you used IPC for making communication between Back Process
and Front Process
.
check out : https://android-js.github.io/androidjs/ipc.html
from androidjs.
I followed that, on development it is working fine but when I build and install apk on my device, there's no response from the server / main.js
from androidjs.
could you please share the code of index.html
and main.js
file ?
from androidjs.
main.js
app.js
index.html
from androidjs.
we fixed some bugs and sorry to say that
- you have to update
androidjs-builder
to the latest one again - and
androidjs.js
file as well because your are using older one new: android.js
and you have to update your app.js
file something like this:
new Vue({
el: '#app',
data: {
message: 'Hello Vue!',
number:"",
list: []
},
methods:{
call(){
app.call.makeCall(this.number)
},
server(){
front.send('Hello', this.number);
}
},
mounted(){
front.on('print', function(msg){
// because this.list says undefined
this.list = this.list || [];
this.list.push(msg)
let node = document.createElement('LI');
node.appendChild(document.createTextNode(msg));
document.getElementById('numbers').appendChild(node);
console.log(list);
})
}
})
and index.html
<!DOCTYPE html>
<html>
<head>
<title>Vue Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<style>
.app{
font-size:30px;
}
</style>
<body>
<div id="app" class = "app">
{{ message }}
<input type = "text" v-model = "number" /> <br />
<button @click="call">call</button>
<button @click="server">server</button>
<hr/>
<ul id = "numbers">
<li v-for="(a,i) in list":key="i">{{a}}</li>
</ul>
</div>
</body>
<script type="text/javascript" src = "../assets/androidjs.js"></script>
<script type="text/javascript" src = "../assets/app.js"></script>
</html>
and package.json
like this because in order to use Call API
you need to add android.permission.CALL_PHONE
permission to your package.json
file
{
"name": "vue_example",
"app-name": "Vue Example",
"package-name": "mypkg",
"icon": "./assets/icon/icon.png",
"dist-path": "./dist",
"permission": [
"android.permission.INTERNET",
"android.permission.CALL_PHONE"
],
"version": "1.0.0",
"description": "",
"main": "script.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"androidjs": "^1.0.5"
}
}
from androidjs.
thank you, I'll give it a try...
from androidjs.
on main
as shown below, can I name the script whatever I want or it is suppose to be main.js
or script.js
?
from androidjs.
It doesn't matter 😉
from androidjs.
lols it matters cause if I named it main.js
it works fine but if i named it script.js
my app crashes 😉😉😉
from androidjs.
lols it matters cause if I named it
main.js
it works fine but if i named itscript.js
my app crashes
I think that because of something else, may be
from androidjs.
Related Issues (20)
- cannot use ajax with jquery
- error in window.open();
- Node integration in frontend? HOT 1
- display: grid; HOT 15
- DOM problem HOT 1
- status bar and bottom bar not dissapearing no matter what
- Do you put the "app.location.get();" on the back or front?
- ️🔥 How/Where can we modify AndroidJS java base or extend androidjs react native layer through npm react native addons ?
- Failed to build apk
- Failed to load signer "signer #1" HOT 2
- Application startup delay
- Module "node:fs" crashes the app
- no apk HOT 1
- ReferenceError: TextDecoder is not defined
- APK installation fails after building for release
- MediaRecorder not accepted in browser HOT 1
- vue-cli
- build exe for desktop app
- ReferenceError: fetch is not defined (at backend) ???
- Let user choose PORT or change default PORT from 3000
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from androidjs.