분류 전체보기69 node with android const express = require('express');const app = express();app.get('/', (req, res) => { res.send('Hello from Node.js in Cordova!');});app.listen(3000, () => { console.log('Server running on http://localhost:3000');});document.addEventListener('deviceready', function () { var nodejs = require('nodejs-mobile-cordova'); nodejs.start('main.js'); nodejs.channel.setListener(function (msg) { co.. 2025. 4. 7. deepReplace const deepReplace = (data, targetValue, newValue) => { if (Array.isArray(data)) { return data.map(item => deepReplace(item, targetValue, newValue)); } else if (typeof data === 'object' && data !== null) { return Object.fromEntries( Object.entries(data).map(([key, value]) => [key, deepReplace(value, targetValue, newValue)]) ); } else { return data === targetValue ? newValue : .. 2025. 4. 4. android dockerfile name: Build Cordova Android Appon: push: branches: - main pull_request: branches: - mainjobs: build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install required dependencies run: | sudo apt-get update sudo apt-get install -y wget unzip - name: Set up Java 17 uses: actio.. 2025. 3. 10. date now 개선 Date.now()는 밀리초 단위의 타임스탬프를 반환하지만, 내부적으로 시스템 타이머의 해상도와 JavaScript 엔진의 최적화에 따라 정확도가 제한될 수 있습니다. 특히 Android 환경에서는 Date.now()가 일정 주기마다 정렬(alignment)되는 과정에서 2~3ms 정도 튀는 현상이 발생할 수 있습니다.더 높은 정밀도를 원한다면 다음 대안을 고려해 볼 수 있습니다.1. performance.now()Cordova에서 performance.now()를 사용하면 Date.now()보다 정밀한 시간을 얻을 수 있습니다. • 마이크로초(μs) 단위의 해상도를 제공하며, • Date.now()와 달리 시스템 시계(clock)의 조정 영향을 받지 않습니다.console.log(performance... 2025. 2. 21. 이전 1 2 3 4 ··· 18 다음