3 Programming Mobile Applications with AndroidLesson 1.- Introduction to AndroidIn this lesson we will learnWhy to develop in Android ?What do we need to develop Android applications?How to setup the environment for development ?When and how to use the emulator?What is the manifest file and what are the main permissions?OSSCOM Programming Mobile Applications with Android

4 Programming Mobile Applications with AndroidWhat is Android?Software Platform and a Operative System for mobile devicesBased in the Linux kernelAllows to code in Java, but also in other languages thanks to the use of native ARM codeLot of libraries, development tools and documentationOSSCOM Programming Mobile Applications with Android

11 Programming Mobile Applications with AndroidAndroid … some historyFounded in 2003Andy Rubin, Rich Miner, Nick Sears and Chris WhiteAcquired by Google in the Summer of 2005Open Handset Alliance is established in 2007Android 1.0 was released on September 23, 2008Since 2010, Nexus series of devicesLot of versions and updatesOSSCOM Programming Mobile Applications with Android

12 Programming Mobile Applications with AndroidAndroid versionsEach new version of android uses the name of some well-known sweetsMain differences between versionsAPI levelWidgets and librariesVideo and audio supportKeyboardCommunicationOSSCOM Programming Mobile Applications with Android

18 Programming Mobile Applications with AndroidEnvironment setupDownload the Android Developer Tools that includes:Eclipse + ADT PluginAndroid SDK toolsAndroid Platform toolsA version of the Android PlatformA version of the Android system image for the emulatorhttps://developer.android.com/sdk/index.htmlOSSCOM Programming Mobile Applications with Android

26 Programming Mobile Applications with AndroidDebugger is another interesting tool for Android developmentWe can access in real-time to the real value of the application internal parametersVery useful to find the origin of application errorsWe can both debug applications running on the emulator or the physical smartphoneFollow the instruction to install the drivers and set your device for evaluationOSSCOM Programming Mobile Applications with Android

27 Programming Mobile Applications with AndroidThanks to the emulator, we canEvaluate our applications using different platformsTest non-stable applicationsEmulate locations , battery levels, SMS or calls… but on the contraryDevelopment is very slowSome characteristics cannot be emulatedOSSCOM Programming Mobile Applications with Android

30 Programming Mobile Applications with AndroidLet's all create our first Android applicationWe can see on the left allthe files that have been createdautomaticallyPlease open the manifestOSSCOM Programming Mobile Applications with Android

32 Programming Mobile Applications with AndroidFirst Android applicationSource code and visual interfaces are separatedSource Code: .java files located in /srcVisual Interfaces: layout files located in /res/layoutOut first application will consist of a single screen with our name → No modification in the behaviorPlease open the layout file (activity_main.xml)OSSCOM Programming Mobile Applications with Android

33 Programming Mobile Applications with AndroidFirst Android applicationSource code and visual interfaces are separatedSource Code: .java files located in /srcVisual Interfaces: layout files located in /res/layoutOut first application will consist of a single screen with our name → No modification in the behaviorPlease open the layout file (activity_main.xml)We have two views: graphical layout and xml sourceOSSCOM Programming Mobile Applications with Android

35 Programming Mobile Applications with AndroidFirst Android applicationNow we will prepare a emulator for its executionFrom the Android SDK Manager, please install the options from the 4.1 (Api 16)Once all the packages have been installed (several steps can be required), restart EclipseOpen the Android Virtual Device Manager, create a new one with the following configurationName: Nexus7Api16, Device: Nexus 7Target: Android 4.1.2OSSCOM Programming Mobile Applications with Android

36 Programming Mobile Applications with AndroidFirst Android application: executionNow, we will run our applicationRight button over the project → Run As → Android ApplicationWe now find a window to select where to execute the applicationSmartphone → if plugged and configured properlyEmulator → we need to loadOSSCOM Programming Mobile Applications with Android

39 Programming Mobile Applications with AndroidAndroid Manifest FileConfiguration file that describes the applicationPermissions that are requestedAccess to the Internet, Camera, external storageMinimum version of SDK for executionName and logo of the applicationActivities (Windows) including the main oneLibraries and features usedOtherOSSCOM Programming Mobile Applications with Android

40 Programming Mobile Applications with AndroidAndroid Manifest FileMain changes that should be applied: permissionsCan be added using the GUI or directly my modifying the codeBasic permissionsandroid.permission.WRITE_EXTERNAL_STORAGEandroid.permission.INTERNETandroid.permission.CAMERAandroid.permission.SEND_SMSandroid.permission.ACCESS_COARSE_LOCATION...OSSCOM Programming Mobile Applications with Android

41 Programming Mobile Applications with AndroidAndroid Manifest FileThe list of required permission will be listed when the application is being installedInclude just the permissions that are neededOSSCOM Programming Mobile Applications with Android

42 Programming Mobile Applications with AndroidLesson 1.- Introduction to AndroidAndroid Lab I.- Create, compile and execute a hello world applicationFollow the instructions to prepare your computer for developmentCreate a new application and discover all the options that are availableExecute the application both in the emulator and your mobile phoneOSSCOM Programming Mobile Applications with Android

About project

Feedback

To ensure the functioning of the site, we use cookies. We share information about your activities on the site with our partners and Google partners: social networks and companies engaged in advertising and web analytics. For more information, see the Privacy Policy and Google Privacy &amp Terms.
Your consent to our cookies if you continue to use this website.