I am trying to port a C# window's application to ipad. I compiled everything on monotouch and it runs well. Now, I need to make an iPad user interface. If I implement the UI in Objective C, how hard is it to integrate it with my C# core? I saw monotouch can call objective C library, but I am doing the opposite direction. Any help is appreciate.
There's currently no support for you to execute the C# code from Objective-C. Your best bet is to just stay in MonoTouch and finish the iPad application with C#.
Working with UIKit in C# is at least as simple as it is with Obj-C, plus you get all the benefits of not having to deal with Memory allocation and the C# language and .NET framework. Developing UI code with lambda expressions and linq is a beatiful thing. Most obj-C sample code can be translated one-to-one to C# code, so almost every sample you find can be easily understood.
There is one possibility, you make your UI into a library, then you bind the library to C#, and then your C# code calls your Objective-C code to the UI, and this one in turn, calls back to C# for its business logic.
You are better off doing the UI directly in C# as well.
Related
Im trying to create an Extension condition in C# based on the Installshield article http://helpnet.flexerasoftware.com/installshield21helplib/helplibrary/SteExtCondAuthor.htm#buildingconditionalstatements_384870052_1039129
but this is referencing c++. Anyone do this in c# or have some examples in c#
Conditions may be evaluated multiple times, so we suggest keeping extension conditions fast and implemented in C++. And as of yet there is no built-in C# support for extension conditions. That said, I've seen a utility that creates an unmanaged entry point that can run managed code, and you may be able to use that wrapper. (Unfortunately I do not remember what it is called.)
Once you have your managed code up and running, you just need to communicate back with the Suite. Do this by declaring the ISuiteExtension interface, and use the IDispatch parameter to your method as such, just like in the C++ example. Reference the topic Working with a Managed-Code Action in a Suite/Advanced UI Installation for the C# declaration of ISuiteExtension, and some samples of how to write code using it.
Is there a way to debug the Objective C code of a static library bound to a Xamarin iOS project?
We have non-trivial code in the objective-c view controllers, that we would like to keep (using C# to provide the underlying data&handler). So debugging capabilities are highly necessary. Of course, I think in the long term the real/proper solution is to rewrite those controllers in C# (just keeping the .xib in xcode). We are far from there.
Thanks.
We have an app written in Objective C. It uses CoreData, RestKit, about 10 viewcontrollers.
We would like to migrate it to Xamarin (so we can target Android and Windows).
I was hoping there was a way to bind the current code to a Xamarin solution and kind of rewrite features step by step within Xamarin (eg: replacing a viewcontroller at a time, and at the end replacing RestKit+CoreData, by SQLite + ServiceStack).
I am aware of the binding to Objective C option that they provide, however, it doesn't look to be the appropriate fit for this (way too complex, probably easier to rewrite the app from scratch).
Is there a way to migrate our current project to Xamarin so we can convert? or do we start from scratch?
Thanks.
Options:
Migrate full project - no;
Automatically create binding for libraries, rewrite business-code, UI-code - yes;
Rewrite from scratch using .Net/Mono classes - yes.
If code size is relatively small, you should rewrite the whole app. Moreover, thus you could have a chance to separate business-logic from UI code and tools libraries (RestKit, CoreData). In perspective, that code will be more reliable and cross-platformish.
This tool can help. It does Obj-c to C# translation (some manual cleanup required):
Automagical
Quite probably, a re-write, from scratch. One thing to keep in mind, if your back-end is .net.. and you are using DTO's.. like with AutoMapper from Entity Framework objects.. you'll be able to re-use those DTO objects on your mobile side with Xamarin. If you are using OData, I'm not sure if this is still a problem, but Xamarin studio wasn't generating OData service clients. So you had to generate them in Visual Studio, then take the generated client code and throw them into your Mobile projects.
sqllite-net is awesome. I've never had any problems with it.
https://github.com/praeclarum/sqlite-net
I currently have a project, with DTO Objects from an Azure WCF service, that I push directly down into SQLLite objects on IOS and Android with Xamarin. I use RestSharp, rather than Service Stack. I should probably go learn the difference.
If you are looking to use SQLCipher from the Component store, to encrypt your sqllite db locally on your device (Good advice to do so), you should be aware that there is an issue in android.. going to 2.2 or 2.3 with SQLCipher. Works for ICS and above though, if I remember right.
Just be careful on your security implementation for allowing clients to connect. I want to say.. don't take too much advice.. and don't take too little either. : )
I'm currently trying to port an application from owl to vcl.
In my old projekt-file I was able to load dialogs with something like
TBatchAcDialog(TWindow* parent) : TAPDialog(parent, BATCH_DIALOG)
However, using TTaskDialog instead it doesn't support the second argument.
I have found an explanation for the user interface designer that when rightclicking on a menu you can load the first declared menu from a rc-file.
However, I don't really know how to load those dialogs as dialogs in this IDE and linking them to my classes again.
Does anyone of you know about this or could link me to an article about a similar problem? I seem to have failed finding a proper solution although implementing rc-dialogs seems to be a common problem to me.
I'm currently trying to port an application from owl to vcl.
What is your exact goal? To be able to build the application with C++ Builder, or to use VCL instead of OWL?
If you want to use VCL for the dialogs, then you cannot port them, you need to rewrite all the UI from scratch, as VCL is very different from the standard Windows dialogs.
If you want just to build the application with C++ Builder, then you can do so by upgrading to OWLNext - it is an open-source upgrade for the OWL framework and works with the modern compilers like C++ Builder and Visual C++.
You can also use OWLNext for a gradual migration to VCL - as VCL and OWL can co-exist in the same application, so you can migrate your old OWL application to C++ Builder, write any new UI in VCL, and gradually rewrite the old UI in VCL - it might be easier and safer than rewriting the whole application with VCL.
C++Builder does not have any native functionality that wraps resource dialogs in classes. You have to set that up manually in your own code if you need it. Otherwise, just use Win32 API functions like CreateDialog() when working with resource dialogs, or else redesign your UI to make use of VCL TForm windows instead of resource dialogs.
TTaskDialog is not what you think it is. It is just a wrapper for the Win32 API TaskDialogIndirect() function (Vista and later only), which is not related to what you are attempting to accomplish.
I'm trying to refactor some of the code of my monotouch app into a library (so I can use it in another app). Some of the code I want to move into the library is native (google analytics and facebook api native libraries), but I can't seem to find a way to get this to work, as you cannot link native code to monotouch libraries.
ie, this is what I'm trying to achieve:
[iPhoneApp facebookLib.a facebookWrapper.dll] ->
[iPhoneApp] [SharedLibrary facebookLib.a facebookWrapper.dll]
Am I missing something or is this not possible?
It seems to be possible, but perhaps I don't understand what you are trying to accomplish.
http://monotouch.net/Documentation/Linking_Native_Libraries
and here
Monotouch and native iOS code