following html code i could opening(see the svg) and running in the firefox of window7.
While i open it with webview in B4A. I just see svg but updateTime isn't running.
P.S attachied file is the HTML files !
While i open it with webview in B4A. I just see svg but updateTime isn't running.
P.S attachied file is the HTML files !
B4X:
<script language='javascript' type='text/javascript'>
var container = document.getElementById('container');
var graphic = archer.create(container);
graphic.loadUrl('archer.graphic.svg', 'archer.config.json');
graphic.on('ready', function() {
graphic.view.zoomToFit();
setInterval(updateTime, 10);
});
function updateTime() {
var now = new Date();
var seconds = now.getSeconds();
var minutes = now.getMinutes() + (seconds / 60);
var hours = now.getHours() + (minutes / 60);
graphic.setValue('hours', hours);
graphic.setValue('minutes', minutes);
graphic.setValue('seconds', seconds);
}
</script>
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("page1")
'If page <> "" Then
Page1.Initialize("page1")
Activity.AddView(Page1, 0dip, 0dip, 100%x,100%y)
Page1.LoadURL("file:///android_asset/" & page & "clock.html")
Page1.JavaScriptEnabled=True
'End If
End Sub
Attachments
Last edited: