Reputation: 1362
I am supporting a legacy Android app that was written in Xamarin. That Xamarin app will be replaced by a Cordova app. During a transition period I will need a solution that will support both. My high level thoughts are that after the user logs in to the app, I will send them to to what is applicable for them (legacy Xamarin or new Cordova). The app would effectively contain the code-base for both apps.
Is this sort of thing possible with Cordova - i.e. can I 'wrap' an exising Xamarin application inside of a Cordova one?
Thanks.
Upvotes: 0
Views: 376
Reputation: 53301
I've found this link about using phonegap on monotouch apps:
http://scott.blomqui.st/2012/08/embedding-cordova-phonegap-in-monotouch-apps/
Upvotes: 1
Reputation: 1414
The short answer is "no." Xamarin generates an executable binary, not a collection of HTML or JS files thus Cordova/PhoneGap cannot "wrap" it. With that said, you can probably do a couple of things:
1) Have your Cordova app open the original Xamarin.Android app via app url: Android Custom URL to open App like in iOS
2) In your legacy Xamarin.Android app create a WebView that loads the HTML/JS that your Cordova/PhoneGap would've. Basically, in a way, you'd be recreating the functionality of Cordova with Xamarin. http://developer.xamarin.com/recipes/android/controls/webview/call_csharp_from_javascript/ http://developer.xamarin.com/recipes/android/controls/webview/load_a_web_page/ http://developer.xamarin.com/recipes/android/controls/webview/load_local_content/
Upvotes: 1