Introduction to Android Programming

Total Page:16

File Type:pdf, Size:1020Kb

Introduction to Android Programming Android Programming Mahmoud Hammad Introduction • Android provides a rich framework that allows you to develop innovative Apps • Android Apps are developed in Java programming language and run on Android-powered devices • There are many IDEs that support building Android Apps • Tow main resources to learns Android programming • Android developer documentation: https://developer.android.com/index.html • Open source repositories: learn from others’ code • AOSP (Android Open Source ProJect) • F-Droid • … Outline • Android Development Environment • Android Platform • Android App Fundamentals • Building Android App • Open Source Apps Android Development Environment • Java Development Kit (JDK) • Check if you have it ($ java –version). If not, download it from Oracle • Android Software Development Kit (SDK) • Set of tools and the Android framework to develop and build an App • Integrated Development Environment (IDE) • Eclipse with Android Development Tool (ADT) • Android Studio: All-in-One IDE, powered by IntelliJ IDE • Emulator to run and test your App • Android Virtual Device (AVD): created by AVD Manager which is part of the SDK • Genymotion: Very fast emulator runs on Oracle VirtualBox Time to download Android Studio version 2.2 • https://developer.android.com/studio/index.html • Requires 1.6 GB Disk space and 2GB of RAM Android Platform Architecture • Android System is a multi-user Linux-based operating system • App runs in an instance of a VM called: • ART for Android 5.0 (API level 21) and after • Dalvik Android App Fundamentals • App components: ➢Activity ➢Service ➢Broadcast Receiver ➢Content Provider • Each App runs in a process with a unique Linux user ID, for that • Apps can not communicate with each other • Apps can not access system resources (Camera, Location Sensor, etc) • To solve the aforementioned issues, Android developed: • Inter-Component communication mechanism (ICC) o Intent: A messaging obJect to request an action from another component either explicitly or implicitly • Permission system: System permission and custom permission • Android SDK compiles the Apps into Android Packages (APK files) Let’s build an App! Activity Broadcast Receiver Activity You have successfully [U] Make a Toast to Username: ___U___ logged in. welcome the user. {A2} Password : ___ P___ [U] {MAIN} Valid Login Invalid [U, P] Activity Service [U, P, Username and DeviceID] Logs username, password do not password, and device {A1} match. {A3} ID to the system log. Explicit Intent Implicit Intent Component [Intent Extra Data] {Action} Intent Filter Open-Source App • Many open-source Apps developed using Eclipse-ADT • To import an Eclipse-ADT proJect to Android Studio, follow the migration steps described here • Let’s migrate an App: • Download an open-source App from F-Droid • Migrate the App to Android Studio IDE • Explore the App • Build the App • Run it! Any Question?.
Recommended publications
  • How to Create an Android Application Using Eclipse on Windows 7
    How to Create an Android Application using Eclipse on Windows 7 Kevin Gleason 11/11/11 This application note is design to teach the reader how to setup an Android Development Environment on a Windows 7 Computer using eclipse and how to create an Android application. It first explains all of the software and hardware requirements and explains to the reader how to setup and install each of the required programs. It then explains how to design and code an Android application. Finally it explains how to use the Android Virtual Device to test the application. Table of Contents 1 Key Terms ..................................................................................................................................... 2 2 Objective ....................................................................................................................................... 2 3 System Requirements ................................................................................................................... 2 4 Installation and Configuration ...................................................................................................... 3 4.1 Download and Configure Eclipse IDE .................................................................................... 3 4.2 Download Android SDK ......................................................................................................... 4 4.3 Install ADT plugin for eclipse ................................................................................................. 5 4.4 Configure
    [Show full text]
  • Hamza Ahmed Qureshi
    HAMZA AHMED QURESHI add 135 Hillcrest Avenue, Mississauga, ON, Canada | tel +1 (647) 522-0048 url hamza1592.github.io | email [email protected] | LinkedIn | Stack Overflow | Github Summary Proficient in writing code in Java, Kotlin, Node.js and other languages as well as practiced in using Amazon Web Service, Firebase and other latest frameworks and libraries Three years of android development experience through development of multiple applications Skilled in writing generic and expandable code and bridging the gap between web and android applications through development of REST APIs Experienced team player and a leader utilizing collaboration, cooperation and leadership skills acquired while working in different environments of startup, industry and entrepreneurship. Technical Skills Languages & Frameworks used: In depth: Java, Android SDK, Node.js, Amazon Web Services, Firebase, JavaScript, JUnit testing, Espresso As a hobby: CodeIgniter, Magento, OpenGL, React Native, Jekyll Platforms: Android, Web, Windows, Linux Software and IDEs: Intellij Idea, Android Studio, Eclipse, Webstorm, Microsoft Visual Studio Databases used: Firebase Realtime Database, Firebase Firestore, MySQL, SQLite, Oracle DB, Redis Version Control: Git, Gitlab, SourceTree, Android Studio version control SDLC: Agile Development, Test Driven Development (TDD), Scrum, Object Oriented Programming Security: OAuth, OAuth2, Kerberos, SSL, Android keystore Design patterns: MVC, MVVM Professional Experience Full stack android developer, teaBOT inc. Feb 2017 – Present Lead the teaBOT kiosk application and build new features for it Enhanced the teaBOT backend Node.js Api and added new endpoints Wrote manageable and scalable code for both static and dynamic views rendering Created static and dynamic functional components from start to end Supported multiple screen sizes including 15inch tablets Directly managed interns working on the Android application Projects: o teaBOT Android Kiosk Application .
    [Show full text]
  • Android (Operating System) 1 Android (Operating System)
    Android (operating system) 1 Android (operating system) Android Android 4.4 home screen Company / developer Google Open Handset Alliance Android Open Source Project (AOSP) Programmed in C (core), C++, Java (UI) OS family Unix-like Working state Current Source model Open source with proprietary components Initial release September 23, 2008 Latest stable release 4.4.2 KitKat / December 9, 2013 Marketing target Smartphones Tablet computers Available language(s) Multi-lingual (46 languages) Package manager Google Play, APK Supported platforms 32-bit ARM, MIPS, x86 Kernel type Monolithic (modified Linux kernel) [1] [2] [3] Userland Bionic libc, shell from NetBSD, native core utilities with a few from NetBSD Default user interface Graphical (Multi-touch) License Apache License 2.0 Linux kernel patches under GNU GPL v2 [4] Official website www.android.com Android is an operating system based on the Linux kernel, and designed primarily for touchscreen mobile devices such as smartphones and tablet computers. Initially developed by Android, Inc., which Google backed financially Android (operating system) 2 and later bought in 2005, Android was unveiled in 2007 along with the founding of the Open Handset Alliance: a consortium of hardware, software, and telecommunication companies devoted to advancing open standards for mobile devices. The first publicly available smartphone running Android, the HTC Dream, was released on October 22, 2008. The user interface of Android is based on direct manipulation, using touch inputs that loosely correspond to real-world actions, like swiping, tapping, pinching and reverse pinching to manipulate on-screen objects. Internal hardware such as accelerometers, gyroscopes and proximity sensors are used by some applications to respond to additional user actions, for example adjusting the screen from portrait to landscape depending on how the device is oriented.
    [Show full text]
  • An Intro to Eclipse Che Next-Generation Eclipse IDE & Open Source Alternative to Intellij
    An Intro to Eclipse Che Next-Generation Eclipse IDE & Open Source Alternative to IntelliJ January 2016 Tyler Jewell, Eclipse Che Project Lead @TylerJewell The Application Trinity Develop Apps Deliver Apps Host Apps check out & issue mgmt source code repo unit test quality control test build code pre-production agile ide package & integration deploy to test production archiving testing environment deploy to pre- acceptance deploy to production testing production continuous packaging & code quality integration build tools analysis testing artifact release mgmt workspace frameworks repository 100 firms including Atlassian, JetBrains, Puppet, Chef, Ansible, ZeroTurnaround, IBM, Electric Cloud, Coverity, Sonatype, JFrog, and so on... Big Hairy Audacious Goal Let anyone contribute to any project anywhere at any time. no pre-installation required ready to participate in any branch flow always compiles and runs How http://someurl/factory?id=a_project 1. Create new, or load existing, workspace 2. Populate workspace with projects 3. Fetch source 4. Inject tools (compiler, ssh, intellisense) 5. Create runtime 6. Onboard developer into workspace A New Workspace Is Needed Eclipse Che - Next Generation Eclipse IDE Che: IDE + Workspace Server + Plug-Ins Cloud IDE Collaborative WS Server Plug-In Framework A no-installation browser IDE and Host Eclipse Che as a workspace Che includes a growing set of plug- IOE accessible from any local or server. Share tools, runtime and ins. You can also create and remote device. Thin, fast, and programming services across
    [Show full text]
  • Tutorial: Setup for Android Development
    Tutorial: Setup for Android Development Adam C. Champion, Ph.D. CSE 5236: Mobile Application Development Autumn 2019 Based on material from C. Horstmann [1], J. Bloch [2], C. Collins et al. [4], M.L. Sichitiu (NCSU), V. Janjic (Imperial College London), CSE 2221 (OSU), and other sources 1 Outline • Getting Started • Android Programming 2 Getting Started (1) • Need to install Java Development Kit (JDK) (not Java Runtime Environment (JRE)) to write Android programs • Download JDK for your OS: https://adoptopenjdk.net/ * • Alternatively, for OS X, Linux: – OS X: Install Homebrew (http://brew.sh) via Terminal, – Linux: • Debian/Ubuntu: sudo apt install openjdk-8-jdk • Fedora/CentOS: yum install java-1.8.0-openjdk-devel * Why OpenJDK 8? Oracle changed Java licensing (commercial use costs $$$); Android SDK tools require version 8. 3 Getting Started (2) • After installing JDK, download Android SDK from http://developer.android.com • Simplest: download and install Android Studio bundle (including Android SDK) for your OS • Alternative: brew cask install android- studio (Mac/Homebrew) • We’ll use Android Studio with SDK included (easiest) 4 Install! 5 Getting Started (3) • Install Android Studio directly (Windows, Mac); unzip to directory android-studio, then run ./android-studio/bin/studio64.sh (Linux) 6 Getting Started (4) • Strongly recommend testing Android Studio menu → Preferences… or with real Android device File → Settings… – Android emulator: slow – Faster emulator: Genymotion [14], [15] – Install USB drivers for your Android device! • Bring up Android SDK Manager – Install Android 5.x–8.x APIs, Google support repository, Google Play services – Don’t worry about non-x86 Now you’re ready for Android development! system images 7 Outline • Getting Started • Android Programming 8 Introduction to Android • Popular mobile device Mobile OS Market Share OS: 73% of worldwide Worldwide (Jul.
    [Show full text]
  • SDK Developer Reference Manual
    SDK Developer Reference Manual Version 1.0 13 Aout 2019 Mobiyo Pôle Produit 94 Rue de Villiers 92832 Levallois Perret Cedex – France SAS au capital de 2 486 196€, RCS Paris 824 638 209, N° TVA Intracommunautaire : FR61 824 638 209, Code APE : 6201Z i TABLE OF CONTENTS Table of contents Overview ������������������������������������������������������������������������������������������������� 1 What is the Mobiyo SDK . .1 What is an SDK ? �������������������������������������������������������������������������������������������������������������������������������������������������������1 What is a REST Web Service? �������������������������������������������������������������������������������������������������������������������������������1 Who may use this SDK? ����������������������������������������������������������������������������������������������2 Knowledge and skills . 2 How to read this documentation? . 2 Starting Guide �������������������������������������������������������������������������������������� 3 Basic Concept ����������������������������������������������������������������������������������������������������������������3 Requests . 3 Responses ����������������������������������������������������������������������������������������������������������������������������������������������������������������� 4 Character encoding ����������������������������������������������������������������������������������������������������������������������������������������������� 5 Dates . 5 Available formats ���������������������������������������������������������������������������������������������������������
    [Show full text]
  • Programming in Java with Eclipse
    INFO0062 - Object-Oriented Programming Programming in Java with Eclipse Jean-François Grailet University of Liège Faculty of Applied Sciences Academic Year 2018 - 2019 Installation of Java and Eclipse Creating a project in Eclipse Program arguments in Eclipse About Eclipse Eclipse is an Integrated Development Environment. It’s a program specifically designed for software development. It provides • a code editor (with code coloration) • compilation and debugging tools • project management, auto-completion, etc. For those who followed INFO2009 or INFO0946, it’s like Code::Blocks. Eclipse is a very simple solution to program in Java under Windows. • macOS/Linux users can use it too, but using java/javac is a simpler approach. • Eclipse can however be arguably more practical for large-scale projects. 1 / 17 Installation of Java and Eclipse Installation of Java and Eclipse Creating a project in Eclipse Program arguments in Eclipse How to install Eclipse You will need to: • install Java on your computer • install Eclipse itself To install Java SE (Standard Edition), you can • Windows/macOS: download it on Oracle’s website. • Linux: install it via an online repository. N.B.: Java’s lattest versions are 64-bit only. • I.e., only compatible with a device that has a 64-bit hardware. Hopefully, most computers (including laptops) are 64-bit nowadays. If your device is quite old, it might be worth to double check it. • N.B.: quite old here means more than several years (e.g. 5). 2 / 17 Installation of Java and Eclipse Creating a project in Eclipse Program arguments in Eclipse How to install Java SE Windows/macOS • Download and install Java SE 11 • 32-bit Windows: download and install Java SE Development Kit 8u201 for x86 Linux • You can use an online repository to download and install Java SE 11 • 32-bit devices: prefer using your OS’ default repositories.
    [Show full text]
  • A Strategy for Addressing the Needs of Advanced Scientific Computing Using Eclipse As a Parallel Tools Platform
    A Strategy for Addressing the Needs of Advanced Scientific Computing Using Eclipse as a Parallel Tools Platform Gregory R. Watson Craig E. Rasmussen Los Alamos National Laboratory P.O. Box 1663, MS B287 Los Alamos, NM 87545 December 2005 LA-UR-05-9114 ABSTRACT If parallel computer systems are to achieve the kinds of productivity improvements necessary to meet the needs of high productivity computing systems (HPCS), then a radical change will be required in how tools are developed for programmers and users of these systems. The number and complexity of tools is making it difficult for developers to access and use the tools effectively, and the lack of a common tool infrastructure significantly complicates tool development efforts. The rapid pace of change means that developing and maintaining the kinds of tools that will be needed to effectively utilize the capacity of future advanced computer systems is an increasingly onerous task. This paper proposes a strategy that will lead directly to productivity and quality improvements in the development and use of parallel applications, and that will provide a framework to guide and foster future tool development. This strategy is based on using the Eclipse platform to form the foundation of an integrated environment for parallel application development. The intention is not just to produce another set of tools, however, but rather to use Eclipse as both a focal point for tool development, and as a platform for producing highly integrated tools that are needed to meet the future needs of the HPC community. A Strategy for Addressing the Needs of Advanced Scientific Computing Using Eclipse as a Parallel Tools Platform 1 1 INTRODUCTION As high productivity computing systems (HPCS) are developed to meet the demands and computational challenges facing advanced scientific research, it is becoming increasingly apparent that existing software infrastructure and tools will need to be substantially improved in order to achieve the goal of sustained performance on terascale machines [17].
    [Show full text]
  • Installing a Development Environment
    IBM TRIRIGA Anywhere Version 10 Release 4.2 Installing a development environment IBM Note Before using this information and the product it supports, read the information in “Notices” on page 13. This edition applies to version 10, release 4, modification 2 of IBM TRIRIGA Anywhere and to all subsequent releases and modifications until otherwise indicated in new editions. © Copyright IBM Corporation 2014, 2015. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Chapter 1. Preparing the IBM TRIRIGA Trademarks .............. 15 Anywhere environment ........ 1 Installing the Android development tools..... 1 Installing the iOS development tools ...... 3 Installing the Windows development tools .... 5 Chapter 2. Installing IBM TRIRIGA Anywhere .............. 7 Chapter 3. Installing an integrated development environment ....... 9 Chapter 4. Deploying apps by using MobileFirst Studio .......... 11 Notices .............. 13 Privacy Policy Considerations ........ 14 © Copyright IBM Corp. 2014, 2015 iii iv Installing a development environment Chapter 1. Preparing the IBM TRIRIGA Anywhere environment Before you can build and deploy the IBM® TRIRIGA® Anywhere Work Task Management app, you must set up the computer on which IBM TRIRIGA Anywhere is installed. Procedure 1. Prepare the environment for building the app: Android Install the Android development tools. iOS Install the iOS development tools. Windows Install the Windows development tools 2. Install IBM TRIRIGA Anywhere 3. Optional: Install an integrated development environment. 4. Deploy the app with MobileFirst Studio. Installing the Android development tools Oracle JDK and Android SDK are required to build Android mobile apps. About this task If you install the integrated development environment, which includes MobileFirst Studio and Eclipse, you must also install the Android Development Tools (ADT) plug-in.
    [Show full text]
  • Eclipse Project Briefing Materials
    [________________________] Eclipse project briefing materials. Copyright (c) 2002, 2003 IBM Corporation and others. All rights reserved. This content is made available to you by Eclipse.org under the terms and conditions of the Common Public License Version 1.0 ("CPL"), a copy of which is available at http://www.eclipse.org/legal/cpl-v10.html The most up-to-date briefing materials on the Eclipse project are found on the eclipse.org website at http://eclipse.org/eclipse/ 200303331 1 EclipseEclipse ProjectProject 200303331 3 Eclipse Project Aims ■ Provide open platform for application development tools – Run on a wide range of operating systems – GUI and non-GUI ■ Language-neutral – Permit unrestricted content types – HTML, Java, C, JSP, EJB, XML, GIF, … ■ Facilitate seamless tool integration – At UI and deeper – Add new tools to existing installed products ■ Attract community of tool developers – Including independent software vendors (ISVs) – Capitalize on popularity of Java for writing tools 200303331 4 Eclipse Overview Another Eclipse Platform Tool Java Workbench Help Development Tools JFace (JDT) SWT Team Your Tool Plug-in Workspace Development Debug Environment (PDE) Their Platform Runtime Tool Eclipse Project 200303331 5 Eclipse Origins ■ Eclipse created by OTI and IBM teams responsible for IDE products – IBM VisualAge/Smalltalk (Smalltalk IDE) – IBM VisualAge/Java (Java IDE) – IBM VisualAge/Micro Edition (Java IDE) ■ Initially staffed with 40 full-time developers ■ Geographically dispersed development teams – OTI Ottawa, OTI Minneapolis,
    [Show full text]
  • Android Studio Add Success Statement Textview
    Android Studio Add Success Statement Textview Tongue-lashHow luckless andis Orion condolent when Langstonimitative and always surgical undresses Domenico hurryingly hinny someand reran mannitol? his coenzymes. Decent and mannered Conroy never unriddles his thickets! What are talking about this chapter introduces another import statements for the layers always be run the android textview font size of objects and end of an alert with In textview widget window find a successful registration forms can add action? Android 4 Android JUnit Test 2020 BogoToBogo. Cards are running, but it controls set dynamically and text a container, i reduce spam. When listers or corner of asynchronous programming allows them edit my case, or decrease volume of android studio add success statement textview text that statement manually. From their current request. It type your keystore and add icons related details are successful apps, or not sponsored by eclipse, while parsing later when you need for. How do i find it out in mind that represents an implementation of textview names and others are what is. Landscaping Supplies Hilltop Garden Centre Coventry. How we add a successful apps are using textview names same classes with its fully worked. To boot custom application icons first download the Xamarin Android Icons zip. In justice to the element name, all, our sample app displays different feature images for numerous theme. The join with each pivot table replicate to create this kind of table contain multiple sources personally recommend line. Android Studio basically takes Java class name of what actually provide then the activity name, Android Studio might talk some build errors because you are custom the Android SDK or build tools, you certainly need only install Google Play services.
    [Show full text]
  • Top Productivity Tips for Using Eclipse for Embedded C/C++ Developers
    Top Productivity Tips for Using Eclipse for Embedded C/C++ Developers Garry Bleasdale, QNX Software Systems, [email protected] Andy Gryc, QNX Software Systems, [email protected] Introduction This paper presents a selection of Eclipse IDE tips and tricks gathered from: the QNX® development community: our engineers, techies and trainers Foundry27, the QNX Community Portal for open development, where we have an Eclipse IDE forum Eclipse.org forums public web sites and blogs that offer Eclipse-related expertise The 27 tips described in this paper are the tips that we received from these sources and identified as most interesting and useful to developers. We present them here with the hope that they will help make you more productive when you use the Eclipse IDE. About Eclipse A modern embedded system may employ hundreds of software tasks, all of them sharing system resources and interacting in complex ways. This complexity can undermine reliability, for the simple reason that the more code a system contains, the greater the probability that coding errors will make their way into the field. (By some estimates, a million lines of code will ship with at least 1000 bugs, even if the code is methodically developed and tested.) Coding errors can also compromise security, since they often serve as entry points for malicious hackers. No amount of testing can fully eliminate these bugs and security holes, as no test suite can anticipate every scenario that a complex software system may encounter. Consequently, system designers and software developers must adopt a “mission-critical mindset” and employ software architectures that can contain software errors and recover from them quickly.
    [Show full text]