I'm using Xamarin's cross-platform framework-xamarin.android memoirs

Source: Internet
Author: User

First, the Origin

In their own to other companies to do part-time outsourcing, has clearly known that the outsourcing of the job is not so good to dry, generally experienced the initial passion after the enthusiasm, gradually cold, anger, and then cold, and then angry ..., it sounds like a climax, but it's embarrassing that we don't want this climax, so we finally want to end it hastily. Leave. But when we commissioned the Android mobile app to develop a third party, we didn't expect the product to be so rough, and when we couldn't determine when the product was going to meet the audience, we ended the relationship decisively.

So the next option is limited, the initial use of high praise such as the tide of PhoneGap development, the interface of the smooth speed, especially in order to decline the speed of the most unacceptable, like to marry the bride, too late not to say, you pull her forward, she has to pause in situ, and then go a little, very reluctant, Since you can not be in the situation I wish to live together, I can only turn around to leave her more and more blurred back ...

Finally, the last resort, chose me to the present is more satisfactory, relatively strong xamarin.android. It is important to emphasize that the volume of applications developed using xamarin.android is actually much larger than the Java development, the basic algorithm is: 2.9M of the necessary package +2.8m Processor Compatibility Pack (if you do not plan to be compatible with the X86 architecture of the mobile processor, then do not use this package) =5.7m , say your application has just started to have 5.7M of body size, but I observed a lot of popular regular applications (not games, game packs are generally very large), have been 10 m, 20 m, more than 30 m, so the current volume for me, not too much of a problem.

Second, the current

We are developing a kindergarten mobile product, this is our current product structure, I use the Xamarin.studio (XS), of course, can also use VS2012 and the like

Let's look at the concrete structure of the front-end presentation layer

The next one is the public library, which is the PCL library

About the PCL library, say a little more, the PCL library is also divided into multiple versions, each version of the target is different, for example, I use the PCL-78 is the following appearance

I suggest using this latest version, some mature libraries, such as Newtonsoft.json, and the. NET PCL version of SQLite, are all available. PCL Class Library sounds beautiful, of course, but also some attention issues, such as WebRequest, different platforms support WebRequest is not the same, some attribute usage is not the same, such as AddRange, the importance of adding a range header is self-evident, The WP8 platform is so used:

protected OverrideSystem.Net.HttpWebRequest beginrequest () {HttpWebRequest request=(HttpWebRequest) webrequest.create (URL); Request. Allowreadstreambuffering=false; Request. AllowWriteStreamBuffering=false; if( This. existsfilelength >0) Request. headers["Range"] =string. Format ("bytes={0}-", This. Existsfilelength); Request. Method="GET"; returnrequest; }

And in Xamarin.android, this is the case:

protected OverrideSystem.Net.HttpWebRequest beginrequest () {HttpWebRequest request=(HttpWebRequest) webrequest.create (uristring); Request. Allowreadstreambuffering=false; Request. AllowWriteStreamBuffering=false; if( This. existsfilelength >0) Request. AddRange ( This. Existsfilelength); Request. Method="GET"; returnrequest; }

Write here today, and then slowly introduce the whole development process and precautions.

Three, injection

I think every developer should be aware that if you want to develop a complete product, it will require a lot of mental and energy, if you want to do it overnight, it seems unlikely. Friends who want to develop on the Xamarin platform, it is necessary to know a little English, because it is possible to go to bing.com to search for foreign materials, I believe most of the friends have no problem.

Endure irritability is also necessary to have, for a new thing, some time may be checked for a half-day is not resolved, may get angry, suppress their anger or in the no-no-no-no-no-fire vent, and clearly tell themselves, solved a small problem, it is a step away from success.

If you really want to develop a product, it must be practical, always read the article, do not hand is not good, perhaps there are top smart people (I also believe that there is) can be a photographic memory or can see a few times will, but if you assess yourself, get the conclusion is not the top smart, or need to do.

Four, no picture you say a JB

In view of the article, often see someone say "no picture you say a JB", I still want to paste on our product Mobile side diagram, is the Android version.

Five, the source?

The source code is certainly not, because this is a commercial product, is not suitable for the source code. But I later in the article the key of some source code will be given, easy to understand.

VI. REAL PRODUCTS

If you want to experience the product, you can use the mobile phone to access m.kankanbaobei.com download Android version of the app

Experience Account:

Teacher: 16856785678 Password: 123456

Parents: 19856785678 Password: 123456

Complete.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.