11.07.2015 Views

A first look at Google Android

A first look at Google Android

A first look at Google Android

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A <strong>first</strong> <strong>look</strong> <strong>at</strong><strong>Google</strong> <strong>Android</strong>Tomas K<strong>at</strong>ysovastk<strong>at</strong>ysovas@unibz.itFree University of Bolzano, Internet Technologies 2. 2007-2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>AbstractThis paper examines an open source mobile phone pl<strong>at</strong>form <strong>Android</strong>. It explains its’advantages and disadvantages, the basic fe<strong>at</strong>ures and the market str<strong>at</strong>egy. I review theadapt<strong>at</strong>ion of this new technology from the view of prospective mobile softwaredevelopers, customers and manufacturers.The purpose of this report is to present to the user the new and promising mobile pl<strong>at</strong>formbased on the Linux oper<strong>at</strong>ing system and provided by <strong>Google</strong>. Additionally, I introduceOpen Source infrastructure which not only supports development, but also has thepotential to become a main business activity in the future.Tomas K<strong>at</strong>ysovas Page 2 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>ContentsAbstract ............................................................................................................................... 2Introduction ......................................................................................................................... 4The Birth of <strong>Android</strong> ...................................................................................................... 4<strong>Android</strong> Fe<strong>at</strong>ures ............................................................................................................. 5System Architecture ............................................................................................................ 6Developing Applic<strong>at</strong>ions .................................................................................................... 8Applic<strong>at</strong>ion Building Blocks........................................................................................... 8Code example................................................................................................................ 10Applic<strong>at</strong>ion Lifecycle.................................................................................................... 14Security Issues .............................................................................................................. 18<strong>Android</strong> and Java ME ....................................................................................................... 19Similarities .................................................................................................................... 19“Hello World” example ................................................................................................ 20Market Research ............................................................................................................... 22A prospective customer................................................................................................. 22Specul<strong>at</strong>ions with cellular carriers ................................................................................ 23Manufacturers’ war ....................................................................................................... 24Mobile Future.................................................................................................................... 25Mobile Ads.................................................................................................................... 25Mobile Services ............................................................................................................ 26Conclusion ........................................................................................................................ 27References ......................................................................................................................... 28Tomas K<strong>at</strong>ysovas Page 3 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>IntroductionThe Birth of <strong>Android</strong>Firstly, I would like to mention a small company <strong>Android</strong> Inc. based on the softwaredevelopment for mobile phones, which was acquired by <strong>Google</strong> for unknown amount ofmoney on July 2005. As the experienced team started to work hardly in <strong>Google</strong> Campus,it was a <strong>first</strong> serious sign about <strong>Google</strong> entering mobile phone market. In 2007, the OpenHandset Alliance (OHA) was cre<strong>at</strong>ed to develop open standards for mobile devices. Itconsisted of 34 grand members, such as <strong>Google</strong> itself, NVIDIA, Intel, Motorola, T-Mobile and other mobile oper<strong>at</strong>ors, handset manufacturers, software and othercompanies. As OHA stands for open mobile pl<strong>at</strong>form, a gre<strong>at</strong> race has started betweenOHA and main competitors Apple, Microsoft, Symbian and others. Microsoft launchedWindows Mobile 6.0 version with full upd<strong>at</strong>ed Office Mobile and other fe<strong>at</strong>ures.Symbian with over 110 million smartphones released OSv.9.5, and Apple stroked marketwith iPhone. The entire world was waiting for the response from <strong>Google</strong> with visionaryGphone, a single mobile device which could compete with iPhone and other mobilephones. OHA came with better solution – <strong>Google</strong> <strong>Android</strong> – <strong>first</strong> truly open mobilephone pl<strong>at</strong>form based on Linux, with clear and simple user interface and applic<strong>at</strong>ions,cre<strong>at</strong>ed in Java. This str<strong>at</strong>egy, which is about to declare not a single Gphone, but to put<strong>Android</strong> into existing and new mobiles devices and to make thousands of Gphones, givesmobile oper<strong>at</strong>ors and device manufacturers significant freedom and flexibility to designproducts. As <strong>Google</strong> <strong>Android</strong> will be truly released in 2008 with its source code, <strong>at</strong> thismoment <strong>Google</strong> announced <strong>Android</strong> SDK together with competition, which provides 10million dollars in awards for <strong>Android</strong> developers. This idea seems to be quit clear andlogical, in order to speed up and boost Java developers, but actually the contest sloweddown the knowledge integr<strong>at</strong>ion. The contest has effectively caused developers not toshare their code to others. Therefore, I found a lack of answering to questions and othersupport on <strong>Android</strong> groups over the internet. Nevertheless, I believe there will be plentyof code available to help inexperienced developers make ideas come to life.Tomas K<strong>at</strong>ysovas Page 4 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong><strong>Android</strong> Fe<strong>at</strong>uresApplic<strong>at</strong>ion Framework is used to write applic<strong>at</strong>ions for <strong>Android</strong>. Unlike other embeddedmobile environments, <strong>Android</strong> applic<strong>at</strong>ions are all equal, for instance, an applic<strong>at</strong>ionswhich come with the phone are no different than those th<strong>at</strong> any developer writes. Theframework is supported by numerous open source libraries such as openssl, sqlite andlibc. It is also supported by the <strong>Android</strong> core libraries. From the point of security, theframework is based on UNIX file system permissions th<strong>at</strong> assure applic<strong>at</strong>ions have onlythose abilities th<strong>at</strong> mobile phone owner gave them <strong>at</strong> install time.Dalvik virtual machine – it is extremely low-memory based virtual machine, which wasdesigned specially for <strong>Android</strong> to run on embedded systems and work well in low powersitu<strong>at</strong>ions. It is also tuned to the CPU <strong>at</strong>tributes. The Dalvik VM cre<strong>at</strong>es a special fileform<strong>at</strong> (.DEX) th<strong>at</strong> is cre<strong>at</strong>ed through build time post processing. Conversion betweenJava classes and .DEX form<strong>at</strong> is done by included “dx” tool.Integr<strong>at</strong>ed browser – in my opinion, <strong>Google</strong> made a right choice on choosing WebKit asopen source web browser. They added a two pass layout and frame fl<strong>at</strong>tening. Two passlayout loads a page without waiting for blocking elements, such as external CSS orexternal JavaScript and after a while renders again with all resources downloaded to thedevice. Frame fl<strong>at</strong>tening converts founded frames into single one and loads into thebrowser. These fe<strong>at</strong>ures increase speed and usability browsing the internet via mobilephone.Optimized graphics – as <strong>Android</strong> has 2D graphics library and 3D graphics based onOpenGL ES 1.0, possibly we will see gre<strong>at</strong> applic<strong>at</strong>ions like <strong>Google</strong> Earth andspectacular games like Second Life, which come on Linux version. At this moment, theshooting legendary 3D game Doom was presented using <strong>Android</strong> on the mobile phone.SQLite – extremely small (~500kb) rel<strong>at</strong>ional d<strong>at</strong>abase management system, which isintegr<strong>at</strong>ed in <strong>Android</strong>. It is based on function calls and single file, where all definitions,tables and d<strong>at</strong>a are stored. This simple design is more than suitable for a pl<strong>at</strong>form such as<strong>Android</strong>.There are a number of hardware dependent fe<strong>at</strong>ures, for instance, a huge media andconnections support, GPS, improved support for Camera and simply GSM telephony. Agre<strong>at</strong> work was done for the developers to start work with <strong>Android</strong> using deviceemul<strong>at</strong>or, tools for debugging and plugin for Eclipse IDE. Finally, as <strong>Android</strong> juststarted its’ journey to the mobile market, we are going to see much more fe<strong>at</strong>ures throughthe developed applic<strong>at</strong>ions.Tomas K<strong>at</strong>ysovas Page 5 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>System Architecturegoogle<strong>Android</strong> Architecture is based on Linux 2.6 kernel. It helps to manage security, memorymanagement, process management, network stack and other important issues. Therefore,the user should bring Linux in his mobile device as the main oper<strong>at</strong>ing system and installall the drivers required in order to run it. <strong>Android</strong> provides the support for the QualcommMSM7K chipset family. For instance, the current kernel tree supports Qualcomm MSM7200A chipsets, but in the second half of 2008 we should see mobile devices with stableversion Qualcomm MSM 7200, which includes major fe<strong>at</strong>ures:- WCDMA/HSUPA and EGPRS network support- Bluetooth 1.2 and Wi-Fi support- Digital audio support for mp3 and other form<strong>at</strong>s- Support for Linux and other third-party oper<strong>at</strong>ing systems- Java hardware acceler<strong>at</strong>ion and support for Java applic<strong>at</strong>ions- Qcamera up to 6.0 megapixels- gpsOne – solution for GPS- and lots of other.Tomas K<strong>at</strong>ysovas Page 6 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>In the next level we can see a set of n<strong>at</strong>ive libraries written in C/C++, which areresponsible for stable performance of various components. For example, SurfaceManager is responsible for composing different drawing surfaces on the mobile screen. Itmanages the access for different processes to compose 2D and 3D graphic layers.OpenGL ES and SGL make a core of graphic libraries and are used accordingly for 3Dand 2D hardware acceler<strong>at</strong>ion. Moreover, it is possible to use 2D and 3D graphics in thesame applic<strong>at</strong>ion in <strong>Android</strong>. The media framework was provided by PacketVideo, one ofthe members of OHA. It gives libraries for a playback and recording support for all themajor media and st<strong>at</strong>ic image files. FreeType libraries are used to render all the bitmapand vector fonts. For d<strong>at</strong>a storage, <strong>Android</strong> uses SQLite. As I mentioned before, it isextra light r<strong>at</strong>ional management system, which loc<strong>at</strong>es a single file for all oper<strong>at</strong>ionsrel<strong>at</strong>ed to d<strong>at</strong>abase. WebKit, the same browser used by Apples’ Safari, was modified by<strong>Android</strong> in order to fit better in a small size screens.At the same level there is <strong>Android</strong> Runtime, where the main component Dalvik VirtualMachine is loc<strong>at</strong>ed. It was designed specifically for <strong>Android</strong> running in limitedenvironment, where the limited b<strong>at</strong>tery, CPU, memory and d<strong>at</strong>a storage are the mainissues. <strong>Android</strong> gives an integr<strong>at</strong>ed tool “dx”, which converts gener<strong>at</strong>ed byte code from.jar to .dex file, after this byte code becomes much more efficient to run on the smallprocessors. As the result, it is possible to have multiple instances of Dalvik virtualmachine running on the single device <strong>at</strong> the same time.The Core libraries are written in Java language and contains of the collection classes, theutilities, IO and other tools.After th<strong>at</strong>, we have Applic<strong>at</strong>ion Framework, written in Java language. It is a toolkit th<strong>at</strong>all applic<strong>at</strong>ions use, ones which come with mobile device like Contacts or SMS box, orapplic<strong>at</strong>ions written by <strong>Google</strong> and any <strong>Android</strong> developer. It has several componentswhich I will discuss. The Activity Manager manages the life circle of the applic<strong>at</strong>ions andprovides a common navig<strong>at</strong>ion backstack for applic<strong>at</strong>ions, which are running in differentprocesses. The Package Manager keeps track of the applic<strong>at</strong>ions, which are installed inthe device. The Windows Manager is Java programming language abstraction on the topof lower level services th<strong>at</strong> are provided by the Surface Manager. The TelephonyManager contains of a set of API necessary for calling applic<strong>at</strong>ions. Content Providerswas built for <strong>Android</strong> to share a d<strong>at</strong>a with other applic<strong>at</strong>ions, for instance, the contacts ofpeople in the address book can be used in other applic<strong>at</strong>ions too. The Resource Manageris used to store localized strings, bitmaps, layout file descriptions and other external partsof the applic<strong>at</strong>ion. The View System gener<strong>at</strong>es a set of buttons and lists used in UI. Othercomponents like Notific<strong>at</strong>ion manager is used to customize display alerts and otherfunctions.At the top of <strong>Android</strong> Architecture we have all the applic<strong>at</strong>ions, which are used by thefinal user. By installing different applic<strong>at</strong>ions, the user can turn his mobile phone into theunique, optimized and smart mobile phone.Tomas K<strong>at</strong>ysovas Page 7 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>Developing Applic<strong>at</strong>ionsApplic<strong>at</strong>ion Building Blocks<strong>Google</strong> provides three versions of SDK: for Windows, for Mac OSX and one for Linux.The developer can use <strong>Android</strong> plugin for Eclipse IDE or other IDEs such as intelliJ.First step for <strong>Android</strong> developer is to decompose the prospective applic<strong>at</strong>ion into thecomponents, which are supported by the pl<strong>at</strong>form. The major building blocks are these:- Activity- Intent Receiver- Service- Content ProviderActivity – user interface component, which corresponds to one screen <strong>at</strong> time. It meansth<strong>at</strong> for the simple applic<strong>at</strong>ion like Address Book, the developer should have one activityfor displaying contacts, another activity component for displaying more detailedinform<strong>at</strong>ion of chosen name and etc.Intent Receiver – wakes up a predefined action through the external event. For example,for the applic<strong>at</strong>ion like Email Inbox, the developer should have intent receiver andregister his code through XML to wake up an alarm notific<strong>at</strong>ion, when the user receivesemail.Service – a task, which is done in the background. It means th<strong>at</strong> the user can start anapplic<strong>at</strong>ion from the activity window and keep the service work, while browsing otherapplic<strong>at</strong>ions. For instance, he can browse <strong>Google</strong> Maps applic<strong>at</strong>ion while holding a callor listening music while browsing other applic<strong>at</strong>ions.Content Provider – a component, which allows sharing some of the d<strong>at</strong>a with otherprocesses and applic<strong>at</strong>ions. It is the best way to communic<strong>at</strong>e the applic<strong>at</strong>ions betweeneach other.Secondly, a developer should predefine and list all components, which he wants to use inthe specific <strong>Android</strong>Manifest.xml file. It is a required file for all the applic<strong>at</strong>ions and isloc<strong>at</strong>ed in the root folder. It is possible to specify all global values for the package, all thecomponents and its classes used, intent filters, which describe where and when the certainactivity should start, permissions and instrument<strong>at</strong>ion like security control and testing.Here is an example of <strong>Android</strong>Manifest.xml file:1. 2. 4. Tomas K<strong>at</strong>ysovas Page 8 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>5. 6. 7. 8. 9. 10. 11. 12. The line 2 is a namespace declar<strong>at</strong>ion, which makes a standard <strong>Android</strong> <strong>at</strong>tributesavailable for th<strong>at</strong> applic<strong>at</strong>ion. In the line 4 there is a single element, wherethe developer specifies all applic<strong>at</strong>ion level components and its properties used by thepackage. Activity class in the line 5 represents the initial screen the user sees and it mayhave one or more elements to describe the actions th<strong>at</strong> activity supports.There is the activityCre<strong>at</strong>or script, which gener<strong>at</strong>es the following files and folders in yourEclipse workplace:- <strong>Android</strong>Manifest.xml file discussed before;- Build.xml – an ant file which is used to package an applic<strong>at</strong>ion;- src/ - source directory- bin/ - the output directoryThe special file R.java is gener<strong>at</strong>ed by Eclipse in the source code folder. It is an indexinto all the resources defined in the file and is useful for loc<strong>at</strong>ing the specific reference.<strong>Android</strong> lets developers to use debugging and testing tools like DDMS (Dalvik DebugMonitor Server), logc<strong>at</strong> and others.Tomas K<strong>at</strong>ysovas Page 9 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>Code exampleIt is possible to send XMPP messages in <strong>Android</strong>. XMPP – open Extensible Messagingand Presence Protocol for near-real-time instant messaging (IM) and presenceinform<strong>at</strong>ion. As <strong>Google</strong> Talk provides XMPP g<strong>at</strong>eways to its service, some modific<strong>at</strong>ionsof Gtalk are already cre<strong>at</strong>ed for <strong>Android</strong> pl<strong>at</strong>form. Here is a source code of unofficialGtalk applic<strong>at</strong>ion, written by Davanum Srinivas (http://davanum.wordpress.com):GTalkClient.java// <strong>first</strong>ly, all imported packages are listed <strong>at</strong> the beginning of the codepackage org.apache.gtalk;import android.app.Activity; //Activity class takes care of cre<strong>at</strong>ing a window for UIimport android.app.Notific<strong>at</strong>ionManager; //Class for event notific<strong>at</strong>ionsimport android.content.ComponentName; //Identifier for one of applic<strong>at</strong>ion componentimport android.content.Context;//Abstract class for global inform<strong>at</strong>ion about//an applic<strong>at</strong>ion environmentimport android.content.Intent; //Abstract description of an oper<strong>at</strong>ion to be performedimport android.content.ServiceConnection; //Interface for monitoring the st<strong>at</strong>e of an//applic<strong>at</strong>ion serviceimport android.d<strong>at</strong>abase.Cursor; //Interface for providing random read-write access to//the result set returned by a d<strong>at</strong>abase queryimport android.os.Bundle; //Mapping from String values to various typesimport android.os.DeadObjectException; //Exception for an object, which does not existsimport android.os.IBinder; //Interface for a remotable Binder objectimport android.provider.Im;import android.text.TextUtils; //Monitor or modify keypad inputimport android.util.Log;//API for sending log outputimport android.view.View; //Used to cre<strong>at</strong>e interactive graphical user interfacesimport android.widget.*;//Visual UI elementsimport com.google.android.xmppService.IXmppService; //IXmppService interface//definition file for XMPP serviceimport com.google.android.xmppService.IXmppSession; //IXmppSession interface//definition file for XMPP sessionimport com.google.android.xmppService.Presence; //Abstract present<strong>at</strong>ion of the user’s//presence inform<strong>at</strong>ionpublic class GTalkClient extends Activity implements View.OnClickListener {priv<strong>at</strong>e st<strong>at</strong>ic final String LOG_TAG = "GTalkClient";IXmppSession mXmppSession = null;EditText mSendText;ListView mListMessages;Tomas K<strong>at</strong>ysovas Page 10 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>EditText mRecipient;Button mSend;Button mSetup;// Called with the activity is <strong>first</strong> cre<strong>at</strong>ed.@Overridepublic void onCre<strong>at</strong>e(Bundle icicle) {super.onCre<strong>at</strong>e(icicle);setContentView(R.layout.main);// g<strong>at</strong>her the troopsmSendText = (EditText) findViewById(R.id.sendText);mListMessages = (ListView) findViewById(R.id.listMessages);mRecipient = (EditText) findViewById(R.id.recipient);mSend = (Button) findViewById(R.id.send);mSetup = (Button) findViewById(R.id.setup);// set up handler for on clickmSetup.setOnClickListener(this);mSend.setOnClickListener(this);bindService((new Intent()).setComponent(com.google.android.xmppService.XmppConstants.XMPP_SERVICE_COMPONENT),null, mConnection, 0);}// Let the user know there was an issuepriv<strong>at</strong>e void logMessage(CharSequence msg) {Notific<strong>at</strong>ionManager nm = (Notific<strong>at</strong>ionManager) getSystemService(Context.NOTIFICATION_SERVICE);}nm.notifyWithText(123, msg, Notific<strong>at</strong>ionManager.LENGTH_LONG, null);// Here’s the code th<strong>at</strong> gets a XMPP session using a service connectionpriv<strong>at</strong>e ServiceConnection mConnection = new ServiceConnection() {public void onServiceConnected(ComponentName className, IBinder service) {// This is called when the connection with the XmppService has been// established, giving us the service object we can use to// interact with the service. We are communic<strong>at</strong>ing with our// service through an IDL interface, so get a client-side// represent<strong>at</strong>ion of th<strong>at</strong> from the raw service object.Tomas K<strong>at</strong>ysovas Page 11 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>IXmppService xmppService = IXmppService.Stub.asInterface(service);try {mXmppSession = xmppService.getDefaultSession();if (mXmppSession == null) {// this should not happen.logMessage(getText(R.string.xmpp_session_not_found));return;}mXmppSession.setPresence(newPresence(Im.PresenceColumns.AVAILABLE, "Am here now!"));} c<strong>at</strong>ch (DeadObjectException ex) {Log.e(LOG_TAG, "caught " + ex);logMessage(getText(R.string.found_stale_xmpp_service));}}mSendText.setEnabled(true);public void onServiceDisconnected(ComponentName componentName) {// This is called when the connection with the service has been// unexpectedly disconnected -- th<strong>at</strong> is, its process crashed.mXmppSession = null;mSendText.setEnabled(false);}};// Handle clicks on the 2 buttionspublic void onClick(View view) {if (view == mSetup) {Log.i(LOG_TAG, "onClick - Setup");// Run a query against CONTENT_URI = "content://im/messages"Cursor cursor = managedQuery(Im.Messages.CONTENT_URI, null,"contact=\'" + mRecipient.getText().toString() + "\'", null, null);// Display the cursor results in a simple list// Note th<strong>at</strong> the adapter is dynamic (picks up new entries autom<strong>at</strong>ically)ListAdapter adapter = new SimpleCursorAdapter(this,android.R.layout.simple_list_item_1,cursor, // Give the cursor to the list adapternew String[]{Im.MessagesColumns.BODY},new int[]{android.R.id.text1});this.mListMessages.setAdapter(adapter);} else if (view == mSend) {Tomas K<strong>at</strong>ysovas Page 12 1/19/2008


A TERMINATION DETECTION PROTOCOL 93Figure 3.Snapshot of the logical activ<strong>at</strong>ion tree.Because responses are passed to robots with lower identifiers and the origin<strong>at</strong>or has thelowest identifier, eventually, the responses reach the robot th<strong>at</strong> origin<strong>at</strong>ed the upd<strong>at</strong>e. Whenthe origin<strong>at</strong>or robot has collected responses concerning all robots involved in the upgrade,termin<strong>at</strong>ion of the <strong>first</strong> diffusing comput<strong>at</strong>ion is detected. The same robot can now issue arequest for the other robots to complete the software upgrade, starting the second diffusingcomput<strong>at</strong>ion. The request tells the other robots to drop PV1.0. Eventually, the origin<strong>at</strong>orrobot should receive confirm<strong>at</strong>ion th<strong>at</strong> these requests were received and processed, and thesecond diffusing comput<strong>at</strong>ion is termin<strong>at</strong>ed.An activ<strong>at</strong>ion tree our algorithm for termin<strong>at</strong>ion detection might produce in completingthe software upd<strong>at</strong>e <strong>at</strong> time t is shown in figure 3. Active nodes representing robots in theactiv<strong>at</strong>ion tree are shaded. Non-shaded nodes represent robots th<strong>at</strong> were once active, but arecurrently idle. While a snapshot of the activ<strong>at</strong>ion tree gives a history of which robots havebeen connected in the past, it does not necessarily reflect the current physical connectivitybetween nodes. To illustr<strong>at</strong>e this point, a corresponding snapshot of a possible ad hocnetwork topology formed between communic<strong>at</strong>ing robots <strong>at</strong> time t is shown in figure 4.Due to the movement of the robots on the factory floor, connections are established anddropped as time elapses. Thus, the network topology may become reconfigured <strong>at</strong> any pointin time.Figure 4.Corresponding snapshot of the physical connectivity.


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>Applic<strong>at</strong>ion LifecycleIn <strong>Android</strong>, every applic<strong>at</strong>ion runs in its own process, which gives better performance insecurity, protected memory and other benefits. Therefore, <strong>Android</strong> is responsible to runand shut down correctly these processes when it is needed.In the following example I will display a process flow from the <strong>Android</strong> System point ofview to get a clear idea how the applic<strong>at</strong>ions behave. Let assume the possible scenario: Auser talks to his friend via mobile phone and he is asked to browse the internet (a talk ishold for a moment), find a picture of him in his Picasa Album, send it via Email back tohis friend and resume a talk.In this situ<strong>at</strong>ion, there are 4 different applic<strong>at</strong>ions and 4 different processes running, butfrom the user point of view none of them are important, as <strong>Android</strong> manages CPU workand memory usage by itself. It means the user can travel through the applic<strong>at</strong>ions forwardand back without thinking about how much memory is left or which processes are run <strong>at</strong>the time.Firstly, as the user is talking to his friend, a specific Talk applic<strong>at</strong>ion is opened, whichcontains the activity manager. In the following stack we can see two processes running,the main system process and Talk applic<strong>at</strong>ion process. Moreover, before going to WebBrowser applic<strong>at</strong>ion, the system saves a Talk st<strong>at</strong>e T in order to remember th<strong>at</strong> process:Tomas K<strong>at</strong>ysovas Page 14 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>At this point, as a user holds a talk and opens a web browser, the system cre<strong>at</strong>es a newprocess and new web browser activity is launched in it. Again, the st<strong>at</strong>e of the lastactivity is saved (W):After th<strong>at</strong>, the user browses the internet, finds his picture in Picasa album and saves it toparticular folder. He does not close a web browser, instead he opens a folder to find savedpicture. The folder activity is launched in particular process:Tomas K<strong>at</strong>ysovas Page 15 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>At this point, the user finds his saved picture in the folder and he cre<strong>at</strong>es a request to openan Email applic<strong>at</strong>ion. The last st<strong>at</strong>e F is saved. Now assume th<strong>at</strong> the mobile phone is outof the memory and there is no room to cre<strong>at</strong>e a new process for Email applic<strong>at</strong>ion.Therefore, <strong>Android</strong> <strong>look</strong>s to kill a process. It can not destroy Folder process, as it wasused previously and could be reused again, so it kills Web Browser process as it is notuseful anymore and loc<strong>at</strong>es a new Email process instead:The user opens Email applic<strong>at</strong>ion and sends a picture to his friend via email. Now hewants to go back to the Talk applic<strong>at</strong>ion and to resume a talk to his friend. Because of thepreviously saved st<strong>at</strong>es, this work is done fast and easily. In this example, Emailapplic<strong>at</strong>ion is popped out and the user sees a previous Folder applic<strong>at</strong>ion:Tomas K<strong>at</strong>ysovas Page 16 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>Next, the user goes back to Web Browser applic<strong>at</strong>ion. Unfortun<strong>at</strong>ely, web browserprocess was killed previously so the system has to kill another process (in our case it isEmail applic<strong>at</strong>ion process, which is not used anymore) in order to loc<strong>at</strong>e Web Browserprocess and manage the stack memory:and finally:Now the user comes back to the Talk applic<strong>at</strong>ion and resumes his talk with his friend.Because of the saved st<strong>at</strong>es, going back procedure is fast and useful, because itremembers previous activities and its views.This example shows, th<strong>at</strong> it does not m<strong>at</strong>ter how many applic<strong>at</strong>ions and processes areactive or how much available memory is left, <strong>Android</strong> it manages fast and without a userinteraction.Tomas K<strong>at</strong>ysovas Page 17 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>Security IssuesIt is quite difficult to discuss all the security issues, as no <strong>Android</strong> phone is build yet. Bythe prediction, <strong>Android</strong> mobile phone pl<strong>at</strong>form is going to be more secure than Apple’siPhone or any other device in the long run. There are several solutions nowadays toprotect <strong>Google</strong> phone from various <strong>at</strong>tacks. One of them is security vendor McAfee, amember of Linux Mobile (LiMo) Found<strong>at</strong>ion. This found<strong>at</strong>ion joins particular companiesto develop an open mobile-device software pl<strong>at</strong>form. Many of the companies listed in theLiMo Found<strong>at</strong>ion have also become members of the Open Handset Alliance (OHA). As aresult, Linux secure coding practice should successfully be built into the <strong>Android</strong>development process. However, open pl<strong>at</strong>form has its own disadvantages, such as sourcecode vulnerability for black-h<strong>at</strong> hackers. In parallel with gre<strong>at</strong> opportunities for mobileapplic<strong>at</strong>ion developers, there is an expect<strong>at</strong>ion for exploit<strong>at</strong>ion and harm. StealthyTrojans hidden in anim<strong>at</strong>ed images, particular viruses passed from friend to friend, usedfor spying and identity theft, all these thre<strong>at</strong>s will be active for a long run.Another solution for such <strong>at</strong>tacks is SMobile Systems mobile package. SecurityShield –an integr<strong>at</strong>ed applic<strong>at</strong>ion th<strong>at</strong> includes anti-virus, anti-spam, firewall and other mobileprotection is up and ready to run on the <strong>Android</strong> oper<strong>at</strong>ing system. Currently, the mainproblem is availability for viruses to pose as an applic<strong>at</strong>ion and do things like dial phonenumbers, send text messages or multi-media messages or make connections to theInternet during normal device use. It is possible for somebody to use the GPS fe<strong>at</strong>ure totrack a person’s loc<strong>at</strong>ion without their knowledge. Hence SMobile Systems is ready tonotify and block these secure alerts. But the truth is th<strong>at</strong> it is not possible to secure yourmobile device or personal computer completely, as it connects to the internet. Andneither the <strong>Android</strong> phone nor other devices will prove to be the exception.Tomas K<strong>at</strong>ysovas Page 18 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong><strong>Android</strong> and Java MESimilaritiesJava Pl<strong>at</strong>form, Micro Edition or Java ME (previously known as Java 2 Pl<strong>at</strong>form, MicroEdition or J2ME) is a specific<strong>at</strong>ion of a subset of the Java pl<strong>at</strong>form aimed <strong>at</strong> providing acertified collection of Java APIs for the development of software for small, resourceconstraineddevices. Though, do not confuse it with <strong>Google</strong> <strong>Android</strong>, even there are somesimilarities:- Eclipse plugins for J2ME and <strong>Android</strong> <strong>look</strong> very similar and interface very wellwith their respective SDKs;- Both J2ME and <strong>Android</strong> seem to share the same core Java APIs, such as java.utiland java.net. But their APIs for graphics, UIs, etc. are very dissimilar andphilosophies for developing applic<strong>at</strong>ions are very different;- <strong>Android</strong> seems to be more tightly integr<strong>at</strong>ed (up to even the OS services providedand how they interact with the APIs), while J2ME is far more liberal in itsspecific<strong>at</strong>ions for the developer and mobile device manufacturer.A slower applic<strong>at</strong>ion development and performance – these are the main disadvantagesJava's J2ME have for today. J2ME apps are second-r<strong>at</strong>e citizens in the phones. They donot have an access to most of the low-level fe<strong>at</strong>ures, like call API, external connectivity(USB) and other. There is no way to replace or extend built-in phone apps like contacts,calendar and calls. For instance, J2ME applic<strong>at</strong>ions in Nokia devices with S60 work gre<strong>at</strong>for standard tasks. But more advanced users find difficulties handling Wi-Fi access pointswith S60, because APIs simply do not seem to be exposed to J2ME. A user may finddifficulties synchronizing <strong>Google</strong> Calendar with his device - nobody seems to have beenable to figure out how to make the J2ME calendar interfaces work correctly on S60.There are lots of problems with Java applic<strong>at</strong>ions on S60, even though S60 probably hasone of the best Java implement<strong>at</strong>ions. <strong>Android</strong> fills a void in Java Mobile applic<strong>at</strong>ions byproviding API to build richer applic<strong>at</strong>ions - more useful for Smart Phones which containthe ability to provide these types of functionalities. If J2ME filled every void, <strong>Android</strong> asan API wouldn't be needed (though <strong>Android</strong> as an OS could still fill a void). <strong>Google</strong> haswritten its own virtual machine for <strong>Android</strong> most likely as a way to get around licensingissues with Sun. However, <strong>Android</strong> does not include a complete and compliant Java stack(neither JME nor JSE); only a subset and therefore it is technically not the Java pl<strong>at</strong>form,it just <strong>look</strong>s a lot like it.Tomas K<strong>at</strong>ysovas Page 19 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>“Hello World” exampleHere is a simple “Hello World” applic<strong>at</strong>ion, written both in J2ME and <strong>Google</strong> <strong>Android</strong>. Itis possible to use NetBeans v6.0 for J2ME UI easier implement<strong>at</strong>ion. Despite the fact,th<strong>at</strong> NetBeans gener<strong>at</strong>ed source code is quit big, here is a simpler J2ME code version (notusing NetBeans):import javax.microedition.midlet.*;import javax.microedition.lcdui.*;public class HelloWorld extends MIDlet implements CommandListener {priv<strong>at</strong>e Command exitCommand;priv<strong>at</strong>e TextBox tbox;}public HelloWorld() {exitCommand = new Command("Exit", Command.EXIT, 1);tbox = new TextBox("Hello world MIDlet", "Hello World!", 25, 0);tbox.addCommand(exitCommand);tbox.setCommandListener(this);}protected void startApp() {Display.getDisplay(this).setCurrent(tbox);}protected void pauseApp() {}protected void destroyApp(boolean bool) {}public void commandAction(Command cmd, Displayable disp) {if (cmd == exitCommand) {destroyApp(false);notifyDestroyed();}}Tomas K<strong>at</strong>ysovas Page 20 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>HelloWorld.java class written in <strong>Google</strong> <strong>Android</strong> using Eclipse:import android.widget.TextView;public class HelloWorld extends Activity {public void onCre<strong>at</strong>e(Bundle icicle) {super.onCre<strong>at</strong>e(icicle);TextView tv = new TextView(this);tv.setText("Hello World");setContentView(tv);}}Firstly, a text label object is imported through TextView class. After th<strong>at</strong> TextViewconstructor is cre<strong>at</strong>ed and we tell wh<strong>at</strong> to display (tv.setText(“Hello World”)). Finally,we connect constructed TextView with the on-screen display.In conclusion, <strong>Android</strong> code is simple to understand while J2ME code requires betterunderstanding in Java mobile development and NetBeans graphical tool.Tomas K<strong>at</strong>ysovas Page 21 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>Market ResearchA prospective customerA new gener<strong>at</strong>ion of mobile device users is coming in the next decade. These users aregoing to explore the mobile internet afresh with its new fe<strong>at</strong>ures, comp<strong>at</strong>ible mobilephones, new services and applic<strong>at</strong>ions. One of the <strong>Google</strong> mobile software engineersDave Burke predicts, th<strong>at</strong> by 2010, the number of global mobile phone subscribers isexpected to be 4 billion, comparing to the number of desktop internet connections, whichstand <strong>at</strong> 1.2 billion today. This is a huge leap for mobile advertisement business, whererevenue could rise 8 times more by 2012. As other mobile pl<strong>at</strong>forms failed to do so forseven years, <strong>Google</strong> <strong>Android</strong> is going to present new solutions through the fast searchengine, open source applic<strong>at</strong>ions and other services. The Kelsey Group, which workswith public opinion polls and st<strong>at</strong>istics, published the results released October 11 2007,which say, th<strong>at</strong> one hundred out of 500, or 20 percent of people would be interested inpurchasing a <strong>Google</strong> phone. Despite the fact, th<strong>at</strong> <strong>Google</strong> <strong>Android</strong> is in alpha versionand it is unknown for the customers and mobile market, the results <strong>look</strong> promising.The diagram below shows the study, which was conducted in September 2007 via anonline 30-question survey of 500 U.S. mobile phone users aged 18 and older.Tomas K<strong>at</strong>ysovas Page 22 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>People do not find a good Internet experience in their phones today, so they are moreinterested in gravit<strong>at</strong>ing toward an Internet or technology company telephone becausethey think connectivity between devices and to the Internet is going to be much better onthose phones. They use <strong>Google</strong> search, GMail, <strong>Google</strong> Maps, Picasa albums and otherpopular services on their computers, and this is wh<strong>at</strong> they expect to have in their mobiledevices in the close future.Specul<strong>at</strong>ions with cellular carriers<strong>Google</strong> <strong>Android</strong> enters a tangled mess of cellular carrier world. As a new player in themobile market, <strong>Android</strong> brings an open pl<strong>at</strong>form with the new rules. On the one handthere is OHA with major companies and carries, such as T-Mobile and Sprint. On theother hand, there are two largest cellular carries AT&T and Verizon Wireless in UnitedSt<strong>at</strong>es, which have a vested interest in oper<strong>at</strong>ing systems of their own. It is predictable,th<strong>at</strong> Sprint or T-Mobile will be <strong>first</strong> carriers providing devices with <strong>Google</strong> <strong>Android</strong>. Thisensures equal development time for the networks, GSM/HSDPA side and CDMA/EV-DO. But the main problem, which faces all the cellular carriers around the world, is theavailability to download and use free applic<strong>at</strong>ions th<strong>at</strong> could block almost everycommunic<strong>at</strong>ions product they sell. A user does not need to pay for GPS mapping serviceanymore. He can simply download a free one th<strong>at</strong> taps into <strong>Google</strong> Maps. Why pay fortext messages to his friends when he can download an instant messaging client? In fact,why pay for cellular minutes <strong>at</strong> all when a user can download Skype, Gtalk or other clientand just use his d<strong>at</strong>a plan? OS’s such as <strong>Android</strong> thre<strong>at</strong>en carriers with a loss of controlover the applic<strong>at</strong>ions on the phones on their network and they may find themselvesbecoming nothing more than wireless Internet service providers, forced to compete onprice and bandwidth. Another aspect is hardware cost: <strong>Google</strong> <strong>Android</strong> owns 10 percentof the total cost of a phone, which combined with falling hardware prices couldeventually result a fertile unlocked handset market. In conclusion, <strong>Google</strong> has a betterstart in this race than any company had before to bring new rules to the mobile marketwith all carriers, mobile devices and its customers.Tomas K<strong>at</strong>ysovas Page 23 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>Manufacturers’ warPresently, <strong>Google</strong> main competitors like Nokia, Microsoft and Apple do not see <strong>Google</strong><strong>Android</strong> as a serious rival or thre<strong>at</strong> to their business str<strong>at</strong>egies. "It really sounds th<strong>at</strong> theyare getting a whole bunch of people together to build a phone and th<strong>at</strong>'s something we'vebeen doing for five years," said Scott Horn, from Microsoft's Windows Mobile marketingteam. John Forsyth from Symbian said: "We take it seriously but we are the ones withreal phones, real phone pl<strong>at</strong>forms and a wealth of volume built up over years." However,the current situ<strong>at</strong>ion is not so unsophistic<strong>at</strong>ed. There is a huge flurry in the companies,which are not in the list of OHA. For instance, Nokia, which is the largest handsetmanufacturer in the world, nowadays owning some 39% market share, was one of thecompanies snubbed on the invit<strong>at</strong>ion list to the 34-party Open Handset Alliance th<strong>at</strong> isgrowing daily. In contrast, Nokia is buying companies and dumping cash intodevelopment, while <strong>Google</strong> is releasing an open pl<strong>at</strong>form hoping the applic<strong>at</strong>ions andservices will build themselves with the help of a strong developer community,development contests and large alliance of grand companies. Despite of this, Nokia isready to comb<strong>at</strong> wh<strong>at</strong>ever <strong>Google</strong> has to throw with <strong>Google</strong> <strong>Android</strong> in 2008. Anothercompany Apple has already stroked the market with iPhone and its closed oper<strong>at</strong>ingsystem. Accordingly, iPhone in the US remains loyal to AT&T mobile carrier for fiveyears. Th<strong>at</strong> is plenty of time for <strong>Google</strong> to conquer the market with open <strong>Android</strong>.Obvious advantage of <strong>Android</strong> is cost: while iPhone is priced <strong>at</strong> a weighty $400, <strong>Google</strong>says it hopes to reach a more mainstream market by pricing <strong>Android</strong>-powered devices <strong>at</strong>around $200. Microsoft, selling 21 millions copies of Windows Mobile software, stayscalm <strong>at</strong> this point, waiting for some particular results from <strong>Google</strong> <strong>Android</strong>.This nice and healthy competition is just wh<strong>at</strong> the mobile industry needs <strong>at</strong> the moment,<strong>at</strong> least for the consumers. The wars being waged between <strong>Google</strong> and the field will onlycre<strong>at</strong>e better, cheaper handsets and more advanced applic<strong>at</strong>ions.Tomas K<strong>at</strong>ysovas Page 24 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>Mobile FutureMobile AdsJaiku - an activity stream and sharing service th<strong>at</strong> works from the Web and mobilephones was bought by <strong>Google</strong> as important investment into the mobile advertisement.People wondered why <strong>Google</strong> preferred the micro-blogging service to Twitter, which ismuch more popular nowadays. The answer lies in Jaiku’s unique ability to combinemicro-blogging with user’s loc<strong>at</strong>ion. An integral part of the service is a Jaiku clientapplic<strong>at</strong>ion for Symbian S60 pl<strong>at</strong>form mobile phones, which should come to <strong>Android</strong>pl<strong>at</strong>form as well. The client uses loc<strong>at</strong>ion APIs within device to get the handset and theusers’ loc<strong>at</strong>ion based on nearby cellular network towers. Though the loc<strong>at</strong>ion is not veryprecise, the mobile phone is able to broadcast it autom<strong>at</strong>ically. At th<strong>at</strong> point the text canbe connected to users’ loc<strong>at</strong>ion and cre<strong>at</strong>e a list of preferences for each place the userfrequently visits. Using such a technology, it is simple to track down a user via phone’sIP address, whenever he comes into McDonald or is sitting in the airport.<strong>Google</strong> is not a million miles away from being able to push advanced advertising toindividuals based on their profile, their loc<strong>at</strong>ion and their availability. They already offerregional and local targeting for ads for desktop users, but this could be much more usefulfor a mobile phone. And if the ads are truly relevant, interesting and unobtrusive, peoplemight actually start to like them.Tomas K<strong>at</strong>ysovas Page 25 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>Mobile ServicesAdding to its fast growing suite of mobile applic<strong>at</strong>ions and services, <strong>Google</strong> has appliedfor a p<strong>at</strong>ent for a mobile payments service th<strong>at</strong> would allow users to make payments <strong>at</strong>retail shops using their mobile phones. The Text Message Payment p<strong>at</strong>ent describes asystem where <strong>Google</strong> offers mobile focused payments called GPay. This describes asystem where a SMS message would be sent containing a payment amount and otherinform<strong>at</strong>ion. Th<strong>at</strong> payment amount would then be valid<strong>at</strong>ed, debited from the user'saccount, and communic<strong>at</strong>ed from server to server. Payment confirm<strong>at</strong>ion th<strong>at</strong> had beenreceived would also simultaneously be sent to the relevant party, as illustr<strong>at</strong>ed in thediagram below:P<strong>at</strong>ent Applic<strong>at</strong>ion Public<strong>at</strong>ionTomas K<strong>at</strong>ysovas Page 26 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>Described as "a computer-implemented method of effectu<strong>at</strong>ing an electronic on-linepayment," the system mentioned in the p<strong>at</strong>ent applic<strong>at</strong>ion is similar to existing mobilepaymentservices. These services like mobile version of PayPal have been available forsome time but have had little success bursting with merchants and with customers. Themain difference between existing mobile payment systems and GPay is, of course, th<strong>at</strong>GPay is cre<strong>at</strong>ed by <strong>Google</strong> and will be easily adopted by <strong>Android</strong> Pl<strong>at</strong>form.ConclusionIn summary, with all upcoming applic<strong>at</strong>ions and mobile services <strong>Google</strong> <strong>Android</strong> isstepping into the next level of Mobile Internet. <strong>Android</strong> particip<strong>at</strong>es in many of thesuccessful open source projects. Th<strong>at</strong> is, architect the solution for particip<strong>at</strong>ion and thedevelopers will not only come but will play well together. This is notable contrast withApple and other companies, where such architecture of particip<strong>at</strong>ion is clearly bel<strong>at</strong>ed.The <strong>first</strong> <strong>Android</strong> based official devices may well be launched sometime in the secondhalf of 2008. Obviously, th<strong>at</strong>'s an age away when it comes to handset design, and<strong>Android</strong> may well find itself competing against the forthcoming Nokia touch screenphones and maybe even the iPhone 2. Who knows?Tomas K<strong>at</strong>ysovas Page 27 1/19/2008


A <strong>first</strong> <strong>look</strong> <strong>at</strong> <strong>Google</strong> <strong>Android</strong>ReferencesAs the subject is quite new and there are no books and papers published yet, I wrote thisreport based on the inform<strong>at</strong>ion I found on these web pages:http://code.google.com/android/ - <strong>Google</strong> <strong>Android</strong> official webpagehttp://www.openhandsetalliance.com/ - Open Handset Alliance webpagehttp://en.wikipedia.org/wiki/<strong>Android</strong>_(mobile_phone_pl<strong>at</strong>form) – Wikipedia inform<strong>at</strong>ionhttp://googleblog.blogspot.com/ - Official <strong>Google</strong> Bloghttp://davanum.wordpress.com – Gtalk code example written by Davanum SrinivasMoreover, I found the interesting topics on <strong>Google</strong> <strong>Android</strong> browsing <strong>Google</strong> Groups,and, of course, using <strong>Google</strong> search by itself.Tomas K<strong>at</strong>ysovas Page 28 1/19/2008

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!