Page 1 of 1

Android Templates

PostPosted: Sat Mar 29, 2014 4:40 pm
by vmavra
Hi,

Would it be possible to create an Android project template for Visual Studio using Cobra? Or maybe for Xamarin which afaik is based on MonoDevelop which already supports Cobra quite nicely?

Re: Android Templates

PostPosted: Mon Mar 31, 2014 9:25 am
by nerdzero
I don't believe the Visual Studio plugin for Cobra supports projects yet. I could add new project templates to the MD/XS addin but I'm not really sure what would be involved to get a Cobra app to run on Android.

Re: Android Templates

PostPosted: Tue Apr 01, 2014 10:26 am
by vmavra
Thanks for answering nerdzero,

Well since Cobra code is interpreted as C# code when it's compiled I think it can be done, all we need is to figure out how to bind the Cobra compiler to an XS project and the rest is simple, a XS Android project is composed of AndroidManifest.xml, MainActivity.cs which would probably get changed to MainActivity.cobra, AssemblyInfo.cs, Resources and the four included Mono.Android, System, System.Core and System.Xml references. Don't know if syntax highlighting and code completion could be added for a new language to the IDE but that's not too important for me at least.


LE: There's also an AboutAssets.txt document with info about Assets.

Re: Android Templates

PostPosted: Tue Apr 01, 2014 10:56 am
by nerdzero
I'm pretty sure android projects also include some non-standard MSBuild targets so that might be part of it too. What would be good info to have is if someone can grab the msbuild/xbuild output for the most basic Android app and also the arguments passed on to the C# compiler for the CoreCompile target.

Re: Android Templates

PostPosted: Tue Apr 01, 2014 11:44 am
by vmavra
Here's info about the build targets: http://docs.xamarin.com/guides/android/ ... d_process/

Re: Android Templates

PostPosted: Tue Apr 01, 2014 12:08 pm
by nerdzero
Yeah, that's a great starting point. It looks like it would be a healthy amount of effort to make the required targets and make everything play nice. I won't be able to dedicate the required time for quite a while (too many other things to work on right now) so someone else will have to take the lead on this. I can try to help answer questions though.

Re: Android Templates

PostPosted: Sat Apr 05, 2014 2:43 am
by DelphiGuy
As I've discussed with Nerdzero previously, I would think that the Holy Grail of getting XS/Cobra to work with Android, would be to instead get it to first work with portable class libraries. That would likely cover the code for, say, 70% of any Xamarin project and then the rest of the Android-specific GUI work could be done in C# -- with the tradeoff/advantage being that the Cobra 70% could immediately be compiled into an iOS, Win, etc. project as well.

I'm really not sure that any other language currently provides great support for PCLs, other than C# and Visual Basic (on VS, of course).

The following link gives the idea. Just mentally substitute the word "Cobra" every time you read the phrase "Visual Basic".

http://blog.xamarin.com/visual-basic-goes-mobile-with-portable-libraries/