├── .gitignore ├── LICENSE ├── NOTICE ├── README.md ├── app ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── app │ │ ├── index.html │ │ ├── index.js │ │ └── subdirectory │ │ └── index.js │ ├── java │ └── io │ │ └── nodekit │ │ └── nodekitandroid │ │ └── MainActivity.java │ └── res │ ├── layout │ └── web_container.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── apptest ├── build.gradle ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── co │ │ │ └── synchealth │ │ │ └── apptest │ │ │ ├── JavaScriptBridge.java │ │ │ └── MainActivity.java │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ └── content_main.xml │ │ ├── menu │ │ └── menu_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── co │ └── synchealth │ └── apptest │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── nkcore ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── lib-core │ │ ├── _nodekit_bootstrapper.js │ │ ├── _nodekit_third_party_main.js │ │ ├── bindings │ │ ├── _delegates │ │ │ ├── filesystem │ │ │ │ ├── _browser_filesystem.js │ │ │ │ ├── _filesystem.js │ │ │ │ ├── binding.js │ │ │ │ ├── descriptor.js │ │ │ │ ├── directory.js │ │ │ │ ├── error.js │ │ │ │ ├── file.js │ │ │ │ ├── item.js │ │ │ │ └── symlink.js │ │ │ ├── stream │ │ │ │ └── _stream_wrap.js │ │ │ ├── tcp │ │ │ │ └── _tcp_wrap.js │ │ │ ├── udp │ │ │ │ └── _udp_wrap.js │ │ │ └── zlib │ │ │ │ └── pako │ │ │ │ ├── LICENSE │ │ │ │ └── lib │ │ │ │ ├── utils │ │ │ │ ├── common.js │ │ │ │ └── strings.js │ │ │ │ └── zlib │ │ │ │ ├── adler32.js │ │ │ │ ├── constants.js │ │ │ │ ├── crc32.js │ │ │ │ ├── deflate.js │ │ │ │ ├── gzheader.js │ │ │ │ ├── inffast.js │ │ │ │ ├── inflate.js │ │ │ │ ├── inftrees.js │ │ │ │ ├── messages.js │ │ │ │ ├── trees.js │ │ │ │ └── zstream.js │ │ ├── buffer.js │ │ ├── cares_wrap.js │ │ ├── constants.js │ │ ├── contextify.js │ │ ├── fs.js │ │ ├── fs_event_wrap.js │ │ ├── handle_wrap.js │ │ ├── http_parser copy.js │ │ ├── http_parser.js │ │ ├── index.js │ │ ├── natives.js │ │ ├── os.js │ │ ├── pipe_wrap.js │ │ ├── process_wrap.js │ │ ├── signal_wrap.js │ │ ├── smalloc.js │ │ ├── spawn_sync.js │ │ ├── stream_wrap.js │ │ ├── tcp_wrap.js │ │ ├── timer_wrap.js │ │ ├── tty_wrap.js │ │ ├── udp_wrap.js │ │ ├── uv.js │ │ ├── v8.js │ │ └── zlib.js │ │ ├── builtin-additions │ │ ├── asap.js │ │ └── promise.js │ │ ├── builtin-nodekit │ │ ├── electro.js │ │ ├── electro_protocol.js │ │ └── platform.js │ │ ├── builtin-replacements │ │ ├── buffer.js │ │ ├── crypto.js │ │ ├── dns.js │ │ └── timers.js │ │ ├── node.js │ │ ├── node │ │ ├── LICENSE-NODEJS-0.12.9 │ │ ├── _debugger.js │ │ ├── _http_agent.js │ │ ├── _http_client.js │ │ ├── _http_common.js │ │ ├── _http_incoming.js │ │ ├── _http_outgoing.js │ │ ├── _http_server.js │ │ ├── _linklist.js │ │ ├── _stream_duplex.js │ │ ├── _stream_passthrough.js │ │ ├── _stream_readable.js │ │ ├── _stream_transform.js │ │ ├── _stream_writable.js │ │ ├── _tls_common.js │ │ ├── _tls_legacy.js │ │ ├── _tls_wrap.js │ │ ├── assert.js │ │ ├── buffer.js │ │ ├── child_process.js │ │ ├── cluster.js │ │ ├── console.js │ │ ├── constants.js │ │ ├── crypto.js │ │ ├── dgram.js │ │ ├── dns.js │ │ ├── domain.js │ │ ├── events.js │ │ ├── freelist.js │ │ ├── fs.js │ │ ├── http.js │ │ ├── https.js │ │ ├── module.js │ │ ├── net.js │ │ ├── os.js │ │ ├── path.js │ │ ├── punycode.js │ │ ├── querystring.js │ │ ├── readline.js │ │ ├── repl.js │ │ ├── smalloc.js │ │ ├── stream.js │ │ ├── string_decoder.js │ │ ├── sys.js │ │ ├── timers.js │ │ ├── tls.js │ │ ├── tty.js │ │ ├── url.js │ │ ├── util.js │ │ ├── vm.js │ │ └── zlib.js │ │ └── platform │ │ ├── console.js │ │ ├── crypto.js │ │ ├── fs.js │ │ ├── process.js │ │ ├── tcp.js │ │ ├── timer.js │ │ └── udp.js │ └── res │ └── values │ └── strings.xml ├── nkelectro ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── lib_electro │ │ ├── _nke_main.js │ │ ├── _nke_renderer.js │ │ ├── app.js │ │ ├── browserwindow.js │ │ ├── electro.js │ │ ├── ipcMain.js │ │ ├── ipcRenderer.js │ │ ├── menu-item.js │ │ ├── menu.js │ │ ├── protocol.js │ │ └── webcontents.js │ ├── java │ └── io │ │ └── nodekit │ │ └── nkelectro │ │ ├── NKE_App.java │ │ ├── NKE_BrowserWindow.java │ │ ├── NKE_Event.java │ │ ├── NKE_IpcMain.java │ │ ├── NKE_IpcRenderer.java │ │ ├── NKE_Protocol.java │ │ ├── NKE_WebContents.java │ │ ├── NKE_WebContents_AndroidWebView.java │ │ └── NKElectro.java │ └── res │ └── values │ └── strings.xml ├── nkscripting ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ └── lib-scripting │ │ ├── init_androidwebview.js │ │ ├── native_module.js │ │ ├── nkscripting.js │ │ ├── promise.js │ │ └── timer.js │ ├── java │ └── io │ │ └── nodekit │ │ └── nkscripting │ │ ├── NKApplication.java │ │ ├── NKScriptContext.java │ │ ├── NKScriptContextFactory.java │ │ ├── NKScriptExport.java │ │ ├── NKScriptSource.java │ │ ├── NKScriptValue.java │ │ ├── channelbridge │ │ ├── NKScriptChannel.java │ │ ├── NKScriptInvocation.java │ │ ├── NKScriptMessage.java │ │ ├── NKScriptTypeInfo.java │ │ └── NKScriptValueNative.java │ │ ├── engines │ │ └── androidwebview │ │ │ └── NKEngineAndroidWebView.java │ │ └── util │ │ ├── NKArchiveReader.java │ │ ├── NKDisposable.java │ │ ├── NKEventEmitter.java │ │ ├── NKEventHandler.java │ │ ├── NKLogging.java │ │ ├── NKSerialize.java │ │ ├── NKStorage.java │ │ ├── NKTimer.java │ │ └── NKTimerTask.java │ └── res │ └── values │ └── strings.xml └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # IntelliJ and BuildShip 36 | *.iml 37 | .idea/ 38 | .project 39 | .classpath 40 | 41 | # Keystore files 42 | # Uncomment the following line if you do not want to check your keystore files in. 43 | #*.jks 44 | 45 | # External native build folder generated in Android Studio 2.2 and later 46 | .externalNativeBuild 47 | 48 | # Google Services (e.g. APIs or Firebase) 49 | google-services.json 50 | 51 | # Freeline 52 | freeline.py 53 | freeline/ 54 | freeline_project_description.json 55 | 56 | # fastlane 57 | fastlane/report.xml 58 | fastlane/Preview.html 59 | fastlane/screenshots 60 | fastlane/test_output 61 | fastlane/readme.md 62 | 63 | .cxx/ 64 | org.eclipse.buildship.core.prefs 65 | 66 | node_modules/ 67 | unused/ -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | NodeKit 2 | Copyright (c) 2016-9 OffGrid Networks. All Rights Reserved 3 | 4 | This product includes software developed at OffGrid Networks 5 | for NodeKit (http://nodekit.io/). 6 | 7 | Portions Copyright (c) Guy Barnard 2016-7 -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion rootProject.compileSdkVersion 5 | buildToolsVersion rootProject.buildToolsVersion 6 | 7 | defaultConfig { 8 | applicationId "io.nodekit.nodekitandroid" 9 | minSdkVersion rootProject.minSdkVersion 10 | targetSdkVersion rootProject.targetSdkVersion 11 | versionCode rootProject.versionCode 12 | versionName rootProject.versionName 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | api fileTree(dir: 'libs', include: ['*.jar']) 24 | testImplementation 'junit:junit:4.12' 25 | api "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion" 26 | api project(":nkscripting") 27 | api project(":nkelectro") 28 | } 29 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in C:\Users\Guy\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/assets/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | HELLO WORLD 3 | -------------------------------------------------------------------------------- /app/src/main/assets/app/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016 OffGrid Networks. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | const nodekit = require('electro').app, 18 | BrowserWindow = require('electro').BrowserWindow, 19 | protocol = require('electro').protocol; 20 | 21 | console.log("STARTING SAMPLE ELECTRO APPLICATION"); 22 | 23 | protocol.interceptInternalProtocol("internal"); 24 | 25 | const functionExport = require("./subdirectory") 26 | 27 | functionExport() 28 | 29 | const secondFunction = require("./subdirectory/index") 30 | 31 | secondFunction() 32 | 33 | var last = now() 34 | var counter = 0 35 | var timerId = setInterval(function() { 36 | const newTime = now() 37 | console.error("delta :" + (newTime - last)) 38 | last = newTime 39 | counter += 1 40 | if (counter == 5) { 41 | clearTimeout(timerId) 42 | } 43 | }, 2500) 44 | 45 | setTimeout(function() { 46 | console.log("single timer fire") 47 | setTimeout(function() { 48 | console.log("second timer fire") 49 | }, 2000) 50 | }, 15000) 51 | 52 | console.log("variadic", "args", "test", {}, new Date()) 53 | console.warn("variadic", "args", "test") 54 | console.error("variadic", "args", "test") 55 | console.info("variadic", "args", "test") 56 | console.dir("variadic", "args", "test") 57 | 58 | nodekit.on("ready", function() { 59 | 60 | var p = new BrowserWindow({ 'preloadURL': 'internal://localhost/app/index.html', 61 | 'nk.allowCustomProtocol': true, 62 | 'nk.taskBarPopup': true, 63 | 'nk.taskBarIcon': 'MenuIcon', 64 | 'width': 300, 65 | 'height': 600 66 | }); 67 | 68 | console.log("Server running"); 69 | }); 70 | 71 | function now() { 72 | return new Date().getTime() 73 | } -------------------------------------------------------------------------------- /app/src/main/assets/app/subdirectory/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | module.exports = function() { 4 | console.log("function export") 5 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/web_container.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 17 | 18 |