Xamarin.forms long running background work - xamarin

I'm new to Xamarin platform. I'm developing an application for all three major platforms (WP,iOS,Android) using Xamarin.forms.
How can I sync data with my server in the background -> I need something similar to Android Service. I want to sync the data even when the user goes to a different screen of the app. It would be great if I could continue syncing the data even when the user leaves the app.
Thank you

This is the only solution i have found
http://arteksoftware.com/backgrounding-with-xamarin-forms/
in a few words:
You can't abstract background tasks in Xamarin.Forms because iOS, Android and WP works in a different way. You have to use MessagingCenter to send and receive data from specific implementations in each platform

Have look to this article: http://developer.xamarin.com/guides/ios/application_fundamentals/backgrounding/part_3_ios_backgrounding_techniques/ios_backgrounding_with_tasks/
You could provably be interested in the Transfer Background tasks.
Regards

Related

Creating local scheduled events notifications with Xamarin forms

I apologise in advance for my fairly broad question, but I am just looking for some general guidance on how to approach the issue below.
I am developing my first app for android/iOS with Xamarin Forms. I need to do reminders(notifications) for medical use. As this is scheduled in advance I would just use local notifications.
I have been browsing through the Xamarin documentation but I find it very confusing and lacking proper examples.
I think I have to use dependency services as there is no xamarin.forms implementations as far as I can tell. What is the best way to go about this and does good examples exist for local notifications?
Also for the moment my application stores all data online, will it be possible to store/schedule these notifications with something like an event id for reference? I would also like to be able to perform actions on the notifications(from the lock screen), but this can wait.

Nativescript detect other Apps

Is there a way in Nativescript to detect when another App opens and if so then close it based on a setting flag?
I found a plugin http://plugins.nativescript.org/plugin/nativescript-applist that will list all apps on the phone
NativeScript does not provide such a logic, neither internally nor as a plugin, afaik.
For the Android side you could realize this behavior by writing a background Service which is started at system boot time and periodically checks if apps have been started. Here is an link to an example on SO.
For the iOS side I think this is not possible, imho (correct me if am wrong).

What's the easiest way to make a real-time chatting app with Xamarin?

I'm trying to figure out a way to create a real-time chatting app with Xamarin and some kind of backend technology. How can I do it?
I have a better solution. The above-mentioned technologies(buddy SDK & SignalR) will require you to integrate and handle everything by your self. Instead, you can go for CometChat SDK, which has real-time chat along with Audio/Video chat functionalities. Also, you can use its ready-made UI inside your application. It is the easiest & quickest way for you to make a real-time chatting system. For more information on CometChat you can refer to the following link:
https://developer.cometchat.com/docs/xamarin-forms-quick-start
As mentioned by ChristiaanV, SignalR is the way to go.
The Performance is great with Xamarin, we delivered more than 150k messages within 2 hours without any problems regarding the connection.
With Azure Mobile App and ServiceBus, you can easily scale out your backend, as described here http://www.asp.net/signalr/overview/performance/scaleout-with-windows-azure-service-bus
Have a look at SignalR, it's a good and easy to use framework to do realtime 'things'. They also have a Xamarin Component which is free to use.
https://github.com/SignalR/SignalR
http://components.xamarin.com/view/signalr
Please note that I personally don't have experience with using it on mobile devices, so I can't tell you anything about how it's performing battery / performance wise.

Handle location updates in the background

I'm new in developing application for Windows Phones.
Till now I'm only experienced in developing desktop applications in .NET and mobile apps for Android platform.
I want to develop an application which consumes the location updates of the GeoCoordinateWatcher in the background (user starts position tracking and switch over to any other apps on the phone). And as soon as a certain criteria matches for the current location I'll inform the user about that event. (turn on vibration module or play a specific ring tone, ...).
The only two things I've read in the internet is using MPN (push notifications) or Agents (e.g. PeriodicAgent). But both of them aren't suitable.
I need some basic hints how to achieve the behavior mentioned above. Aren't there any background tasks?
Thank you very much!
Kind regards, Danny
AFAIK, periodic agents are only thing you can use. But they are run automatically every 20-30 mins and its not suitable if you need to check the location more often.

Best way to approach WP7 app development?

I have some knowledge of basic PHP developing however right now I am thinking about developing a phone app. I do however have a bit of a conundrum in that I love WP7 and I have so many ideas for features which can't be done on iOS and Android, however at the same time I am completely aware that my target users (filmmakers) generally have iOS or android phones.
Is there a way I can develop the app, which I will get a developer to do rather than myself, with WP7 as the lead platform and then make a relatively simple conversion to the other platforms or do apps generally have to be completely reworked for each platform?
Also, just to though it out there, any idea of where to go to find a freelance app developer?
Thanks
James
I think you have a few options, but the first question I would have is: where comes the data from. Are you the owner of the data, and do you already have a datasource from where you can get the data from? If not I would suggest take some time to write a decent 'backend' from which the different platforms easily can get the data from.
Also all different platforms have their own pro/cons which you cannot share that easily. If you build a WP7 app in silverlight/xna, you cannot directly port it to a ios/android variant, also functionality will probably look/react different. You will need different solutions foreach platform with this approach.
Another option would be to use an platform like phonegap which can create a solution that will work on multiple platforms. (It uses HTML5 to get it work on the different platforms)
Build your app on iOS and android first, and when you have an app to base WP7 development then contact a developer that has made similar apps to yours.

Resources