Friday, December 02, 2011

Mobile Application Architecture, Part 1

The boom in mobile applications has been fueled by excellent application frameworks from Apple and Google. Cocoa Touch and Android take some very different approaches on many things, but both enable developers to create applications that end users enjoy. Of course "excellent" can be a relative term, and in this case the main comparison is web application development. For both experienced and novice developers, it takes less effort to be more productive developing a native mobile application than a web application (mobile or not.) This despite the fact that you really have to deal with a lot more complexity in a mobile app (memory, threads, etc.) than you do for web applications.

Despite having significant advantages over web development, mobile applications often have some similar qualities and this often leads to similar limitations. Most mobile applications are network based. They use the network to get information and allow you to interact with other users. Before mobile applications, this was the realm of web applications. Mobile apps have shown that there is not necessary to use a browser to host an application that is network based. That's good. However the way that mobile apps interact with servers over the network has tended to resemble the way that web applications do this. Here's a picture that shows this.
Traditional mobile app architecture
This diagram shows a traditional mobile application's architecture. In particular it shows an Android app, hence that little red box on the right saying C2DM, which we will talk more about later. Most of this is applicable to iOS as well though. Most apps get data from servers or send data to servers using HTTP, the same protocol used by web browsers. HTTP is wonderfully simple in most ways. Significantly, it is a short-lived, synchronous communication. You make a request and you wait until you get a response. You then use the response to update the state of your application, show things to the user, etc.

Now since HTTP is synchronous and network access is notoriously slow (especially for mobile apps), you must inevitably banish HTTP communication to a different thread than the one where you respond to user interactions. This simple paradigm becomes the basis for how many mobile applications are built. Android provides some nice utilities for handling this scenario like AsyncTask and Loaders. Folks from the Android team have written numerous blogs and presentations on the best way to setup an application that follows this pattern, precisely because this pattern is so prevalent in mobile applications. It is the natural first step from web application to mobile application as you can often re-use much of the backend systems that you used for web applications.

Before we go any further, take another look at the diagram. I promised to talk more about it. That is the cloud-to-device messaging system that is part of Android (or at least Google's version, it's not available on the Kindle Fire for example.) It provides a way for data to get to the application without the usual HTTP. Your server can send a message to C2DM servers, which will then "push" the message to the device and your app. This is done through a persistent TCP socket between the device and the C2DM servers. Now these messages are typically very small, so often it is up to your application to retrieve additional data -- which could very well go back to using HTTP. Background services on Android can makes this very simple to do.

Notice that in the previous paragraph we never once used the word "notification." C2DM was seen by many as Android's equivalent to Apple's Push Notifications. They can definitely fulfill the same use cases. Once your service receives the message it can then choose to raise a notification on the device for the user to respond to. But C2DM is not limited to notifications, bot by a long shot. Publishing a notification is just one of many things that your application can do with the message that it receives from C2DM. What is most interesting about C2DM is that leads us into another type of application architecture not built around HTTP. In part 2 of this post we will take a deeper look at event-driven architectures.

31 comments:

Mikey said...

waiting for the 2nd one hehehe

tomcruse said...

excellent blog! thanks for sharing your experience of mobile applications....
Download Mobile Software

Unknown said...

It is for the first time, I have visited the blog and it is good to have a useful post regarding mobile application architecture. The company I am working with is named as Kualitatem also offers mobile application development as well mobile app testing all around the globe.

Mobile app Development said...

Perfect work you have done, this blog is really cool with fantastic information.

Unknown said...

Nice pair of bonding...!
http://www.mobilyala.com/

Unknown said...

We are a third party technical support service. Avast Customer Support is here to help you out with the whole procedure to Download Avast Antivirus online, We not only fix your Avast Support related issues but will guide with how to get started with your new Avast product once it gets installed successfully.We at Avast Tech Support provides service to protect your PC from potential online threats and external attacks like viruses, Trojans, malwares, spywares and phishing scams. And Avast Refund. Call on our Avast Phone Number.

Gmail Customer service is a third party technical support service for Gmail users when they face any technical issue or error in their Gmail account. Our Gmail Customer Support team solves issues like forgot Gmail account password, Gmail configuration or Sync issues, recover deleted emails and many more. Toll Free number (800) 986-9271
How you install or reinstall Office 365 or Office 2016 depends on whether your Office product is part of an Office for home or Office for business plan. If you're not sure what you have, see what office com setup products are included in each plan and then follow the steps for your product. The steps below also apply if you're installing a single, stand-alone Office application such as Access 2016 or Visio 2016. Need Help with office setup Enter Product Key? Call 1-800-000-0000 Toll Free
Norton Tech Support is a third party service provider and not in any way associated with Norton or any of its partner companies. We offer support for Norton products and sell subscription based additional warranty on computer and other peripheral devices. Call our Toll Free number 1 855 966 3855
Other Services
Norton Toll Free , Office-Setup , office.com/setup.

hellanadam said...

Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well as giving..
ios App Development Company
Mobile App Development Company
Best Mobile App Development Company

Unknown said...

OfficeSetupOffice is an independent provider of remote tech support services for software, hardware, and peripherals.And we provide support for Microsoft office setups & Installation related services.
For Technical Support:Microsoft Office Setups
Or Call Toll free Now : +1-844-777-7886

Unknown said...

NortonComSetup is an Independent technical support service provider for a large variety of THIRD PARTY PRODUCTS, brands and services. If the product is under warranty, the repair or replacement service may be avaliable free from the Brand or vendor.read more:Norton Setup

Do Not Disturb App said...

Do not Disturb
Welcome, Do Not Disturb!
The use of Smartphone has made it easy for a lot of users to stay connected, but it can be a serious risk when you use your Smartphone when you are driving.

Research shows that the use of cell phone while driving leads to 1.6 million crashes each year, out of which 330,000 injuries occur from accidents caused by texting while driving.

Unknown said...

it is a beautiful post, and I want to say thank you so much for sharing this information.
digital marketing services in india

MindtechAffiliates said...


Great. It is good to constantly coming up with creative ideas. Provides much needed knowledge. goal oriented blog posts and always tried to find creative ways to meet goals.

Thanks
Online affiliates

DedicatedHosting4u said...

Nice post I really like these types of articles where you can get a lot of data with few examples to continue writing like that and many people choose your content.

DedicatedHosting4u.com

Glen Maxy said...

Civil Law Assignment Help relates to a lot of guidelines that are applied to criminal offenses. For situations where an element won't adjust to a specific criminal rule, by disregarding the law, the person is carrying out a criminal demonstration.

unknow said...

Does your HP printer not follow your printing instruction within defined time limit? Well, you do not embarrass to achieve the standard class result. Making various efforts do not guarantee to a normal person that they can ease out the available difficulties in this. Why do you worry as HP Printer Support team is available for you? So, it would be better that you can raise a query to our independent third party professional team. We are in this business for long time and provide as much as help as we can.
Also connect: HP Printer Support
Thank You.

harryparker0123 said...

There can be a lot of reasons that cause error 3371 status code 11118 in QuickBooks. If you need an immediate solution at your door-step, then our experts can help you out. We have been resolving this problem for our clients for quite some time. Do you know what causes error 3371! It happens due to corrupted QBregistration.dat files, damaged MSXML components, and virus or malware intrusion. How do we deal with it! That’s pretty simple. We just make sure that your Windows is running with the latest version, rename the entitlement data file, install the QuickBooks tool hub to fix the problem and in the end manually resolve the error code 3371 by fixing the Microsoft.net framework, MSXML components. Connect with us for more advanced troubleshooting tips.

Do Assignment Help said...

Superb blog and really great topic you choose. Helping students in writing an assignment is a good idea. We also offer cheap assignment help to students who are working part time and could not complete their assignment on time. We assign the subject specialist to each student who will write the assignment content and deliver it before the deadline arrives. Rest assured the content is always unique and plagiarism free. The process to raise a request is simple. Visit the website and drop the query and our team will connect with you. We provide the best services in the market at affordable rates. So, every student can get our Assignment writing services online.

Glane Gill said...

Roadrunner email login may be your task to obtain access to this webmail supplied by & for its users. Roadrunner email is among the most significant online customer base in the United States of America. Roadrunner mail provides its email services in a user-friendly interface, and an individual may receive the most useful features in their email address.
But if somebody is confronting the Roadrunner email problems, can phone us to get assistance on your roadrunner email settings setup and troubleshooting.
http://www.email-customer-care.com/roadrunner-support

redgun said...

Not sure where to start and how to write an essay? Do you have many questions about writing? You should take advantage of this https://essaysprofessors.com and pass your work perfectly without any problems!

Quicken Error Support | Quicken Customer Service said...

If you want to receive Capital One 360 Quicken access code. Now, you are wondering how to do it? You need to know that the code is provided so that no one can access your password. It helps you to protect your account information. You can obtain the access code in the following manner. Initially, you have to log in to the Capital One website and click over ‘My Info’. Then, opt for the ‘Access Code’ option to create your code. If this doesn’t help you to get the code, you can contact us and we may assist you.

Gena Sanford said...

Bookkeeping Services in New York
Bookkeeping Services in Atlanta
Bookkeeping Services in Nashville

Ian Bell said...

Global Polyglycitol Market size is set to witness an exponential growth in the forecast years owing to its wide use as a bulking agent in sugar-free, dried, and frozen foods. The product is also known as hydrogenated starch hydrolysate and is found in the form of viscous, transparent, odorless, and colorless liquid or in white crystalline lumps.

Sneha Kaur said...

Hello gentlemen, the name is Sneha and I am a genuine 23-year-old independent call girl. I am willing to do everything with great affection and offer you for our delicious sex encounter.
Relationship
Call girls
Call girl
Female
Call girls for party
Hotel call girls
Model
Incall girls
Outcall girls
Escort service
Female call girls service
Erotic massage
Call girls number
Call girl number
Call girls WhatsApp
Call girl WhatsApp

Recent Trend of Market said...

Nice information.

Global mobile banking market will reach $4,680.3 million by 2030.

Unknown said...

Very helpful Admission Essay Help Edmonton

zarkazijar said...

This is an amazing read, it shows that you actually know what you are talking about, thanks a lot for sharing the elucidated contents. admiralty university departmental cut off mark

Amy Charlotte said...

Perfectly put together work for mobile app development architecture! Check out Pyramidion’s mobile app development services to offer businesses unique and feature-rich mobile architectures and solutions!

Nick Jones said...

Very nice!!! This is really good blog information thanks for sharing.

If you getting issues with your mac computer for quicken do not worry call Quicken Assistant Help for Mac at +1 800-213-6058 USA/Canada


Quicken Remote Support for Mac
Quicken for Mac User Guide
Quicken Assistantance Help for Mac +1-800-213-6058
Quicken Assistant Help

Scott Andery said...

Great stuff, read more about mobile app testing companies

Ray Parker said...

Great information you have shared about Mobile Application Architecture, thanks for sharing this type of information, please keep continue to sharing this great content. Also, please read more about the top mobile application testing companies here...

Chris said...

Find QuickBooks Online Accountant and choose ProAdvisor Training... live trainings led by Advanced Quickbooks Certified ProAdvisors. Quickbooks Certified Proadvisor