Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Basic introduction to android and android devel...

Masebinu Benjamin
February 15, 2018
34

Basic introduction to android and android development

Masebinu Benjamin

February 15, 2018
Tweet

Transcript

  1. Benjamin Masebinu ❖ Android engineer – PlanetNest ❖ Lead Engineer

    – Techatrek ❖ Lead organizer – GDG FUTA Social Media ❖ @benhaxe ❖ github.com/benhaxe Other Skills: ❖ Mobile UI/UX ❖ Firebase ❖ Nodejs
  2. What we will learn today  What is android 

    Why develop for android  Android platform overview  Android app overview  Android app lifecycle  Android app fundamentals and building blocks(Activities/Fragments, Intent, Services, Broadcast Receiver, Content Provider/Content Resolver, )  Design  What we need to get started with android development
  3. What is Android Android is the world’s most popular and

    dominant mobile operating system. It is based on Linux kernel 3.4/3.10 (depending on device) and is open-source (with proprietary bits). It runs on a wide variety of hardware, including smartphones, smart watches, cars, televisions, digital cameras and more. It was founded by Andy Rubin and three others in October 2003 and got acquired by Google in August 2005.
  4. Android is gigantic  Over 1B users  Over 1.5M

    activations per day  Over 200M smartphones running Android sold annually  Over 1.43M apps available  Over 76% smartphone operating system market share
  5. Android is freedom  Thousands of third party libraries available

     Free SDK, IDE and emulator  No restrictions; access anything*  Faster access to new form factors and hardware  Distribute your app anywhere (Playstore, Amazon Appstore, …)
  6. ► Java: Java class files containing app logic ► Res:

    Different resource files ► Anim: Animation resource files ► Drawable: Images ► Drawable-Xdpi: Images depending on screen density ► Layout: App layout files ► Menu: Layout menu files ► Values: Value files (strings, colors, arrays, etc) ► Values-vX: Value files depending on API level ► Values-Xdp: Value files depending on screen density ► XML: XML files (duh) ► AndroidManifest.xml: App metadata file ► build.gradle: Build related settings
  7. Activities  A presentation layer, window/interface of an application which

    a user can interact with  Every app has at least one activity, and an application can have several activities.  Activities can be ❖ Full-screen ❖ Floating ❖ Embedded inside another activity
  8. Fragments  A piece of user interface that is meant

    to be reused  Adds modularity to your app and makes dynamic UI design easy  it has its own layout, behavior and lifecycle callbacks, but it killed/stop if the activity is too
  9. Intents  An intent is an abstract description of an

    operation to be performed. Think of it as an “intention” to do something  Intents can be used to start activities, services or send a broadcast  Intents are of two types – Explicit (when you know what exactly you want to do), and Implicit (when you’re not sure what you want to do)
  10. Use Cases  Implicit Intents ❖ One use case of

    Implicit intent is: take for example you want to open a link in a browser, and you have more than one browser, implicit intent helps you choose what browser you will like to open the defined link.  Explicit Intents ❖ The most used case of explicit intent is moving from activity to the other, and it can also be used to transfer data from one activity to the other.
  11. Services  A service is a long running operation in

    the background  There are two types of services in Android – Bounded (which runs as long as components which bind to it run) and Unbounded (which runs indefinitely) but a service can also be both  Services run on the main thread of the application by default  Faceless components that run in the background E.g. Music Player, Network download.
  12. Broadcast Receiver  A broadcast is a system or app

    event that can be “broadcasted” so other apps/services can listen for it  Broadcasts are handled by a BroadcastReceiver, which is a component that allows you to listen for broadcasts  A BroadcastReceiver can be implemented in AndroidManifest.xml, or dynamically by calling registerReceiver(), or both  An app’s/services’s BroadcastReceiver is never called if the app/service hasn’t been explicitly started by the user. Battery level SMS Received Photo Captured System sends a broadcast App/Services
  13. Content Providers / Resolvers  A content provider allows you

    to store data in your app in a structured way, similar to a relational database like SQL, for the purpose of providing it to other apps. Example usage: Contacts app, SMS app, etc  A content resolver allows you to get data from a content provider or manipulate its data (modify, delete, update, etc)  You cannot request to read data from a content provider at runtime, it has to be declared in AndroidManifest.xml App Database Update Delete Query
  14. Layouts  A layout defines the visual structure for a

    user interface, such as the UI for an activity or app widget  Layouts can be defined both in XML or programmatically using View and ViewGroup objects  Some types of Layouts in Android: LinearLayout RelativeLayout FrameLayout & Constraint layout