Build portable SignalR component with Xamarin - c#

I have a Windows Phone 8 app that makes use of real time server push via SignalR.
I started to create a Native Android and iOS version of my app, but got stuck at implementing my SignalR component in native Android Java and iOS obj-C.
I have conceptually thought of a way to achieve this by making ONLY JUST the SignalR component portable via Xamarin.
Is it possible to create a Hybrid app in this way ?
And are there any resources online where people have done such.
Thanks for your help.

Xamarin would be kind of an all in sort of thing. So all of your Objective-C and JAVA would need to be ported to Xamarin's framework. That might not be a bad idea though ;).
Alternatively, if you are looking for a more cross platform way to implement a SignalR client, you maybe could wrap the logic up in a UIWebView (iOS) or WebView (Android) and use the JavaScript components. Here is an example from Microsoft on implementing a SignalR client via JavaScript. I don't know how integrated the SignalR functionality is in your app, but this may be an easy way to use it for simple display purposes.

Related

Is it possible to Convert or wrap C# APP to IO Xcode Apple APP and Android

I have an app developed for windows 10 on C# and now I want to move to IOS and Android. I have heard of xamarin and used some of there stuff in C# but would it be possible to embed the C# code and move it to apple xcode without having to redevelop the app from again?
would it be possible to embed the C# code and move it to apple xcode without having to redevelop the app from again?
No, it is not possible. Basically you can share some UIs across different platforms, but I think redevelop your app for each platform is necessary.
Not sure if you want to use Xamarin.Android and Xamarin.iOS or Xamarin.Forms to develop your app, you can use C# for development by using Xamarin, it provides a cross-platform implementation of the extensive features in .Net framework, but the actual implementation on each system is very different. For more information, you can refer to Understanding the Xamarin Mobile Platform.
For Xamarin.Android and Xamarin.iOS, you can refer to Android Architecture and iOS Architecture.
For Xamarin.Forms, you can have your UIs and some basic features designed in the PCL in order to share across different platforms, but for most features just for example like working with files, we need to access the native method of each platform, therefor, Xamarin.Forms provides a locator named DependencyService to achieve this.

How to reuse existing C# code in Android?

I have a C# network protocol library (about 5000 LOC) which I want to reuse in an android app. The protocol is likely to change in the future.
What is a good way to do this?
Port the library to Java/Android?
Use some sort of C# to Java converter like this. Build a Java library with the source and use it in my Android app?
Build a android service with Xamarin.Android (monodroid) and write a native Android app which uses this service?
other options?!
If you are looking to make an Android app and using Java isn't a requirement, Xamarin.Android is a very good solution. The way you build the app is pretty much the same as you would with Java. You still have resource files and axml files, etc. The main difference is that you use C# instead of Android.
There has also been some anecdotes that the .NET VM runs faster than Android's Dalvik JVM. So it is possible that your C# code will run faster than a Java port.
The Alpha Channel of Xamarin Studio has initial support for PCLs so if you have your library as a PCL already it may turn out to very easy to just plug it in.
You may want to check out this discussion to get a sense of Pros and Cons of C# vs. Java:
MonoDroid VS Java in android development?
You can also use this website to scan your lib to see how mobile friendly it is:
http://scan.xamarin.com/

Ideas for a C# UI framework

I need to develop a C# touch-screen desktop application with a "modern good-looking" UI.
How would you approach it? I´ve got in mind using Flash (just for the UI) or WPF... but i´m open to any idea or any third-party C# UI you´d know.
Is Flash easy to integrate with C#?
Thanks for your knowledge!
You should look for a AMF remoting library in C#.
Remoting is when you call a function on your server from flash.
AMF (version 0 or 3) is a binary format used to encode object transfered
between client and server
Weborb and fluorine are solutions for this.
see : .NET and AMF
You will probably be doing well with a third party framework to avoid the overhead of writing user interactions, controls, etc.
A couple of options are
http://xamarin.com/
http://www.resco.net/developer/mobileformstoolkit/
A review of these options is provided here.
I recall combining a flash interface with a C# back-end back in university. There's a method called fscommand() that will take a couple of string parameters (I may be mistaken, read up on it) to pass to and from the interface and the C# "code-behind".Flash is an ok option, but if I were you I'd opt for a WPF interface. I'm a huge fan of the telerik libraries, their WPF one allows you to create the most modern-looking interfaces and dashboards. Not to mention that the skills you will acquire while learning enough about wpf will be hugely beneficial in your career as a developer the way things are going (depending, obviously, on what direction you're heading).
FlashBuilder 4.6 has some nice functionality for quickly building a UI that work on a desktop or mobile device. You could use FluorineFX (free) or webOrb on a webserver to send data back and forth to a database server if that were needed. If you build it with the Flashbuilder 4.6 mobile project template, it would work on a iPad, mac, windows pc, or android device as well. Since a pc touchscreen should use the same type of finger gestures as a mobile app, this might be a nice way to go. (I don't actually have a touchscreen on my pc, but it runs well with a mouse, so I'd assume it worked with gestures too).
Adobe.tv has lots of examples of building a mobile app project (Which also runs on a PC) and there is a Flashbuilder 4.6 free trial.
http://flex.org/

developing tool for building Android/Iphone app

I have .net c# background(don't mind to learn new language to get the things right). Right now i want to make some small applications for Iphone/Android phones.Basically, i will show some graphs with data retrieved through my webservice.
Can anyone tell me which developing tool should i use to create those small apps quickly?
I don't have any experience with Flash.And i just know that Flash builder 4.5 can convert Flash applications to Iphone/Android. However, i don't feel like that it is a native way to build Iphone/Android app
But if you advise that, i might go that way.
thank you
Xamarin has products that allows you to use C# (and your existing skills) for both iOS (iPhone / iPad) and Android devices : MonoTouch and Mono for Android.
disclaimer: I work for Xamarin
You might want to use frameworks that help build apps for multiple platforms with the need to know native programming languages. PhoneGap is one of these popular frameworks.
You can use C# to create a WCF service. There are a few different libraries to develop Android applications. If you want to work with C#, you can check out Mono for Android.
http://docs.xamarin.com/android
From my knowledge, however, Java is the preferred language to develop Android application. Eclipse has a great plugin which integrates with the Android SDK / Emulator.

Develop a C# application for Windows Mobile, Android & iPhone

I have a project where I need to build a C# application that is able to run in iPhone, Android and Windows Mobile.
For windows Mobile that is no problem, but I think its a challenge when we try to develop for Android and iPhone.
I've been searching for solutions and i found some information about Mono-Android and MonoTouch.
My question is, has anyone used this API's? Are they good?
Do they really take advantage of Android/iPhone native api's?
Can I with only one source code create an application for both platforms?
And finally, is there any other way of creating a C# application for these mobile platforms?
Yes they are very solid. They give you .NET 4.0 with all of that capability & the ability to share data access, networking/API integration, and business logic in shared assemblies. You'll of course have to write the user interface portion of the applications in C# but specific to the platform.
For example, MonoTouch is like Cocoa in C#. It will feel unlike your typical .NET programming style, so make sure you get comfortable reading Objective-C for documentation & assistance.
Also recommended is to follow the UI guidelines of the platform in question. Don't create a cookie cutter app for all platforms or it will suck everywhere.

Categories

Resources