I'm playing with interesting things but this is because i'm porting windows
mobile to ios, and then to android, and web and windows phone 7Š phew.

With extensions and inheritance is possible to do interesting things, like:

textBox.SetText("My Text on this text view/textbox/text something");

This can run on ASP.NET, iOS, Windows Mobile and in theory on MonoDroid and
Windows Phone 7. This is an extension created on a class of extensions than
can have #if to differentiate between platforms or could be one class for
each project with the same name maybe.

The thing is, os Widows it will have inside a TextBox textBox.Text =
NewText;
On iOS it will have a UITextView textView.Title = NewText; // seriusly I
don't know the correct names withou look, and I didn't look at this moment,
it's just to be a sample.
On ASP.Net it can have something like send Ajax/Jquery code to change the
text without a complete submit.

With that way I have really near codes between things, and if have time
could be maybe equal in allŠ..

Yesterday I created a class Form : UIViewcontrollerŠ added a Close method
like windows (I don't care about animation = false.. To me it can be always
true to Dismiss) and added a eventHandler like isClosing to execute
something in parent view/form if needed, to simulate a modalDialog on
windows that stay in pause until it's child is closed. Can have also a
DialogResultŠ public from child Form.

So now all my view controllers are now Forms.

I think that can be possible to create controls in ios and mono to e with
the same name of windows, and the same properties and methods..
Or combine with extensions equal in all platforms.

I call views and activities like FormSomeThing, and my fields has the same
names on all places.

If could be possible to create an application that draw UI and translate all
to objects with properties, events, etc, using all in the same way, it could
be possible to do a lot of things equal in all places. Of course somethings
aren't possible like webkit on windows mobile for free, etc. But at least to
manage forms, fields, openings, closes, etcŠ. Special things of each
platform must be performed maybe from code.

Karl

From:  malexandroni <malexandr...@gmail.com>
Reply-To:  "monodroid@lists.ximian.com" <monodroid@lists.ximian.com>
Date:  Thu, 28 Jul 2011 15:29:49 -0700 (PDT)
To:  "monodroid@lists.ximian.com" <monodroid@lists.ximian.com>
Subject:  [mono-android] Just an idea: 'MonoGap'

Guys,

Sorry if this is not a really 'new' idea, but it crossed my mind these days
and I would like some feedback from you.

The problem is: how to build an app that could work on Android, iOS (the
mainstream) and perhaps other platforms? Ok, we have Mono for iOS and Mono
for Android, but what about the UI? They are really different among
platforms.

On the other side we have a 'partial' solution: WebApps written in any Web
Framework (Sencha Touch, JQuery Mobile, etc) and PhoneGap to build a
'native' app. The problem with this approach is that the JavaScript is
limited and if you want to introduce anything new, you have to create a
native class for iOS, Android, etc. So, you are maintaing many different
sources again.

I thought if we could do something like this:

- The View: The application would be a WebApp, like those we would create
with any Web Framework, running in the WebView component. Ok, it's not
'native', but changing the CSS file it can look very close to native under
any platform, with the same objects.

- 'MonoGap': it would be amazing if we could create a class library for iOS
and other for the Android called for example 'MonoGap' that we could
reference in our application. This library would give access to a 'MonoGap'
namespace in the WebApp with calls for Accelerometer, GPS, Camera, etc.

- The Controller: pure C# classes we write under Mono that gets accessible
to the WebApp through a custom namespace. Actually, it's like PhoneGap does,
but it would be our custom code.

- The Model: also, pure C# classes to handle the data under Mono, whatever
data source it is, local, remote, object, relational, etc, etc.

With this kind of approach, we could really build powerful applications,
because all the application logic (calculations, data management,
communications, etc), could be done with C# code, under Mono, shared among
all platforms, and the UI could also be the same. Debugging would be easy,
as all the complex logic would be under Mono.

What are your thoughts?

Marcio Alexandroni.

--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/Just-an-idea-MonoGap-tp4644458
p4644458.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid



_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to