PDA

View Full Version : Mobile and desktop app



simon
7 Nov 2013, 2:16 AM
I would like to create web site, which would work well with mobile phones and desktop computers.
Should I create separate: for desktop computers EXT JS 4.x and for mobile Sencha touch?
As i understand sencha touch needs container(browser) to work or it can be converted with phone gap to mobile application?

I guess the best user experience would be to have application for mobile phones and if user doesn't won't to install the application it can still watch the site over mobile browser.

If web site is developed with touch then it can be viewed both, with mobile browsers or desktop browsers, while developed with extjs 4.x would be mostly for desktop browsers?

And I guess it would be best to use mobile-boilerplate as template?

Any suggestion how to start, maybe some good template here?

Thanks,
Simon

burnnat
7 Nov 2013, 7:07 AM
You're mostly correct with everything you've said, except for this:

If web site is developed with touch then it can be viewed both with mobile browsers or desktop browsers

Sencha Touch is only supported in WebKit browsers (i.e., Safari, Chrome, and Opera), so it won't work in Firefox or IE. It's also specifically geared toward touch events, so using a Touch application on a desktop with a keyboard and mouse isn't a great user experience.

If you want to support both mobile and desktop browsers, creating both Sencha Touch and ExtJS applications is the way to go. You can share javascript code between the two pretty easily using Sencha Cmd packages, but you do have to be careful about subtle differences between the two frameworks. Creating separate applications allows you to better tailor the user experience to the device.

burnnat
7 Nov 2013, 7:12 AM
Actually, I should amend my statement slightly - Sencha Touch 2.2 did introduce support for mobile IE 10, so it's no longer entirely accurate to say it's WebKit-only. I still wouldn't count on Firefox support, however, and legacy browsers (such as IE <= 8) are definitely not supported by Sencha Touch like they are in ExtJS.

simon
8 Nov 2013, 3:10 AM
"Sencha Touch is only supported in WebKit browsers"

Isn't touch developed in HTML 5, which is supported by all browsers?

Is there some simple example for sharing js code with touch and mobile?
To get an impression what could be shared and what not.

I din't know about Sencha Cmd packages, I'll search in documentation.
"but you do have to be careful about subtle differences between the two frameworks"

From this I can understand that it is better to completely separate Sencha Touch and ExtJS code(not using cmd packages), since "be carefully about differences" usually makes only troubles and a lot of work.

Thank you

burnnat
8 Nov 2013, 6:56 AM
Isn't touch developed in HTML 5, which is supported by all browsers?
HTML5 is supported by the latest version of all browsers, but there may be users that haven't upgraded to a modern browser version (especially if your users are from the business world). For the apps I support, we have requirements to support browsers as far back as IE7, which would not be supported by Sencha Touch. If your intention is to jettison support for those legacy users, then Sencha Touch would be a more realistic option. But it still leaves your desktop users with a somewhat unnatural experience, since you can't use many components convenient to a keyboard/mouse - menus, trees, collapsible panels, and the like.


Is there some simple example for sharing js code with touch and mobile? To get an impression what could be shared and what not.
I'm not aware of one off the top of my head. You wouldn't be able to share any code for user-interface elements between the two, if you wanted to share code it would more likely be for the underlying business logic, data processing, or such.


From this I can understand that it is better to completely separate Sencha Touch and ExtJS code(not using cmd packages), since "be carefully about differences" usually makes only troubles and a lot of work.
That's a valid point of view. If you only have a little common code between the two, then it may not be worth the maintenance and debugging to share it between the two. I only suggest it as a possible solution if you have a lot of common logic (like I have in the past). It certainly won't be appropriate for everyone.

One thing to note is that Sencha appears to be moving toward bringing Sencha Touch and ExtJS closer together - for instance, ExtJS will be getting support for touch devices (http://www.sencha.com/blog/ext-js-on-tap/) in the future, according to the Sencha blog. That blog post also talks a little bit about when to use ExtJS versus Sencha Touch. Here's a key quote:


With all of this additional device support coming into Ext JS via sencha-core, many developers have questions about when to use Ext JS vs. Sencha Touch. The answer is simple to state but takes consideration to apply: each framework has unique features and device support and developers have to chose between them based on their applications’ requirements.

In some cases, this may mean writing two applications: an Ext JS desktop application and a Sencha Touch mobile application. This is not entirely unexpected given the disparity in form factors: it is common to design different interfaces across these devices to improve the user experience.

simon
12 Nov 2013, 2:25 AM
Thank you. That is exactly what I was afraid for :)
In the past I had to write different web pages for different browsers.
Now Ext saved my ass with library which works on all browsers very similar(well, sometimes there are still problems and i usually check if it works for IE and Chrome).

Now i will have to write different pages for different devices. I can't see the solution in near future.
But of course, database and web services are shared between them - unfortunately this layers usually doesn't take me a lot of time, user interface is the one which takes me about 70% of all time.

Thank you for your explanation