Afdrukken
Categorie: Windows and Android
Hits: 8193

Gebruikerswaardering: 5 / 5

Ster actiefSter actiefSter actiefSter actiefSter actief
 


My intention was to combine a Android device with a ESP8266/Arduino and take advantage of many Android capabilities in HTML5+JavaScript. The result is an Android Bridge to and from Javascript and a few other options.

Forget building native mobile Android applications with PhoneGap, Cordova & Co!
Use this Android WebView APP and write the code directly in HTML+JavaScipt. Save your html and js files on SD and load them in the WebView with the HTML-button (last img. step 1).
Android minimum version 17 (Kitkat v4.2) (Old device? You can install a custom ROM. My old Acer Iconia Tab A500 runs on Kitkat v4.4.4)
WARNING: Protect your self wen using Android WebView, use only locally stored files!!!

In Android Bridge to/from JavaScript:

In JavaScript:

Building a hybrid Android WebAPP in HTML5+ JavaScript
With all these options, it's easy to create an Android APP. Use in JavaScript that what you need. Use the code in the demo files AndroidInHtml.html and AndroidInHtml.js as a guide.
But you can also control a ESP8266, Arduino, ... with JavaScript using USB or (W)LAN. Then, you have a ESP8266/Arduino with touch screen and HTML5 Local Storage to Save and Load data on Androids SD card.
HTML5 Local Storage:
  localStorage.setItem(KEY, DATA);
  DATA = localStorage.getItem(KEY);
  localStorage.removeItem(KEY);   

Use HTML5 Canvas for a graphic UI, get a Widget library or goto jQuery Widget Factory.

Load local HTML like this: file:///storage/extSdCard/AndroidInHtml/AndroidInHtml.html
TIP:
Use (ES File) Explorer to copy the fullpath ;-) and follow steps 1-4.