Re: cherrypy server for android app

Tim Roberts <[email protected]> Tue, 15 Aug 2017 09:52:03 -0700
Newsgroups gmane.comp.python.cherrypy
Organization Providenza & Boekelheide, Inc.
Message-ID <[email protected]>
Andrew Levin wrote:
>
> I made a cherrypy server for a website. I would also like to make an
> android app that has the same function as the website, and I am
> wondering if I can/should also use cherrypy for that. There are at
> least two issues:

 You can certainly do so.  Your CherryPy server would still be a web
server without a UI, so your visible user interface would be whatever
browser the Android user has set up.  It would have an
http://localhost:xxxx URL, and it would work exactly like it does on
your desktop system when talking to a local URL.


> 1) It is not obvious how users authentication can be accomplished. I
> was
> using https://github.com/cherrypy/tools/blob/master/AuthenticationAndAccessRestrictions
> for the website. Are android apps able to use sessions?

There's no change in the design.  Your app would still be a web server. 
Instead of Chrome on the desktop, you'd be talking to Chrome on
Android.  I hope it's obvious that web servers on Android devices do
sessions.  All you need is file system access.


> 2) For the website, I was using an infinite loop of http requests with
> a long timeout period to effectively push data to the client. Would
> this work with an android app? Would this lead to an app that uses
> excessive cpu?

It would use exactly the same amount of CPU that it does on a desktop
system.  You seem to think that the implementation is going to be
radically different, but Android is just Linux.

-- 
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.