lextudio / sharpsnmplib

Sharp SNMP Library- Open Source SNMP for .NET
https://sharpsnmp.com
MIT License
356 stars 152 forks source link

Port to MonoMobile (MonoTouch MT and MonoForAndroid MA) #369

Closed lextudio-support closed 2 hours ago

lextudio-support commented 2 hours ago

Hi everyone

I'm about to finish port to MM. There are still few issues with MonoDevelop. We have used version 6.1.1. on one of our project, so in order not to break our code I have ported 6.1.1.
I have tried with 7.x but ran into some problems and did not have neough time to fix 'em.

I will push my code to github next week and I'm willing to share my experience, knowledge
with You and tips how could we make porting easier next time.

Very short:

  1. I would separate csproj files like VS does single csproj per folder

  2. make all classes partial
    we are linking files with project linker and platform specific stuff goes to partial classes in
    separate files (#if defs are nogo)

  3. windows phone is long way to go (Cryptography, UdpClient,)
    I have shut the compiler up with ifdefs but it is ugly!
    Do not use WP projects. It may explode into Your face.

I'm waiting for some answers from Xamarin/mono guys to fix those issues I believe they are not biggies and will push to

https://github.com/moljac

Howtos will be on: http://holisticware.net/HolisticWare/Know- How/development.aspx

Next few weeks I have to finish app that relies on sharpsnmp. This appwill be presented as proof of concept to one conference, so I won't have enough time to do serious job

thanks a lot for Your lib and attention

regards

mel

Original Reported Date: 2012-08-04T00:24:13.763-07:00 Original CodePlex Discussion Thread ID: 390251

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi mel,

Thanks for this exciting news.

I was about to start a Mono for Android port before my desktop PC broke last week, so I rather wait till seeing your port first. I don't have a Mac, so I personally could not work on the port to MonoTouch. I don't think Microsoft ever does good jobs on mobile platforms. .NET CF was a failure, and Silverlight for Windows Phone 7 was another. Not sure what might happen for Windows Phone 8 and Windows 8 RT.

Anyway, cannot thank you more on your working and look forward to seeing your fork.

Regards,

Lex

Original Posted Date: 2012-08-04T17:51:52.83-07:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi Lex

No problems - we are thankful for Your work and this library.

So You have problems with bare metal too.... My box is almot 5 years old and I'm scared it may die any second....

Regarding Microsoft I think Windows Phone is not bad platform for games, social media and reading mail (I cannot browse on small screen), but
guys from Microsoft have forgotten word-noun Phone in the name of the product. Our team does VoIP too and unless MS allows ASAP
native SIP (VoIP protocol, not Software Input Panel = Keyboard in MS linguistics) they will be doomed...
Xamarin (mono) guys have made tremendous job (I just cannot find words of thanks and admiration for their work), so that .net developers can
enter other platforms. In my opinion, .net through mono has better position than java - just to note: iOS (but that's my opinion).
Regarding WP8 - I had pretty tough discussion with MS MVPs on one conference where I have presented MT and MA and they said
I should wait and see. It looked like either MS is gonna allow better networking stack (with UDP) and/or native apps for all dev, but no
real info.

I have borrowed Mac too, it is 4 yrs old MacBook Pro, but I'm working 90% in VS. These 10% are just to see, how projects/solutions copy
with MonoDevelop first on Windows and then on Mac.

First I took 6.1.1, cos we worked with it on our desktop project and when I tried to use 7.x it was too much to take care of backward compatibility
with desktop project and push forward to mobile. I have lost 2-3 days trying, but due to the fact that this mobile app is going to be shown on
one quite big and important conference I have decided to go with 6.1.1 and will do it again for 7.x if You want.

Following my instructions friend of mine made "port" from desktop WPF to MA in 2 days and one day was work to cut out Microsoft.Unity stuff
for configurations. He resorted to dirty trick: took some desktop assemblies (dlls) and referenced them in MA. This can be done (sometimes),
but suddenly it can break (as it did). I'm portability freak and I have always tried to target more platforms I can rember I tried to reuse Silverlight
on desktop it was doable, but with heavy tricksery.

So our team does

here it is: https://github.com/moljac/MonoMobile.SharpSNMP

cheers

mel

Original Posted Date: 2012-08-05T01:56:05.03-07:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi Lex

Did You take a look? Would You like me/us to port newest version?

I'm asking cos we'd like to hit some other projects (commercial and non- commercial == open-source), so we would like to know to plan our resources.

thanks + regards

mel

Original Posted Date: 2012-08-27T00:22:56.327-07:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi mel,

If you like, your team can attempt to port 7.5. But there are too many significant changes between 6.1.1 and 7.5, I am not sure whether there is still possibly to port most of the bits.

Regards,

Lex

Original Posted Date: 2012-08-27T02:02:28.753-07:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi Lex

OK. We'll start porting 7.5. I believe it should not take more than a month.
Rough plan we (I)'ll:

Is this OK?

BTW I was querying Transmitter through SNMP from my iPad, iPhone and Samsung Galaxy S II whole night. Each device
more than 300k+ queries and no errors.

regards

mel

Original Posted Date: 2012-08-30T00:48:15.11-07:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi mel,

Just curious about how do you attempt to start porting 7.5?

Ideally I suggest you fork from http://github.com/lextm/sharpsnmplib and then start changing the structure of the code base and make it mobile friendly as you stated. In that way, I can easily accept your changes back to the main repository.

If it is impossible to fork from the main repository for this port, please let me know. I might review your changes and re-apply them to the main repository.

Regards,

Lex

Original Posted Date: 2012-08-31T05:56:47.733-07:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi lextm

Sorry for not answering, but had several projects that we had to finish and was thinking about the best way how to proceed and to be least intrusive.

Basically we have 2 options

  1. portable libs
    We have worked a bit with those, so not too much experience! And - our experience showed us 2nd approach better
    (We are currently porting 2 apps from CF/SmartDevice => MonoTouch (and this is basically MA)

  2. source code reusing through linking (add links to files)

    1. team has several solutions (sets of x-platform projects) on github that help us porting (and few more to come)
    2. it is easier to add diffs (platform specific stuff) to [partial] classes in different projects

So I forked sharpsnmplib and my suggestion is

So If You want me to start #1 and You can agree/disagree. I'll need couple of days!

Later on we can restructure projects into "Solution Folders" in VS and physical folders if necessary to maintain order

Oh yes - all projects will be MonoDevelop (mono) friendly from the begining!

regards

mel

Original Posted Date: 2012-09-06T03:18:23.827-07:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi mel,

It is really hard for me to comment further on which approach to go.

I will try my best to finish reviewing your previous port at https://github.com/moljac/MonoMobile.SharpSNMP to see if I can identify something "not easy to understand". Before I finish I think we might be caution and slow down the process.

Regards,

Lex

Original Posted Date: 2012-09-15T06:05:42.387-07:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi mel,

I started to test out Mono for Android and I finished the initial work today,

http://www.lextm.com/2012/10/tritonmate-words-official-port-to-mono.html

I still prefer the CF port approach I used, to create .ma.sln/.ma.csproj files in the same folder. There seems to be less API breaking in Mono for Android profile, so I did not see any need right now to use partial classes.

I will also test out Windows Phone 7.1, but it is not promising yet. I don't have a Mac yet, but plan to get one in the coming months so as to test out MonoTouch.

Regards,

Lex

Original Posted Date: 2012-10-14T05:55:43.493-07:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi Lex

Sorry for delay, but my PoC got cancelled because of some political reasons for IBC beginning of Sept, so I had to reorganize
and rethink how to proceed further.

So:

Our app runs perfectly on 6.1.1 and I hoped I would persuade our managers to allow me to port to 7.5. They said No - for time being.
So I have started to prepare lof4net and others for porting.

Regarding making csproj files in the sam dir or not... If this is policy... OK

CF is generally subset of MonoMobile (MA and MT) so You can add it in the same folder. There sholud not be a lot differences. I have
split those mostly for WP, but w/o UDP this is doomed. I have not too much info about WP8...

I had pretty rough weekend chasing some stuff in iOS (MT), so I'll get back in few days

regards

mel

Original Posted Date: 2012-10-14T14:51:44.16-07:00

lextudio-support commented 2 hours ago

Marked as Answer Date: 2013-10-06T04:10:55.927-07:00