11-06-2017 21:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-06-2017 21:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I am having some issues in communicating with the companion. It seems to start only once in a while.
My starting code is the same as of a new project from studio with file transfer.
Companion starts only once in a while. Also timestamp seems to be completely off. Please see below.
Is there a basic launch code to insert in the app/index.js so that it goes straight to start companion code?
- [9:05:03 PM]App Started[HOST]
- [9:08:02 PM]App Closed[HOST]
- [9:08:22 PM]App Started[HOST]
- [9:08:49 PM]App Closed[HOST]
- [9:11:01 PM]App Started[HOST]
- [9:12:38 PM]App Closed[HOST]
- [9:12:43 PM]App Started[HOST]
- [8:51:02 PM]Loaded and evaluated: file:///android_asset/bootstrap.js[HOST]
- [8:51:02 PM]Companion Started
My code in the app:
import document from "document"; import { inbox } from "file-transfer"; import fs from "fs"; // console.log("App Started"); let statusText = document.getElementById("status"); statusText.innerText = "Waiting..."; // Event occurs when new file(s) are received inbox.onnewfile = () => { console.log("New file!"); let fileName; do { // If there is a file, move it from staging into the application folder fileName = inbox.nextFile(); if (fileName) { console.log(`Received File: <${fileName}>`); let data = fs.readFileSync(fileName, "json"); statusText.innerText = `Received: ${data}`; } } while (fileName); };

11-07-2017 11:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


11-07-2017 11:14
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Please retry with the new firmware which is coming very soon!
12-13-2018 06:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

SunsetRunner
12-13-2018 06:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Still actual even using latest firmware.

