How does Silverlight programming on the Window Phone 7 differ from browser plugin? - silverlight

I was talking to another developer recently and we started to discuss Window Phone 7 development. Their thoughts, from what they had heard (i.e no hands on knowledge) was it was really just Silverlight development. My reaction was that I see a lot of posts these days regarding Silverlight that call out being for "Windows Phone 7" so there must be some distinctions between the two.
So what I'm wondering is what are the differences between developing for WP7 v. the browser plugin.
The things I can think of, but seem obvious are:
WP7 Silverlight version isn't the same SL 4.0 but more like SL 3.5+
the hardware is different (memory\cpu)
I assume there are some different controls
you need to take into account the form factor
Not discounting the above list, which are important, but what else is different when developing a Silverlight application for WP7 v. browser plugin?
Thanks

There are a lot of technical differences and sure there are plenty here who give you bullet list of these. However there are really just a few real differences that make a big difference to how you develop apps for WP7.
Its a touch interface people
Quite a few apps I've played with from the market place seem to have developers struggling to grasp the concept of a touch based interface. Its clear that many are still using the left mouse down event when they ought to be looking for a "Tap" gesture. This can be frustrating for users trying to "flick" and find they've "clicked" instead.
So make sure you are using a gesture based framework (toolkit has one) so you don't annoy the users.
Your app will tombstone
WP7 guards its resources jealously. At a moments notice your app may be deactivate as the search screen or start screen is invoked. Volatile state of your app will be lost. WP7 API includes a number of ways of keeping key small chunks of data when your app gets "tombstoned" so that when the user returns to it, it should be able to restore near enough the same state it had before. However this isn't done auto-magically you have to code for it.
Again some of the apps in the market place don't handle this well and when you have an Omnia 7 which has a seriously sensitive search button that can be really frustrating.
Network access and other services are intermittent
If you are developing a connected app you need to cope gracefully with changing network access or loss of access all together.
Read the manual
Whilst there are plenty of resources get devs up and running real quick the devil is always in the detail. I recommend you at least start with reading Fundamental Concepts for Windows Phone which will cover some of these issues.

TBH there are a lot. Some of them:
Touch input vs Mouse clicks
Sounds and music
Silverlight 4.0 "/content/song.wma"
Silverlight for Windows Phone 7 "content/song.wav" (mind the slash)
Navigation philosophy
WP7 SL has two threads by default. One (compositor thread) runs all animation, second (UI Thread) runs the rest.
Controls have very diffrent default behavior and look
and many other OS realated

Better than any explanation, you should refer to the official website.
Silverlight for WP has support for (according to the same doc):
Hardware acceleration for video and graphics
Accelerometer for motion sensing
Multi-touch
Camera and microphone
Location awareness
Push notifications
Native phone functionality
It doesn't have regular COM bindings and it has somewhat limited access to reflection, among all restrictions.
For a complete list of features supported in Silverlight for Windows Phone, read this document.

Related

WPF or ASP.NET MVC for UI for an expert business application?

I know this question was asked before, but almost 2 years have passed and the business requirements are a little different.
We are in the beginning of developing a mid-sized application and are divided which technology to use for the front end, WPF or ASP.Net MVC 3?
We are not an IT-company, but a business company with an IT-department who can outsource programming tasks, while the business core shall remain within the company. I did spend a lot time searching the internet for the answer, and I partially did succeed, but since the question is so important, I thought I ask here as well.
Of course, before someone can answer the question I need to specify the requirements and environment for the application at stake:
Infrastructure:
We have a pure Windows environment. Each user will have either Windows XP SP3 (currently) or a future version of Windows (if we skip from XP to Windows 8 remains to be seen, but let us assume that the user will use Windows 7 next) installed.
We are aiming for a service oriented architecture, meaning we only want to run/show on the client machine what is really needed. This is especially important since the databases are far away from the clients (USA/Europe). We plan on using WCF for cross machine communication between user system (brower or WPF), application and database server.
We expect the main user group to be around 30+, but since we are a growing company there should be no issue scaling up to 100 users. The users are spread over three main locations over the world, while we want the option to support smaller locations as well. All those locations are connected to the same intranet.
UI Experience
The new system is supposed to replace existing systems which are desktop applications (Winform). The number of screens are likely to be around 100+ with many labels, comboboxes, graphs. I like to call it an expert system b/c we expect the user to spend multiple hours a day with it, the user is expected to do interact fast with it (many clicks, multiple dialogs pop-up and close etc.) and the application will contain a lot of business logic (mostly mathematically).
Some limited interaction with Excel is required. At this stage only importing formatted data out of .xlsx file into the application in order to work with the data. This we expect to happen often.
Copy&Paste from Excel or other applications into our new application is a requirement (no pictures, just text).
We will use a vendor control library for a richer UI experience.
The users are used to desktop applications for their daily work (current systems/Excel etc.).
Tablet or smartphone support is not a requirement.
Deployment
If we were to use a WPF application we would likely either deploy it in CITRIX or use Click-Once.
Here are arguments of the two opposing factions:
Pro Web:
Deployment is much easier. All the requirements can be done in a web application directly, and if not we use ActiveX or make a separate desktop application for the missing parts. Also, the IT world is going to stop doing pure desktop applications and everything is moving to HTML 5 (Windows 8).
Pro WPF:
Web applications use many different technologies which makes it more difficult and costly to develop and maintain (HTML, ASP.NET, CSS, JavaScript, JQuery, AJAX). There are major deficiencies in a web-applications, mainly
Considering the various browsers and versions.
Screen resolutions
No hardware support for graphics (business graphs, point graphs with 200+ points)
Restricted access to local hardware (importing files, creating files, printing)
Keyboard shortcuts
Point #1 is also worrying since the browser is more out of control since other web-applications in the company (not expert systems) are used, and we fear conflicting interests with the new application (e.g., we must use a browser version where ALL applications run/render fine).
I know there is no black and white on this, but I would be interesting in the following:
Who was in a similar situation and how did they solve it?
(there is a nice article at http://karlshifflett.wordpress.com/2007/12/20/reasons-for-choosing-wpf-over-aspnet-for-very-large-project/, but the problem is that the article is 5 years old :(
How much more expensive is a web solution?
For development assume that the programmers are equally skilled in both (we can outsource this). For maintainance assume that we will internally support this where we have limited knowledge in ASP.NET and WPF. We know WinForm/WCF using C#. We would have to train/learn either technology.
How easy can a web application do Excel interaction, printing etc.?
I read a lot about "ActiveX hell" and I am wondering where we stand today?
Deployment
I have used Click-Once quite successfully in the past, although some team members mention that Click-once can be an issue. Any experiences?
Future?
The system is supposed to last 5+ years. We can not target HTML5 at this time (WinXP only up to IE 8). Where does Windows 8 stand on this?
Other thoughts?
What important things am I missing?
Thank you!
I know this entry is long and not an easy question. So I think you for reading and thank you even more for constructive feedback. Thank you!!!!
I would not build a business application in WPF, especially if your goal is to have it last for 5+ years. Silverlight is in sunset phase now - Win8 apps are betting on JavaScript and HTML5 now, though you are correctly noting that HTML5 support is not universal across all browsers and platforms (see http://caniuse.com/)
Let me try and address some of your concerns above to hopefully persuade you to build a web app:
Considering the various browsers and versions. Yes, you would have to do that. However, for enterprise applications most of the time you can find an acceptable solution if you use industry-standard web technologies and don't use esoteric HTML5 stuff that is not universally supported. It won't be a slam dunk, but it is very much doable.
Screen resolutions. You can address this by utilizing what is commonly known as Responsive Web Design. Once again, there is broad community and industry support for CSS frameworks that allow you to achieve responsiveness. YUI and Bootstrap come to mind as two examples.
No hardware support for graphics (business graphs, point graphs with 200+ points). Well, here is where HTML5 Hardware Acceleration may help you, but I'd say that libraries like HighCharts can easily handle 200+ points graphs - see this example
Restricted access to local hardware (importing files, creating files, printing). Fair point. I'd argue that working with files is MUCH easier with things like Socket.io, Filepicker.io and Zip.js, but "enterprise" requirements may get in the way. And as for printing, you can create "printable" version of your pages or generate PDFs and Excel Exports on the server side. Not ideal, but very much workable.
Keyboard shortcuts. Have you used Gmail app? It is full of shortcuts and keyboard-based interactions. This applies to any application - if you need keyboard interactions, you'd have to build them regardless of your choice of WPF or Web

Silverlight vs Flash vs HTML5, should I care?

I have read a range of articles on advantages/disadvantages of Microsoft Silverlight framework in comparisson to Flash.
Fact that there were two version of Silverlight in the past 18 months worries me, as well as the fact that over 97% of web browsers already have Flash pre-installed.
I'm a .NET developer and I'm very happy with what I can do in the framework. At the moment I feel like I have to put my own preference to a side and decide whether I need to integrage flash with .NET instead of using Silverlight with WPF.
Did anybody try integrating Flash with .NET? What challanges did you come across? How easy was it in comparisson to working in Silverlight?
I have also read about recent talks between Microsoft and Adobe. Whatever way I go It feels very unstable. Can HTML 5 really compete with what's offered by Flash and Silverlight?
Thank you
I have integrated both Flash and Silverlight into my ASP.Net applications. I have to say that working with Silverlight was by far the easier way to go. Communication with the server is easier, initial setup was easier (along with a ASP.Net application or a simple HTML page). Integration into the ASP.Net application was the easiest part (as I'm sure you imagined it would be). If you're a .Net developer, then this is the way to go.
Also, I wouldn't worry about either of these technologies going away anytime soon. HTML5 is not going to take over. It'll take some of the market share, not all.
EDIT
Here are some links to other SO posts on the subject:
Which is the future of web development: HTML5 or Silverlight(or other RIA framework)?
Should I Abandon Adobe Flash for HTML5 and ?
Can HTML5 do most of what Flash does today?
This is basically the way I pick web technologies:
do you need to support every available platform made now, in the past and in the future? HTML4 (yes, 4!)
Do you have to make stuff that is not possible with HTML4, and are ready to sacrifice some user base? HTML5
Can you limit yourself to desktop users (no mobile devices) and need a very interactive application (more so than a "website")? Flash or Silverlight
Do you need to integrate with .NET? Silverlight
Are you familiar with .NET (more so than Flash)? Silverlight
Do you want to reach the absolute maximum number of users? Flash
Do you know Flash/ActionScript (more so than .NET)? Flash
Do you need even more features than what Silverlight provides, and can you limit your deployment to intranets? WPF/XBAP
The whole debate around Silverlight being dead is completely flawed in my opinion: those that thought Silverlight would be completely multiplatform really were not connected with the reality: just by looking at Flash it was clear from the beginning that iOS & co. would never support Silverlight.
HTML5 will probably be the real "universal multiplatform" environment (what is HTML4 now), but with all the nightmares we all know of html. If you are targeting desktops and need more interactivity, better tooling, unit testing & co. then Flash and Silverlight will still be the first choice.
Silverlight's user base is quickly coming close to Flash, so between those two it really comes down to the one you know better and the ease of integration with an existing backend.
The fact that Silverlight got a new major version every 9 months until now is just a sign of how much they are pushing it. Now that it's reached a mature stage you can expect to see larger intervals.
Frankly, AS3 is not hard to learn if you already know OOP. It will take a week or so. If you don't like all the frames stuff in Flash, you can create a single frame app and then manage everything from your custom AS classes.
I'm also a .NET developer, and I had no trouble learning AS3.0. Of course, one week is not enough to become an expert (it takes years to become an expert in any field). But if you simply need to create video or mp3 players, create drag and drop basic games/apps to add to an ASP.NET page, it's worth spending 20 or 30 hours on AS3. There are great video trainings out there . Seven or 8 hours training should take the 20 to 30 hours I mentioned. I went for AS3.0 a few years ago, rather than SL, simply because everybody has Flash plugin installed.
AS3.0 is typed (simple types like Number, String etc), but at least it's typed. There are plenty of functions, classes and methods allowing to implement hit tests, drag/drop, event listening (mouse events, keyboard events etc). Really cool and fun language.
Take care.
HTML5 has SVG and Canvas and video.
It's perfectly possible that at one point someone creative is going to create a very nice animation package that generates SVG files. There already are SVG generators there of course, but obviously they're not good enough because SVG and Flash is, so far, never mentioned in the same sentence.
But is ought to be possible. SVG does structured vector graphics, embedded scripting. The things you see done in Flash has to all be possible in SVG. Flash also has this awful notion of frames, which was a major design flaw from day one.
They should have just let you determine that you want to move an object from point A to B along a path determined by a line or curve or freehand path, and that the times of A and B can be anything and not just confined to a particular frame.
Then at playback, the faster your computer is, the better the frame rate ends up being. Slower computer, slower frame rate. As long as the object moves from A to B.
Then there are the bugs and just overall clumsy handling of Flash.
Flash can be done so much better.
So, I think that someone will at one point soon make an amazing SVG animation package that will just crush Flash.
I'm against Silverlight because it's Microsoft. Microsoft means proprietary. They do whatever they want to do. You've already mentioned different version numbers. This means your customers have to have the right version downloaded. You can count on your customers having to download major upgrades, and before you know it their entire .net install needs updating, before you can show your animations and applications.
Silverlight also doesn't work on Linux. It's supposed to, through Novell's efforts with Mono, etc, but in practice, in the field, it just does not work where you need it to.
I don't know if and how well, in practice, Silverlight works on the Mac, but I don't trust it.
Eventually, I think, that future HTML5/SVG (Canvas maybe?) is the way to go. It'll even do 3D using OpenGL accelerated graphics... (but I don't know if that's portable enough).
In the meantime, Flash is your safe bet, and it's almost guaranteed to run anywhere.
I wonder if anyone has created an animation package that outputs to swf files that's better than the Flash IDE. Shouldn't be too hard, given Flash IDE's clumsiness.
Microsoft recently announced a "change of direction" with Silverlight with more emphasis on mobile rather than desktop.
Flex/Flash and SilverL. now are very similar... using webservice for the clientt/server comunication you can work well with both.
Sure, for .NET developer with Visual Studio to use SilverL. is much more FAST and you need C# only.
But, Flash is more available on PCs, also for mobile devices... you could think for Flash if you need portability.

Does Silverlight have enough of an install base to consider deploying a public web application with it?

I know this question has been asked a million times in various ways by different businesses, but I'm wondering the community's opinion on it [There's this question, but in the fast-moving world of tech, a year is a long time]. For hypotheoretical purposes, let's consider a website where users can watch videos, a la YouTube, Hulu, etc. (actually, it's an on-demand transcoding solution, but close enough). The website could deployed:
Using HTML, JavaScript, and HTML5's <video> tag
Using HTML, JavaScript and Flash (like most are right now)
Using HTML, JavaScript and Silverlight just for the video player
Using Silverlight for navigation, creating a rich all-Silverlight experience
(Let's assume, again hypoteoretically, that the all-Silverlight version is not as annoying as most all-Flash pages are today, but instead provides an experience similar to a desktop application)
Which way would be able to reach a large percentage of the population? How would people feel about having to install Silverlight to view a site -- how much would they want to see the content to make them click the install button? What if a user is browsing the site at the library on on another public computer with limited bandwidth, possibly using older hardware and with an unprivileged user account -- how easy would it be for them to install the Silverlight runtime?
I really want to use Silverlight since I like its' model (I've been using it for an internal app at work, and I think it's an excellent platform), however I'm afraid that for a public site, a large percentage of users would not be able to view the site, then Flash may be better option.
EDIT:
Well, the idea is to have a player where users can access videos on their home PCs from the web. So the users usually won't be using a home PC -- they'll be using work PCs, friend's PCs, public PCs, etc. That's why I'm worried about the security/install privileges issue.
Start with what each of technologies can do for you and match that against your requirements re: content delivery. Assuming each is just as good as the other for the purpose at hand, and that you have the requisite skills in each or dont mind learning them to produce your content, then dont see player distribution as a problem.
Users not having the priviledges to install the player should it be absent would generally be considered an edge case. If your site is specifically targeting a user group to which this is more likely to apply then obviously it requires deeper consideration but at the end of the day you're always going to have a percentage of surfers who cant do something, or use something, for some reason. In this case it's likely a small percentage and good design dictates some form of graceful degradation regardless of the technology being deployed.
Your other questions re: user preferences is difficult to gauge. Here is a list of sites that clearly dont think its an issue. You'd have to extrapolate the adoption rate numbers but this link, albeit to an MS blog entry, suggests the adoption rate is high, especially considering Silverlights relatively short life.
You also have to factor in that it's an MS technology so you're going to benefit from Windows Update, etc and the strength of the MS marketing machine.
Recommendation: Go for it. The more the merrier.
..
Richard
This line is the decider for me:
I really want to use Silverlight since I like its' model
If you like Silverlight enough to really want to use it, go for it. The UI will be as useful or as annoying as you make it, so Flash has nothing intrinsic over Silverlight there. It comes down to whether Silverlight will do what you want it to.
HTML5 and its suite of technologies are a far better fit at this level. I went to a Microsoft confrence recently and the HTML5 talks where all booked out and the Silverlight talks had hardly any attendees. You can get a web application to almost have a normal application experience with JQuery ajax and HTML5.
Due it is an MS technology, Silverlight is successful for its short life, like Bing (i believe if it wasn't developed by MS most people wouldn't even know its name). But i would not use it for a website actually, most people dont want to install new things unless they have to. And if your site does not have a content that they will desire, they can go away from your site. I'm a Java developer but i dont use JavaFX for web apps, because most user machines have Flash installed it is a better choice for accessibility reasons. Silverlight is a new field for MS but Flash is around for years and it's one of the main focuses of Adobe.

Silverlight Webcam

Is it possible to access a webcam in Silverlight
From what I've read it's not possible in Silverlight 1.0 but what about 2.0... 3.0 ... 4.0?
It is now possible in Silverlight 4.0. Developer preview is available at http://silverlight.net/getstarted/silverlight-4-beta/
I'm afraid webcam support isn't available in Silverlight 2.0. You might hope for it to be added in a future version, but there's no easy way of doing it now... Saying this, some people have invented various hacks that use other technologies in combination with Silverlight to capture video from the webcam. They typically involve interfacing with Flash, which of course is perfectly capable of utilising webcams. See this article for an example (with source code included). It's not a pretty solution (at least in my opinion), and may not be 100% stable across browsers/platforms, but I think it's the best you're going to get for now. Perhaps you should submit feedback directly to Microsoft if you really want to see support in Silverlight 3.0 (though it's certainly been mentioned elsewhere, so it may already be on the to-do list).
Silverlight 4 supports web cams. To capture images you can use www.glo6.com/camera1.aspx
It saves encoded images to web server. If there is a need to motion tracking, save images regularly, and then compare them on your server with another application.
I asked a member of the Silverlight team when they would be coming out with webcam support, and he said, in effect, "Let's just say that it's a really high priority for Silverlight 4.0." That said, it hasn't been officially announced yet, so I wouldn't count on it until MS does make the announcement.
I've used the Silverlight -> JavaScript -> Flash hack in production code, and while it does work, it doesn't work very well. Among other things, it's a pain to keep the Flash camera synchronized with your Silverlight UI. The camera shows up on top of SL child window controls, for instance, and of course, doesn't obey the clipping rules for when, say, it should be scrolling out of sight in a list box. And animations are a PITA as well. It's all possible, just slow and unpleasant, and several orders of magnitude more work than it would be if MS just supported web cams in Silverlight.

Possibilities for full blown silverlight applications

Since the launch of Silverlight 2 I was expecting a lot of full blown Silverlight applications popping up but still there seem to be little evidence of this. Does anybody know of such applications out there in the wild. And also what would be the obvious applications you would develop in Silverlight. I would say mail clients are bad examples as they just as well could be written as a web/ajax app. As Silverlight is far more powerful than web+ajax possible candidates should be impossible/akward implementing as a web/ajax app.
The ones that comes to my mind is
Photo and imaging editing apps
Reporting applications
Office applications, Word/Excel...
Edit:
Added from posts
Games
The point isn't that the app need to fill the whole screen just that it isn't just a small part of a webpage, or you could call it a full blown application running inside the webbrowser, only using the webbrowser as a host.
I think the Medical app that Microsoft itself developed shows pretty well what could be achieved with silverlight http://www.mscui.net/PatientJourneyDemonstrator/
As for image editing then as I understand its a bit difficult as Silverlight lacks a Bitmap API to be able to do per pixel image editing...
Edit:
I noticed you added Word/Excel to your question and there comes the problem that Silverlight doesn't have a rich text editor built in and there hasn't been real good examples of custom implementations. There is one http://www.codeplex.com/richtextedit but I haven't seen any applications that actually use it.
I'm working on one in the medical domain.
This started as an update of a Mac classic application but due to the amount of work involved, broadened to considering other toolkits. I convinced them to go for an initial WPF desktop port to be followed by a Silverlight version.
I don't know one so far, but I could imagine that it could be used in a kind like the fullscreen video playback on youtube.
How many fullscreen desktop apps are there? Most application don't need the entire screen. If you don't want to be distracted by menus and taskbars and so you go fullscreen. Another type of applications that can use fullscreen are games.
You are limited in fullscreen to certain key presses such as arrow keys, tab, enter, and space so this rules out some of those types of apps. They have done this for security reasons so an app can't hijack the screen and record the keypresses, but I wish they could come up with a scheme to sufficiently warn the user then allow it if they consent.
An application Microsoft seem to like to show case is the AOL mail client written entirely in silverlight.
Personally I follow the rule is if you would not write it in flash you would not write it in silverlight preferring AJAX in most cases. In the past most large flash application have failed such as the flash word processor (cant remember the name) while AJAX enabled applications such as google documents have taken off.
Finally I believe until moonlight (linux and mac support) has been released and more general users have silverlight downloaded developers will be reluctant to use it widely even for smaller apps and gadgets.

Resources