Can we use a web2py app on Android mobile?

1,191 views
Skip to first unread message

RAGHIB R

unread,
Jan 4, 2016, 9:20:53 PM1/4/16
to web2py-users

Richard Vézina

unread,
Jan 4, 2016, 9:24:32 PM1/4/16
to web2py-users
Why not?

The new welcome use BS3 which is mobile first CSS library since version 3 : http://getbootstrap.com/css/

Richard

On Mon, Jan 4, 2016 at 4:20 PM, RAGHIB R <raghi...@iiits.in> wrote:
--
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.

RAGHIB R

unread,
Jan 4, 2016, 9:28:46 PM1/4/16
to web2py-users
Can we install web2py app on android Mobile as we install the apk files?

Richard Vézina

unread,
Jan 4, 2016, 9:38:40 PM1/4/16
to web2py-users
No... But long time ago there where some report about succeed installation of web2py into android... Though I don't think it really usefull, better write an android native app if it is what you are search for... web2py is for writting web application, site web which behave like an application... A lot of mobile app are actually only wrapper around web application... So you may consider this option, write your app with web2py and wrapp it into a mobile native app gateway... But this kind of app are often not that interresting from user stand point... I mean you don't have a good mobile app user experience with them most of the time because they to simple that you can just access the real web app and it could be even better...

Richard

On Mon, Jan 4, 2016 at 4:28 PM, RAGHIB R <raghi...@iiits.in> wrote:
Can we install web2py app on android Mobile as we install the apk files?

Alessio Varalta

unread,
Jan 9, 2016, 9:46:41 PM1/9/16
to web...@googlegroups.com
I think is possibile to develope one page with text for a view  window page for example of a product change css for mobile..you can't upload on google market but on the web and the user can see this correctly..for Google market or for manage application required that you programming in Android or with another framwork specific for developer on mobile

Andrew Buchan

unread,
Jan 11, 2016, 12:17:14 PM1/11/16
to web...@googlegroups.com
Just to butt-in on what Richard said:

"But this kind of app are often not that interresting from user stand point... I mean you don't have a good mobile app user experience with them most of the time because they to simple that you can just access the real web app and it could be even better..."

That's not really true anymore...

What you are referring to are hybrid apps, which is essentially a mini-website (HTML, JS, CSS) wrapped in a package and rendered in a native webview, as opposed to a native app which is built in objective-C or Java.
Hybrid apps can access the phone's features such as camera, battery, geolocation, accelerometer etc... So you can do much more than you would by accessing a web app in the browser!
Hybrid performance is also more than adequate for most applications, and many of today's top apps are hybrid (in fact I challenge you to find out which apps on your phone are hybrid and which are native...)

What's more, with tools like cordova you can target both Android and iOS (with caveats) with the same code.
You also get to use the latest Javascript frameworks, such as AngularJS or ReactJS.

My advice would be to learn js and angular then go down the ionic (http://ionicframework.com/) path. I really don't see a case for bringing web2py into android.

Edit:

What Alessio said isn't true either. You can publish hybrid apps to Google play and Apple's app store.

Here's a useful page:




On Monday, January 4, 2016 at 9:20:53 PM UTC, RAGHIB R wrote:

Alessio Varalta

unread,
Jan 11, 2016, 9:31:58 PM1/11/16
to web2py-users
Sorry, , you are right. Now i have developed only in Android now in these day for a project i start to study cordova and is true that you can upload on Google market this my first time with Hybrid app

eric cuver

unread,
Jan 12, 2016, 2:12:01 PM1/12/16
to web2py-users
you can also do this with web2py you just need to create a webview with Cordova or Kivy with the URL of your mobile website view. Me this is what I do and it works without problems

Andrew Buchan

unread,
Jan 12, 2016, 2:53:44 PM1/12/16
to web...@googlegroups.com
@eric That's interesting... So essentially you'd get an "app" on your mobile, but it just opens to a webpage on a server.
That is probably the best solution offered so far although you need to be connected to and also don't get access to phone's features like contacts, notifications etc...


--
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.

eric cuver

unread,
Jan 13, 2016, 2:58:29 PM1/13/16
to web2py-users
half of the applications being used are not native. Facebook, uber,instagram etc ... all his  companies were not going to rewrite their applications for each platform in java for android, iphone in objective c, blackbery etc ... there is an article on the topic http : //kennethormandy.com/journal/your-favourite-app-isnt-native

eric cuver

unread,
Jan 13, 2016, 2:58:29 PM1/13/16
to web2py-users
there are several solution all depends on your application. facebook use 2 adress  url www.facebook.com for the web and when you go through the mobile it is this address that is used https://m.facebook.com/

If you want to create video games for example I think it's better to do it in native. Now for notifications exist for example in  HTML there are  things like this https://pusher.com/tutorials/realtime-notifications I think that there are more. To access the camera you have api in html like this http://bridgeit.mobi/html5-camera-access.html.   
 look this website you are all api html for mobile http://mobilehtml5.org/       as I say it depends on what you want to do

Le mardi 12 janvier 2016 15:53:44 UTC+1, Andrew Buchan a écrit :

Mathieu Clabaut

unread,
Jan 13, 2016, 3:50:12 PM1/13/16
to web2py-users
A bit out of topic, but also note that with the help of the nice termux android app, you can develop and run the web2py server on your android…
Quite nice when you're far from a real computer…

-Mathieu

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.

eric cuver

unread,
Jan 13, 2016, 5:13:46 PM1/13/16
to web2py-users, mat...@clabaut.net
a parenthesis between French Mathieu you're French?

Ron Chatterjee

unread,
Jan 27, 2016, 3:48:00 PM1/27/16
to web...@googlegroups.com
Any documentation of using  Cordova or Kivy using a hosted web2py  app? If a site is hosted using bootstrap3 and html5 its mobile friendly anyway. 

eric cuver

unread,
Jan 30, 2016, 4:56:18 PM1/30/16
to web...@googlegroups.com
You create your application mobile friendly

for kivy

After installation kivy :

you create main.py 
and you paste this code there are others codes but it's just an example :

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()

on line  webview.loadUrl('http://www.web2py.com') you put  url from your webapplication
then you can compile for android for example. there are others methods for windows phone and iphone
you can read the kivy documentation and kivy google groups or kivy github.

for cordova:

After you install you do that :

# 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
then you go to then the forlder www/index.html your paste this code

<!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>
on this line  navigator.app.loadUrl("http://www.web2py.com") you put your url web application.

rajjm...@gmail.com

unread,
Aug 1, 2016, 6:06:23 PM8/1/16
to web2py-users
Very interesting topic guys. Wonder how we make a web2py app downloadable to google playstore or iphone App Store? Does Kivi or cordova both does that?
Reply all
Reply to author
Forward
0 new messages