Migrating Windows Phone 8 app to Windows Tablet - windows-phone-8

Do Windows Phone 8 Application developed for Windows Phone 8 device will run on Windows Surface Tablets (RT & 8.1)? Kindly clarify me.
Could you please suggest me on, what are the changes required for migrating the application.

Take a look on the Portable class library.
It allow you to share your code between different platform.
http://msdn.microsoft.com/en-us/library/gg597392(v=vs.110).aspx
This blog clearly explains how to use it :
http://blogs.msdn.com/b/stephe/archive/2012/05/07/partager-du-code-entre-plate-formes-gr-226-ce-224-la-portable-class-library-1-4.aspx
Anyway you got specific dev to do.

You will need to rewrite many portions of the application. It's difficult to be more precise as you did not describe anything about your application.
The UI, assuming you select C# and XAML for the Windows 8 modern application will need a significant amount of changes. While there will be a significant amount of knowledge overlap and technology similarity, the UI will not be portable. The components are similar, but for example, you've probably used the Windows Phone toolkit which is not available for a Windows 8 store application. Another consideration is that on the larger screen sizes, you'll ideally want to use a different layout of your application.
For the business logic, you may be able to use much of it as is. However, anything that deals with the file system or network (and more) will not necessarily be portable. You could use a portable class library for some features, but you may still need platform specific code.
While this all may sound like a tremendous amount of work, I'd actually like to suggest that it's not. The platforms are very similar, the development environment will be identical, and some amount of UI work would have been necessary anyway. Assuming you create two applications, the structure might look like this:
PhoneApplication
Windows8Application
DataModel
PortableClassLibraryStuff
PhoneSpecific
Windows8Specific

A lot of differences beetween WinRT and WP8 API makes porting much more difficult. But if you are still interested in this topic I can suggest you
Waiting for WP8.1 and W8.1 Update 1 API combination or
Writing your own little framework in a portable class library for navigation, setting, notification, ... support. I already did that work and there are a lot of possibilities for code sharing (resources can be completely shared with the binding notation of WP8). For more information please visit the opensource github project: Github MultiPlatform Framework sample. You will still need to rewrite a lot of xaml code but the leaked footage of the WP8.1 API already showed that we will be able to use much more shared UI code :-)

Related

Is it possible to create a portable UWP app (=no installation needed)

The UWP infrastructure seems to have everything what's needed for a portable model.
Clear separation between os and application
Clear separation between different applications
Less dependencies
Support portable class libraries
As far I know portable scenario's are not supported right now. Is it something that we can expect in the future or is it intrinsic impossible due the architecture of UWP/WinRT
How hard would it be to create some kind of host executable that can run any local UWP app. At the moment I'm looking for portability between different Windows 10 PC's. Not so much cross device or cross OS.
I'm aware you can side load UWP apps, but that's not what I'm looking for.
Is it something that we can expect in the future or is it intrinsic impossible due the architecture of UWP/WinRT
I don't see any major technical limitations that would prevent this scenario. UWP apps can register to some global mechanisms (which is something portable apps shouldn't do), like push notifications or background tasks, but the whole application model has been designed so that users can limit access to those features on a per-application basis. So every developer publishing an app is supposed to have considered beforehand that those code-paths may fail.
But "technically possible" doesn't mean that Microsoft will do it. In fact, I seriously doubt they ever will. The reason is simple: they're pushing the store with all their might, even seeking to put Win32 apps on it. Clearly, they're moving towards putting more apps on the store, not the other way around.
As to know whether it'd be possible to make a third-party standalone runner, I think so. When running unit tests for an UWP app, Visual Studio is launching a sort of "shell" hosting the app (it has become very apparent recently because after an update of Windows 10, the API that allowed to hide the splashscreen wasn't working anymore). I don't know what API is used to create this shell, but I'd definitely dig that way if I wanted to make a portable UWP host.
Although I haven't done this myself (will update answer if and when), reading this article makes it look like there is an easy way to create an installer that calls that command.
In short, an appx package can be installed locally using the command:
C:\Program Files (x86)\Windows Kits\10\bin\x86\WinAppDeployCmd.exe
Which can probably be wrapped in a UI or CMD installer.
Here's nice example of it (not mine).

Windows Apps Universal, XAML or JavaScript

I am embarking on my first windows phone app. I noticed there are two templates one is in Javascript (Blank App (Universal Apps)) and the other in C# (XAML) again Blank App (Universal Apps). Which one should I use, I know it depends a lot on the project context, but basically its just a simple phone app, that reads and displays data, mostly crud operations. Any help is appreciated.
I think there are a lot of resources in the internet regarding this question.
For example:
http://www.itwriting.com/blog/8350-xaml-and-c-or-html-and-winjs-for-windows-store-universal-and-cross-platform-apps.html
http://www.neowin.net/news/microsoft-likes-winjs-for-making-windows-8-apps-but-most-developers-prefer-xaml
https://softwareengineering.stackexchange.com/questions/156361/advantages-and-disadvantages-to-using-xaml-c-or-html5-javascipt-for-metro-apps
If you have a C#/.NET background, choose XAML - if you have a web background, choose WinJS...
I think that XAML is more popular than WinJS (especially for Windows Phone).
Here's my take to add to the list--http://www.kraigbrockschmidt.com/2013/01/17/html-javascript-xaml-directx-language-windows-store-app/ . In my partner-facing role at Microsoft I got this question quite a bit, and it really boils down to personal preference and experience unless you run into a place where the languages don't quite have parity at present. Parity was more of an issue in Windows 8, many areas were resolved for Windows 8.1. (Parity is more a matter between Windows/Windows Phone now rather than between the languages.)
Personally, being the author of Programming Windows Store Apps with HTML, CSS, and JavaScript, Second Edition (free ebook, Microsoft Press, 2014), I like the JS approach very much because you can leverage standards. On the downside, JS code is the least secure of all the options (see this blog post of mine), which might be a make-or-break consideration.

html5 or xaml for windows 8 / 8.1 [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am new to app development and chose C# and xaml for apps. But things didnt quite go well. I aint a full time programming freak; can just manage an hour or two a day after college studies and with xaml my head really hurts.
Recently i came to know that even html5 can be used to make apps. So my question is this :
Should i continue with xaml or switch to html5 ?
Ref : http://devchic.azurewebsites.net/?p=581
https://stackoverflow.com/questions/11147012/should-i-choose-html5-or-xaml-for-metro-development
My requirements are :
1) Shouldn't be too time consuming
2) I will currently focus on light and simple apps ( Games maybe, but not in near future)
3) They should be available to both wp8 as well as desktop, and if possible to other platforms as well.
(I happen to know c++ and Java at intermediate level.)
While either solution could work, here are some things to consider. I'm going to assume you mean Windows Store applications when you said "desktop."
1) Shouldn't be too time consuming
That's very difficult to say. If you're not familiar with C# and Xaml, there will be a learning curve. You mentioned you know Java though, so the language shouldn't be too much of a challenge. If you're interested in quick to build, I'd suggest you start with Xaml and C# and use the Xaml visual designer to gain some experience and ignore the Xaml output at first. By default, like a web page, the layout system is not absolute and often uses various types of panels (grids, dock panel, etc.) for layout.
Microsoft has a lot of great examples on MSDN that would allow you to both learn more about your options, but even contrast the coding techniques. Having taught someone at work in a little more than an hour how to get started and be productive, you might want to give Xaml another go.
2) I will currently focus on light and simple apps ( Games maybe, but not in near future)
Your definition of light and simple isn't specified. You could create applications that meet that requirement with either platform. If you're building games, the answer changes and becomes more complex. As you're still learning though, I'll not talk about that here.
3) They should be available to both wp8 as well as desktop, and if possible to other platforms as well.
Today, there are 4 common ways of developing an application for Windows 8.1 desktop:
Xaml/C# (C++ is also an option here)
WinJS/HTML/JavaScript (WinJS is a Windows store application-only framework)
Either of the above, hosting a web page (either from a web server or local in-app)
C++/DirectX (for games)
Currently, there isn't a way to use WinJS or the same code for option 4 on Windows Phone. So, you'd likely narrow your options to Xaml or a web page view. While you can't take Xaml and necessarily use the same Xaml on both platforms, the patterns and development experience are very close. By using a "portable class library", it's now possible to share the common business logic between the platforms.
A Xaml approach would allow, without extra effort, the application to be a native experience. Th application would have the appearance and behaviors of a Windows Store application. If you went with just an embedded web page approach, you'd be on your own. I will not take on the experience and look of Windows. If you aren't familiar with doing reasonably complex HTML and CSS, an embedded web page solution may be too time consuming.
(I happen to know c++ and Java at intermediate level.)
Here's a few links that might help you:
Getting started developing apps for Windows Phone and Windows 8
Develop Windows Store apps
This will likely help you with either choice.
Traditional Windows Desktop applications
If you want to build a traditional Windows desktop application and not a Store application, your options are similar, with the exception that you might choose to build your application using WPF. windows Presentation Foundation was the predecessor to the Xaml used in Windows Phone and Store applications. It's not identical, but the knowledge of one transfers well. You can also host an web page inside of a "desktop" application. I've done it frequently. If you're trying to build someone "modern" though, learn the Windows Store frameworks.
If XAML hurts, I say go HTML5. I don't understand XAML very well myself, so I use HTML5 for my Win8 apps.
Regarding your requirements, HTML5 fits 1&2 perfectly. It's not very common to write desktop apps in HTML5 though, so your options there will be quite limited.

Any code changes needed to get WP8 app to run on Surface Tablet?

So, our Windows Phone developer left recently, and I primarily do Android development.
We had a question from a client about the possibility of installing our Windows Phone 8 app on a Surface Tablet. Namely, is it possible to do? As it stands, our WP8 app was not written with tablets in mind, so my question is:
Is there anything I need to do to the WP8 app to get it to install on a tablet, (should it work as-is (like Android apps do), is there some sort of flag I have to enable and then rebuild, etc.?)
As #AMR mentions, the biggest challenge will be the UI; however, depending on the device functionality being used, the "backend" may or may not be a challenge as well.
There is great guidance on the Windows Phone Dev Center about practices and techniques for building for both platforms, so depending on when the phone app was built and your former developer's awareness of the overlapping platforms, you could be in great shape or just so-so shape.
Additionally, the following resources may be of help in mapping from what you have already coded in Windows Phone 8 to what you'd do in Windows 8:
XAML controls comparison between Windows Phone 8 and Windows 8
(much will be relevant to Windows Phone 7 too)
Windows Phone 8 and Windows 8 platform comparison (shows common
APIs, storage, networking, etc.)
Lastly, the Windows Phone Runtime API documentation gives a listing
of APIs only on Phone 8 vs. APIs adopted from Windows 8.
Okay well first off yes, there will be a few things that change but nothing to serious.
HOPFULLY you have a good MVVM model. If this is the case then you should be able to just copy and paste 99.999% of your backend code right into your tablet app. There are a few things that are different but its just namespace stuff. Nothing too serious.
The Major change is going to be your UI layout and UI controls. Depending on what libs you are using you will probably have a lot of conflicts.
Your best bet is to just copy and paste your backend code in and then creating a new UI. I have tried to merge phone UIs in the paste into the tablet and its rediculous at times. I found it takes less time to just recreate it.
If you need any help you can hit me up at www.AnthonyRussell.info Maybe I can help with your transfer. Just make sure to leave your contact info.

Client-side image processing

We're building a web-based application that requires heavy image processing. We'd like this processing load to be on the client as much as possible and we'd like to support as much platforms (even mobiles) as much as possible.
Yeah, I know, wishful thinking
Here's the info:
Image processing is rasterization from some data. Think like creating a PNG image from a PDF file.
We don't have a lot of server power. So client-side processing is a bit of a must.
So, we're considering:
Flash - most widespread, but from what i read has lackluster development tools. (and no iPhone/iPad support for now).
Silverlight - allows us to use .NET CLR, so a big ++ (a lot of code is in .NET). But is not supported for most mobiles ( rumored android support in the future)
HTML5 + Javascript - probably the most "portable" option. The problem is having to rewrite all that image processing code in Javascript.
Any thoughts or architectures that might help?
Clarification: I don't need further ideas on what libraries are available for Silverlight and Javascript. My dilemma is
choosing Silverlight means no support for most mobiles
choosing Flash means we have to redevelop most of our code AND no iPhone/iPad support
HTML5 + Javascript we have to redevelop most of our code and not fully supported yet in all browsers
choosing two (Silverlight + Flash) will be too costly
Any out-of-the-box or bright ideas / alternatives I might be missing?
This is the sort of issue that software architects run up against all the time. As per usual, there is no ideal solution. You need to select which compromise is most acceptable to your business.
To summarise your problem, most of your image processing software is written in .NET. You'd like to run it client-side on mobile devices, but there is limited .NET penetration on mobiles. The alternatives with higher penetration (eg. Flash) would require you to re-write your code, which you can't afford to do. In addition, these alternatives are not supported on the iPhone/iPad.
What you ideally want is a way to run all your .NET code on most existing platforms, including iPhone/iPad. I can say with some confidence that no such solution currently exists - there is no "silver bullet" answer that you have overlooked.
So what will you need to compromise on? It seems to me that even if you redevelop in flash, you are still going to miss out on a major market (iPhone). And redeveloping software is extremely costly anyway.
Here is the best solution to your problem - you need to compromise on your "client side execution" constraint. If you execute server side, you get to keep your existing code, and also get to deploy to just about every mobile client, including the iPhone.
You said your server power is limited, but server processing power is cheap when compared to software development costs. Indeed, it is not all that expensive to outsource your server component and just pay for what you use. It's most likely that your application will only have low penetration to start off with. As the business grows, you will be able to afford to upgrade your server capacity.
I believe this is the best solution to your problem.
Host you image processing on Amazon E2C, Azure, or Google. IIRC E2C has many common image processing problems packaged and all ready to go.
Azure probably more familiar ground in term of sharing code as a web service
You just pay for CPU cycles and transfers/storage etc
I'm sure there will be Silverlight and JS people posting examples. Here are some image editors written in actionscript:
Phoenix
PhotoshopExpress
There is an ImageProcessing library to start with.
Plus PixelBender is available in Flash Player 10, it's fast, it runs in a separate thread
and people do some pretty mad things with it.
HTH
Some help for the Silverlight part:
There is an Silverlight image editor called Thumba.
And Nokola recently made one called EasyPainter and he will also provide the source code in the furure.
For the image conversion I would recommend the open source library ImageTools that also includes some basic effects.
Silverlight has a class for pixel manipulation of bitmaps called WriteableBitmap. The open source library WriteableBitmapEx is a collection of extension methods for Silverlight's WriteableBitmap. The WriteableBitmap API is very minimalistic and there's only the raw Pixels array for such operations. The WriteableBitmapEx library tries to compensate that with extensions methods that are easy to use like built in methods.
Pixel Shaders can also be used to make some fast and advanced effects. Although they are limited by Shader Model 2 shaders can be used for fast bluring, tinting and such things.
DISCLAIMER: I consider myself as an advocate of the Flash platform. I admire Silverlights huge potential as a technology to deploy almost any .NET content through the browser, but it has low penetration, is horribly marketed and -although perceived as such by many (mostly people who don't know either Flash or Silverlight)- is no competitor of Flash, as much as Flash is no competitor of Sliverlight. The idealist in me loves the idea of doing everything in HTML+JS using a standard, instead of relying on 3rd party proprietary software. But the truth is, JS is slow and the API is limited, and implementations of JS, HTML and CSS are terribly inconsistent accross browsers.
If you really wanna stick to .NET and are so interested in targeting the iPhone and its siblings, then you might wanna check out MonoTouch.
Still, even though this may surprise you, I am going to tell you to use Flash. :)
Why? The image processing bit is the smallest part of your application. Whatever it is you are writing, I am very sure of that. I don't know about Silverlight, but in Flash the filters used by "Thumba" and "EasyPainter" can be created within a day, most of them simply using ConvolutionFilter, ColorMatrixFilter, DisplacementMapFilter and BitmapData::paletteMap or even simply by applying one of the other filters Flash offers out of the box. Any additional things can be created using PixelBender, which was pointed out by George. The kernel language is a subset of C, so porting classic filters shouldn't be too time consuming. Also alchemy (an LLVM backend targeting Flash Player 10) would be an option worth investigating, although it's not very stable yet.
The biggest part of your app will be a lot of GUI design, GUI implementation, Business Logics etc. Flash is really great when it comes to simple, yet reasonably fast image manipulation and with the Flex framework and MXML you have a powerful tool to productively create the GUI of your app, that can interoperate very well with a multitude of server solutions for virtually any platform.
Also, Flash has a great and active community, offering tons of tutorials, code snippets, libraries and frameworks, and a big ecosystem, with cross-compilation tools to deliver flash content to other platforms (including the upcoming Flash CS5, or the mentioned Elips). I don't understand, where you got the impression, that the Flash platform lacks developement tools. The difference to the .NET suite is that they are provided by a multitude of vendors. The upcoming Flash Player 10.1 was already pointed out by George, but never the less, I wanted to stress, that this makes many of the cross-plattform considerations obsolete.
Last but not least, I'd like to point out Haxe. It allows compiling to SWF, but also to C++, using the very same API provided by NME, to target the iPhone. Also there's work in progress on an android backend. If you're aren't playing to launch within the next 4-5 months, then this is definitely an option.
Your issue is a perfect target for the Haxe programming language. Haxe is written for the web and can compile to JavaScript, Flash and Objective-C (possibly Java/.NET soon).
So you do not choose which platform you are going to invest in but in which language. Haxe is easily adoptable for an AcitonScript programmer.
It makes no sense to run your imageprocessing algorithms in a JavaScript sandbox when Flash is available because it will be much faster. It makes also no sense to run heavy image processing algorithms on a mobile device like the iPhone with JavaScript. I would only support JavaScript as the worst fallback solution.
If you do not like to use Haxe I would go with Flash. You can deploy your Flash application for the iPhone aswell if that is your problem. This is also very great because you get native ARM code. There are actually great tools for professional Flash development available. FDT and IntelliJ IDEA are two of them. The best Haxe IDE is probably FlashDevelop at the moment of writing.
So I would definitly not use JavaScript as the only solution. Haxe is perfect for what you try to achieve. If you do not trust or do not want to invest in Haxe you can use Flash because of the iPhone/iPad export.
Depending on your usecase I would also encourage you to look at cloud hosting like Amazon EC2 and Google AppEngine for instance. Hosting costs are cheap and scaling will be easy for your task. The experience will be much better when it comes to complex operations that can take even a lot of time on a desktop system.
In addition to other answers, another option may be a hybrid solution. For example, use Flash/Silverlight for the majority of your target audience and use server-side processing for those that don't support it (or you could create a native app for iP[hone|ad])
You may have to do something like this anyway as the mobiles you are targetting may have insufficient processing power depending how complex your image processing gets.
Of course you still have the option of upgrading your server which, although you've currently discounted, is probably far cheaper than spending development time creating/deploying/testing a client-side solution.
You can use Silverlight for all Silverlight enabled clients and for non Silverlight clients, do the image processing server side. Since the Silverlight code is C#, you can double compile it to make (mostly)the same code work as Silverlight and non-Silverlight (i.e. server). This gets you the best of both worlds.
You don't say what language "all that code" you'd have to rewrite is in. Might a semiautomated translation to Javascript be practical?
Perhaps you could start out server-side, as CraigS suggests, and then move functions into the client over time instead of rewriting all at once.
Have you checked the editor of Pixlr.com ?
Take a look at their API as well..
The best solution is to use silverlight (so you already have the code ready). If the client can't run it (mobile phones, etc) then process it server-side.
It's the best compromise.
Depends on the type of image processing and the end user experience you are targeting.
As you are looking to target mobile phones your image processing will need to take into consideration the type of handset the user or the receipient has (if messaging via SMS/MMS), as different handsets have different resolution screens and handle different image formats for main images and thumbnails.
I'd suggest that you consider a hybrid cloud architecture as was mentioned in the Microsoft PDC keynotes this year. This would enable you to have your own server(s) to support your application, but if you require additional capacity due you scale out into the cloud using AppFabric.
Additionally, to maximise the market availability of your product pulling the image processing to a common reusable infrastructure allows you to target different platforms, exploiting the positives in each.
I have worked on a solution that hosted its image processing and delivery infrastructure server side and then built different UI offerings allowing sales via desktops, MNOs and AppStores. It can work and from a business perspective can offer economies of scale benefits.
Why not mention Java Applet ?
Good sides are:
almost all browser support ?
need install JRE ?
all OS support
Java provide Java Advanced Image kits, but if c++ dll can be called, that is best (JNI can call c++ dll )
In Python, one of the most popular libraries for image processing is pillow. Through the pyodide project (python running inside browser via emscripten), it's possible to use libraries like pillow and numpy for image (or matrix) processing, and convert the output to a base64 string (via Python standard library). This can then be passed to your <img> html element, either native JS document or with a library like React.
The way I see it, there's no one solution that meets all of your needs. Your best option, imo, is to go with Flash and hope that Adobe sets an agreement with Apple to get Flash on the iPhone/iPad. The major downside, of course, is you'll have to rewrite much of your code.
If the mobile sector isn't absolutely critical, then choose the Silverlight option for reasons you mentioned already. You could also use Silverlight in an out-of-browser mode to work as a desktop application.