How to make my WP8 app compatible for WP7.8 - visual-studio

I am asking here because I'm a little bit confused. I have a working WP8 apps, with WP8 specific features such as speech recognition and custom tiles. I would like to make my app compatible for WP7.x
I know I have to remove speech recognition from my app to support WP7
1 - Where should I start ? Could I use the same project on Visual Studio 2013 or should I create another project on Visual Studio 2012 ?
2- Is it simpler to target only WP7.8 or can I do WP7.5 and WP7.8 in a same project ?
3 - I want to keep the use of async/await method, can I do that in WP7.8 or WP7.5?
Thanks a lot for your answer

You have to create a new project targeting 7.1. WP7.x apps can run in WP8 devices, but not in the other way.
When createing the project, you target 7.1. If you have the latest SDK installed WP7.8 features will be available.
You can by adding Microsoft.Bcl.Async package from NuGet

"Could I use the same project on Visual Studio 2013 or should I create another project on Visual Studio 2012 ?"
You cannot target WP7 in VS 2013. You must use VS 2012 or 2010.
"Is it simpler to target only WP7.8 or can I do WP7.5 and WP7.8 in a same project ?"
You can target both in the same project. The main difference is just different tile sizes in 7.8 and if you want to support this you can use reflection to check. Otherwise there is no difference.
"I want to keep the use of async/await method, can I do that in WP7.8 or WP7.5? "
There are Nuget packages which support this.

Related

Is there a simple way to install the Xamarin PCL profiles in Visual Studio?

My company is developing corporate Windows 8.1 apps for use within the organisation. Although we are only targeting Windows 8.1, we are interested in developing our apps with a view to eventually target Android and/or iOS by using Xamarin.
So, we want to develop using PCLs that are compatible with Xamarin, but we haven't licenced it yet, since we're not ready. Can we simply install the PCL profiles for Xamarin so we can at least be assured that our classes will be compatible, if and when we are ready?
So you have couple of possibilities.
As m-y mentions in his comment you can install the trial and you will get the PCL profiles.
You can get someone else with the Xamarin tools installed to grab a copy of the PCL profiles on his machine (a bit harder to maintain).
You can buy the product (might not be what you want)
However, you could go ahead, make the PCL you are currently using and target it to WPA8.1 and Windows 8.1, and later on just change the profile and make the minor corrections it would take to get it working with Xamarin.
The profiles are not xamarin profiles - they are .net profiles which xamarin support.
The profiles are installed as part of visual studio 2013 - or can be installed as extensions to visual studio 2012.
If you select WindowsPhone Silverlight 8.0, .net 4.5 and Windows Store apps then this will allow you to build a profile 78 pcl library - which is one of the profiles xamarin support - and is a pretty good choice for modern development...

Can Visual studio 2013 run WP7 project

I had developed one application for WP8 devices(Target OS is WP8) in VS 2013 with WP8.1 SDK.Now I need to give support to WP7 also.Can I use WP7 SDK on VS2013 and develop app for WP7.So, I will create 2 apps for WP7 and WP8 and upload both on store.
What should be better solution?
Thanks.
I've encountered this problem several times, unfortunaly VS13 does not cooperate if you want to work with WP7 projects.
So if you really want WP7 apps, which I would reconsider since the marketshare is relatively small and I'd guess that people who download apps already have newer versions. Don't forget that lot of features may not be suported and you'd have to come up with new solutions..
Anyway, in case you decide to create WP7, dowload VS12 Express for example, create WP7 project and then copy files from your WP8 and see what works and what not.
You can open an existed project of WP7 using VS2013, but can't create new project by it.
When you create a new project in VS2013, it can only be WP8.0 or 8.1.

Creating MvvmCross PCL to target Wp7.1 Xamarin.iOS, Xamarin.Android, .Net 4.5 and SL4 and higher

After researching MVVMCross project, I am very keen to use it in a new mobile project and began setting out my project today. All was going fine until I tried to target the exact frameworks Stuart does in the "N=0 : A first MvvmCross Application" youtube video. I've no idea why this collection isn't allowed and I'm not as knowledgeable on PCLs and "profiles" as I could be.
Environment:
I'm using VS2012, although VS2013 is installed also. WP7.1 is installed as is SL5 and Xamarin.iOS and Xamarin.Android. I've tried to repair both Xamarin installations because I thought the issue might have been that I installed WP7.1 after the Xamarin pair.
Also worth noting is that if I uncheck Windows Phone 7.5 and higher then it still won't work. I have to also set Silverlight 5 for the dialog to let me proceed. I'm not sure what more I can do do get this working so I'd appreciate any help I can get. All I want is to basically target the exact frameworks as are in that video mentioned above.
There are no Monotouch or Monodroid projects right now in Xamarin, so that link will not realy help you. They are called now Xamarin.iOS and Xamarin.Android. So what I've done that helped me, I've extended Profile 7, so it now supports WP7, iOS, Android and WinStore and it works great, no problems yet and I've already complete a couple of projects with it. So at that link - PCL Setup - you can find where all the profiles located and with that info try to extend Profile 7 as I suggested. So I've coppied the Windows Phone 7.xml from C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile131\SupportedFrameworks to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile7\SupportedFrameworks
The video and PCL setup link are out of date now that Xamarin has released official support for PCLs. I'd recommend targeting the following platforms:
Windows Phone 8
Windows Store apps (Windows 8)
.NET Framework 4.5
Xamarin.iOS
Xamarin.Android
And, optionally you can target Silverlight 5.

Xamarin IDE and visualstudio for windows +Mvvmcross

I have some confusions About the IDE to use for MvvmCross
a) VisualStudio (VS) uses Xamrarin.iOS and Xamarin.Android plugin for iOS and Android development. But can we also use PCL(Portable Class libraries) and MVVMCross/Monocross frameworks in VS? I see the PCL option on VS but, i don't see the support for Android & iOS. Do i need to install additional plugin for PCL to support these two platforms as well?
b) Xamarin IDE supports Android and iOS development on Mac but, is it true that Xamarin doesn't support Mono.iOS on windows? Isn't it strange that Visual studio can use the network mac for iOS development but why not Xamarin Studio?
Thank You for your time.
Regards,
Saurav
a) VisualStudio (VS) uses Xamrarin.iOS and Xamarin.Android plugin for iOS and Android development. But can we also use PCL(Portable Class libraries) and MVVMCross/Monocross frameworks in VS? I see the PCL option on VS but, i don't see the support for Android & iOS. Do i need to install additional plugin for PCL to support these two platforms as well?
MvvmCross currently uses Profile104 for Portable Class Library development. You can easily develop for this profile without installing Android and iOS. The mapping of PCL profile to platforms is, however, quite confusing (it's not exactly obvious) so the easiest way I find to create a Profile104 PCL is:
to create any PCL
then to manually edit the csproj file to say Profile104 - look for a line like: https://github.com/slodge/MvvmCross-Tutorials/blob/master/Babel/Babel.Core/Babel.Core.csproj#L14 in the csproj
I have customers who develop in medium size teams where only some people have the Xamarin tools installed - most people have just Windows tools and work on the PCLs using Unit Tests and using WindowsPhone/Store user interfaces.
b) Xamarin IDE supports Android and iOS development on Mac but, is it true that Xamarin doesn't support Mono.iOS on windows?
Yes, this is true.
Isn't it strange that Visual studio can use the network mac for iOS development but why not Xamarin Studio?
This may feel strange, but I believe this is actually this is Xamarin listening to their customers.
I believe, that the reason customers wanted Windows support for iOS was because they wanted to use Visual Studio and they wanted to use plugins like Resharper. Xamarin provided this in their 2.0 release.
It is true that they could also have added iOS functionality to XamarinStudio for Windows as well - but this (I believe) wasn't what any of their customers were asking for - so adding it would have created more work (both in creating and maintaining it) without adding any significant benefit (IMO)

Is it possible to build a Monotouch application in Visual Studio?

I would like to know if it is possible to compile a Monotouch project that does not have any reference to any UI library in Visual Studio. This project only use the Monotouch framework.
I have done some research and I read that, if the project don't have any reference to the Apple SDK , I should be able to build a MonoTouch project using Visual Studio. If I can, do i need some particular configuration to achive my goal.
Some related links:
How easy is it to develop an iPhone application using MonoTouch in Visual Studio?,
How can I develop for iPhone using a Windows development machine?,
iPhone development on Windows
Even if your project doesn't have any references to MonoTouch libraries, it is still a MonoTouch library project. Visual studio doesn't recognize that project type and because of that you can't really compile the code.
I wrote about this a while ago, and how you can change your project so you can actually use Visual Studio for development (although you won't be able to run the app) here:
http://escoz.com/blog/developing-with-monotouch-on-windows-and-visual-studio
Hope that helps.
There is a Visual Studio addin that may help. It hasn't been updated in a while though. Also, this would only help you write the code. To compile and run the code, you will still need MonoTouch and a Mac. https://github.com/follesoe/VSMonoTouch
Update : As of February, 2013 Xamarin includes Visual Studio support for developing iOS apps in their Business sku of Xamarin.iOS. You can fully develop on Windows + Visual Studio, but still need a Mac on your network to perform builds and run the simulator.
If you're talking about building a DLL or library in VS.NET that you could then use in a MonoTouch project, I believe the answer is NO. To be usable in MT, the code has to be compiled with MT.
The MonoDevAssist VS extension (search VS Extension Manager for "monotouch") seems to work perfectly. There are just a couple of easy steps to follow post-installation, which are documented here:
http://monodevassist.codeplex.com/documentation

Resources