[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-28 Thread Ross Peoples
The end result of the discussion was to give the developers a way to detect 
the devices using request.user_agent() to get info from the user agent 
string, and then the developer can do whatever they want with that 
information, so the creating of mobile and desktop sites is still completely 
up to the user, but this just makes it a bit easier.

Re: [web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-28 Thread Kenneth Lundström

I find it unfortunate that it was never implemented.

Would it be possible to get a web2pyslice of how to do something like 
what was the orginal idea?



Kenneth

The end result of the discussion was to give the developers a way to 
detect the devices using request.user_agent() to get info from the 
user agent string, and then the developer can do whatever they want 
with that information, so the creating of mobile and desktop sites is 
still completely up to the user, but this just makes it a bit easier. 




Re: [web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-28 Thread Anthony
On Thursday, July 28, 2011 6:06:43 PM UTC-4, Kenneth wrote: 

 I find it unfortunate that it was never implemented. 

 Would it be possible to get a web2pyslice of how to do something like 
 what was the orginal idea?

The mobile device detector has been implemented (in trunk). I don't think 
any other code has been shown/submitted regarding this issue. If there are 
other things that make sense to put in the framework, I'm sure they'll be 
considered. Some of the other ideas may make more sense as plugins, though.
 
Anthony
 


Re: [web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-28 Thread pbreit
It was just browser sniffing to set an is_mobile variable.

[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-27 Thread Christopher Steel
http://www.getskeleton.com/#theFuture




[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-26 Thread Rufus
I'm new to web2py but since I have an iphone I've been interested in
the mobile
view/standard view capability of web2py so I've been watching this
thread.

Could you possibly generalize display devices even more, to even
provide per-user
or per-session skinning of the web page, storing the display mode/
theme/skin
value in the session storage.  Then controllers and views could adjust
according
to their own abilities.


(to tell the truth, the mobile-enabled websites really tick me off
when there is no way for
me to force it back to the standard page.)


Re: [web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-26 Thread Jonathan Lundell
On Jul 26, 2011, at 3:12 PM, Rufus rufusvsm...@gmail.com wrote:

 (to tell the truth, the mobile-enabled websites really tick me off
 when there is no way for
 me to force it back to the standard page.)

It's a good point. I just visited a site that insisted that my iPad was an 
iPhone. I've seen sites that allow overriding the choice and getting the 
normal view.

[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-26 Thread Chris May
I agree. It's very important to not annoy the site visitor by forcing
him into one view / solution / experience.

Judging by the parallel discussion in the developer group (http://
groups.google.com/group/web2py-developers/browse_thread/thread/
2056602a6c30af27#) and the corresponding issue request (http://
code.google.com/p/web2py/issues/detail?id=346), I believe a future
update will give site developers the ability to serve specific code to
specific devices.

Which means it will be up to us to give our users these options.


So all we will need are better educated web developers.

Is there a way to get web2py to do that for us? :)


On Jul 26, 6:39 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Jul 26, 2011, at 3:12 PM, Rufus rufusvsm...@gmail.com wrote:
  (to tell the truth, the mobile-enabled websites really tick me off
  when there is no way for
  me to force it back to the standard page.)

 I've seen sites that allow overriding the choice and getting the normal 
 view.


[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-22 Thread Ross Peoples
If this functionality is desired, then consider the mentioned patch to be 
the first of many to come:

http://code.google.com/p/web2py/issues/detail?id=346


[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-22 Thread Anthony
+1

On Friday, July 22, 2011 3:14:02 PM UTC-4, Ross Peoples wrote:

 As mobile devices get more popular, it is important for many sites and apps 
 to provide both a regular (desktop) site and a mobile site. It is currently 
 difficult to accomplish this with web2py. Plugin jqmobile is great for 
 mobile devices, but doesn't really work for regular web browsers.

 I am determined to find a way to allow web2py to run a desktop and a mobile 
 version of an app without giving up the ability to byte compile apps. I 
 think I found a solution, but it will require a couple of patches to the 
 web2py core first. This first patch will add is_mobile to the request 
 object. 

 So in your views or controllers, you can just test for a mobile view:

 if request.is_mobile:
 response.view = 'default/index.mobile'

 Of course, you would not be required to do this if my solution for native 
 web2py support works out, as checking for desktop/mobile views would be done 
 automatically.

 My end goal is to provide an out-of-the-box solution for web2py that will 
 allow you to make your own mobile layout and mobile views without breaking 
 backwards compatibility, while still allowing applications to be byte 
 compiled. My plan is to provide a mobile layout (like plugin_jqmobile's), 
 along with the existing desktop layout. Then, mobile views would have the 
 .mobile extension. If the .mobile view isn't available it would fallback to 
 the standard .html view that is used for desktops.

 I am posting this to get the community's opinion on including this 
 functionality into web2py before I devote my time to actually developing the 
 solution. Does anyone see any problems with my logic so far, or about the 
 way the mobile sites are implemented alongside the regular sites?



[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-22 Thread Chris May
Hey Ross, thanks for starting this discussion. And what a timely
discussion, considering today's Smashing Magazine article is a roundup
of Responsive Design (RD) patterns. (www.smashingmagazine.com)

(For those unfamiliar with RD, also check out A List Apart for a great
intro: http://www.alistapart.com/articles/responsive-web-design/)

I agree that it would be valuable to make it easier to address mobile
and desktop environments, and I've been wondering how to work with
web2py on this front as well. I notice that in the bottom of base.css
for web2py, there is space for RD, which is a good starting point to
have one bass CSS file that can work for desktop and mobile
environments. I feel this can work well for pages that would serve the
same content to desktop and mobile browsers. But I don't know how
common that is.

One major issue I find is getting a reliable way to detect a mobile
environment.

I have worked with some people who are attempting to keep a database
of browser agents to determine it that way. I would think it's a
nightmare to keep that list up to date.

I know the folks at http://yiibu.com/ have come up with a possible
solution, following the mobile first pattern. But I haven't been
able to dive into their code yet.

Thus far in sites I've recently developed, I've limited my mobile
environment detection to finding out the browser width and using CSS
to change the layouts and images.

How do you think we can reliably detect a mobile environment?



[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-22 Thread howesc
it's been years since i last was doing device detection, but i used the 
WURFL: http://wurfl.sourceforge.net/




[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-22 Thread Ross Peoples
I have already submitted a patch to address device detection. It's very simple 
and uses the user agent string. It may not be the most elegant way to do 
detection, but it works and it's really fast. I tested the detection using an 
iPhone and an iPad, but I don't have any other devices to test with. 
Regardless, it should pick up 99% of mobile devices, if not more.

I've also figured out a way to switch to the mobile layout without messing up 
byte compile. So far the important proof of concept pieces are falling into 
place perfectly.


[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-22 Thread pbreit
This came out recently:
http://www.getskeleton.com

It seems to me pretty difficult to make one web app work well on both large 
and small screens.


[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-22 Thread Ross Peoples
It is difficult to make the same views and everything work on small and large 
screens. The solution I am proposing is a separate layout for mobile devices 
based on plugin_jqmobile. Views would use .html versions of the views unless 
overridden by a .mobile view. This way, simple views don't need to be 
duplicated, and mobile-specific views are easy to include. 


[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-22 Thread pbreit
Ah, I see. That could be interesting. Possible to upload the changes as 
patches so we could isolate the differences?

[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-22 Thread Ross Peoples
The changes are all over the place right now. I was hoping to release these as 
a series of patches to make later testing easier. I submitted the mobile 
detection already as issue 346. All of the changes since have been to the 
welcome application, since layout selection is a per app thing.

Assuming the detection patch gets accepted into the trunk, I can attach a copy 
of the welcome app so you can see how the layout switching works. 

I haven't done any work on the view switching yet, but hopefully I can do it 
tonight. Once I get that working, see if I can figure out a way to post it so 
it can get some testing before subitting it to the trunk. 


[web2py] Re: DISCUSSION: Dual Desktop/Mobile Functionality

2011-07-22 Thread Ross Peoples
After some hacking on the welcome application, I have finally got this 
working! I attached a screenshot of a /default/test function I created. 
That URL uses the test.html view when viewed on the desktop browser, and 
the same URL uses the test.mobile.html view when viewed using the iPhone 
Simulator. I chose to go with .mobile.html instead of just .mobile for 
the extension because it still gives you the syntax highlighting in text 
editors when it still ends in .html.

I hope Massimo accepts my mobile browser detection patch so that I can 
attach the new welcome application that supports this new desktop/mobile 
dual mode. I'd certainly like a few testers before I submit a formal patch 
with the new dual site support.

https://lh6.googleusercontent.com/-gN9BQwrdyj8/TiozTFkzVtI/AEI/Fd5eWevYUBE/Screen%252520Shot%2525202011-07-22%252520at%25252010.27.09%252520PM.png