Why does Tasky have separate .csproj files for the core projects?

I am trying to understand Tasky. I see there are separate .csproj files -- Tasky.Core.iOS and Tasky.Core.Android. Furthermore, they contain separate copies of the same code.

What is the purpose of this? I thought the whole point of cross-platform was to use the same core for both projects.

Posts

  • SteveFlackSteveFlack GBMember ✭✭

    I would imagine it was either because when it was written PCLs didn't work in Xamarin, or that the contain platform specific sections that were conditionally compiled.

  • GuillermoGutierrezGuillermoGutierrez ESMember ✭✭✭

    PCLs support was added few weeks ago. Separate Core projects was the previous way of sharing code among platforms (it's still the recommended way in the documentation).

  • WilliamJockuschWilliamJockusch USMember ✭✭
    edited December 2013

    Got it. I see the sample code here: http://docs.xamarin.com/guides/cross-platform/application_fundamentals/pcl/ I also notice that they mention some limitations of the PCL. I'm kinda new to this, and I want to design for the future. My instincts are that in the long run, Xamarin will want to solve the limitations, and the PCL is likely to work out better. Are there reasons to doubt that?

  • WilliamJockuschWilliamJockusch USMember ✭✭
    edited December 2013

    Hmmm, when I download TaskyPortable from the link above and open it in Visual Studio 2012 or 2013, VS barfs on the Windows Phone project. And the iOS one doesn't run. Instead, it complains that "Identifier is not set in the iOS Application Property Page."

  • GuillermoGutierrezGuillermoGutierrez ESMember ✭✭✭

    The complaint about Windows Phone project is because you need to download the Windows Phone SDK to run WP projects.

    The complaint about iOS App application identifier is because you have to specify a App Bundle Identifier for the Application. You can set it editing the Info.plist file or editing the iOS project properties.

    I'm working on production-environment projects with PCL without issues.

  • SKallSKall USMember ✭✭✭✭

    William, PCL's are limited in a sense that many namespaces are not available depending on the configuration. For example if the PCL targets iOS, Android and WP8 then because of WP8 any library containing synchronous web/file calls are excluded as WP8 only supports asynchronous calls. One example is System.Net.Http needed for HttpClient class.

    PCL shortcomings can be easily addressed with dependency injection.

  • MartinBauligMartinBaulig DEXamarin Team Xamurai

    These samples were created before we implemented PCL support and some of them also use platform-specific code. When working on PCL support, I actually tried to turn some of them - including Tasky - into PCLs, but the problem was that they were using platform-specific APIs that are not available in PCL.

    However, there seems to be a way of solving this problem with NuGet packages, but this needs some more research.

Sign In or Register to comment.