--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Can we install web2py app on android Mobile as we install the apk files?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/1ZxFEB5j4XA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
import kivy from kivy.app import App from kivy.lang import Builder from kivy.utils import platform from kivy.uix.widget import Widget from kivy.clock import Clock from jnius import autoclass from android.runnable import run_on_ui_thread WebView = autoclass('android.webkit.WebView') WebViewClient = autoclass('android.webkit.WebViewClient') activity = autoclass('org.renpy.android.PythonActivity').mActivity class Wv(Widget): def __init__(self, **kwargs): super(Wv, self).__init__(**kwargs) Clock.schedule_once(self.create_webview, 0) @run_on_ui_thread def create_webview(self, *args): webview = WebView(activity) webview.getSettings().setJavaScriptEnabled(True) wvc = WebViewClient(); webview.setWebViewClient(wvc); activity.setContentView(webview) webview.loadUrl('http://www.web2py.com') class ServiceApp(App): def build(self): return Wv()
def on_start(self):
return True
def on_pause(self):
return True
def on_resume(self):
pass
def on_stop(self):
pass if __name__ == '__main__': ServiceApp().run()
# go into your project
cd myapp
# create a mobileapp folder for your app
cordova create mobileapp com.whatever.appname AppName
cd mobileapp
# add android
cordova platform add android
# compile the app
cordova build
# now, plug in your testing device, and let's run our test app on it
cordova run android
# if you don't have a device handy you can use an emulator (much slower)
## cordova emulate android
# install plugins for alerts and network information
# used to alert the user if they are not connected to the internet
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-dialogs.git
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git
<!doctype html>
<html lang="en">
<head>
<title>Zoggle</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script>
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
//navigator.splashscreen.hide();
if (navigator.network.connection.type == Connection.NONE) {
networkError()
} else {
loadApp()
}
}
function loadApp() {
navigator.app.loadUrl("http://www.web2py.com")
}
function networkError() {
navigator.notification.alert('web2py requires an internet connection')
var $net = document.createElement('div')
$net.innerHTML = 'web2py requires an internet connection'
document.body.appendChild($net)
}
</script>
<style>
body {
padding: 15px;
background: #23252e;
color: #01ced3;
text-align: center;
}
div {
font-size: 20px;
}
</style>
</head>
<body>
</body>
</html>