Can I make a Xamarin CP application run in background

FouratZitouniFouratZitouni USMember

Hello,
I'm thinking about buying Xamarin and Xamarin.Forms but I want to check something first. I want to build a cross platform applications (Android, iOS and WP8) that can run in background, I checked most CP framworks (built upon PhoneGap) and can't do that using them.
So does Xamarin do it ?
Thanks.

Best Answer

  • adamkempadamkemp US mod
    Accepted Answer

    Xamarin lets you write native applications in C#. Anything you can do in a native iOS or Android application can be done in a Xamarin.iOS or Xamarin.Android application because you are using the native APIs (just from a different programming language). The cross-platform comes just from being able to write apps for different platforms in a common language (C#), which means you can share code between them.

    Xamarin.Forms takes that a step further by giving you a cross-platform UI abstraction layer with an MVVM architecture, which allows you to share even more code. However, it's still built on top of Xamarin.iOS and Xamarin.Android, which means you can still interact with the native platform APIs when needed.

    So again, you can write a cross-platform application using Xamarin, with varying amounts of code reuse depending on which approach you take. That application can also do backgrounding in the same way that a native app can (subject to standard platform limitations that all apps are subject to).

    I don't know what kind of documentation you want. Start here.

Answers

  • adamkempadamkemp USInsider, Developer Group Leader mod

    Xamarin doesn't provide a single cross-platform API for doing background tasks, but you can use native APIs in Xamarin to handle the app life cycle and integrate with the platform-specific backgrounding systems. Xamarin allows you to share all of the code that is not platform specific.

  • FouratZitouniFouratZitouni USMember

    So you mean that I can build my app with Xamarin cross platform and build a background service with Android, iOS and WP8 and finally duplicate the CP app and connect it to each service and then deploy. If that's true could you please provide me with documentation ?
    Thank you @adamkemp

  • adamkempadamkemp USInsider, Developer Group Leader mod
    Accepted Answer

    Xamarin lets you write native applications in C#. Anything you can do in a native iOS or Android application can be done in a Xamarin.iOS or Xamarin.Android application because you are using the native APIs (just from a different programming language). The cross-platform comes just from being able to write apps for different platforms in a common language (C#), which means you can share code between them.

    Xamarin.Forms takes that a step further by giving you a cross-platform UI abstraction layer with an MVVM architecture, which allows you to share even more code. However, it's still built on top of Xamarin.iOS and Xamarin.Android, which means you can still interact with the native platform APIs when needed.

    So again, you can write a cross-platform application using Xamarin, with varying amounts of code reuse depending on which approach you take. That application can also do backgrounding in the same way that a native app can (subject to standard platform limitations that all apps are subject to).

    I don't know what kind of documentation you want. Start here.

  • stvansolanostvansolano UMInsider, University ✭✭✭

    @FouratZitouni what kind of background tasks you expecting to do in background?

  • FouratZitouniFouratZitouni USMember

    @stvansolano I want to make the app send a HTTP request and get results and then wait the amount of time returned as result and finally make a push request when the time is done.

  • HmatrixHmatrix NGMember

    @FouratZitouni did you find the answer to your question?. Kindly share here, I'm trying to do the something similar. Thanks

  • @Hmatrix Hi, unfortunately I didn't find any CP solution that could make that, so I got back to native

  • AmanKharzoumAmanKharzoum USMember

    @FouratZitouni said:
    So you mean that I can build my app with Xamarin cross platform and build a background service with Android, iOS and WP8 and finally duplicate the CP app and connect it to each service and then deploy. If that's true could you please provide me with documentation ?
    Thank you @adamkemp

    @FouratZitouni is this way works?

  • @AmanKharzoum said:

    @FouratZitouni said:
    So you mean that I can build my app with Xamarin cross platform and build a background service with Android, iOS and WP8 and finally duplicate the CP app and connect it to each service and then deploy. If that's true could you please provide me with documentation ?
    Thank you @adamkemp

    @FouratZitouni is this way works?

    I didn't try that approach because.

Sign In or Register to comment.