Forums

Android Templates

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Android Templates

Postby vmavra » Sat Mar 29, 2014 4:40 pm

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?
vmavra
 
Posts: 15

Re: Android Templates

Postby nerdzero » Mon Mar 31, 2014 9:25 am

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.
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: Android Templates

Postby vmavra » Tue Apr 01, 2014 10:26 am

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.
vmavra
 
Posts: 15

Re: Android Templates

Postby nerdzero » Tue Apr 01, 2014 10:56 am

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.
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: Android Templates

Postby vmavra » Tue Apr 01, 2014 11:44 am

Here's info about the build targets: http://docs.xamarin.com/guides/android/ ... d_process/
vmavra
 
Posts: 15

Re: Android Templates

Postby nerdzero » Tue Apr 01, 2014 12:08 pm

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.
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: Android Templates

Postby DelphiGuy » Sat Apr 05, 2014 2:43 am

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/
DelphiGuy
 
Posts: 116


Return to Discussion

Who is online

Users browsing this forum: No registered users and 97 guests

cron