0% found this document useful (0 votes)
123 views

SWE2008 - Android Programming: Dr. J. Christy Jackson

This document provides information about an Android programming course taught by Dr. J. Christy Jackson at VIT. It includes details about class times, textbooks, exams, projects, and online class format. The course will cover introduction to mobile and Android topics over multiple modules, with an emphasis on learning programming and creating an Android mobile application as a project. Students are encouraged to form groups of up to 3 people and integrate a database or Google Maps into their app.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views

SWE2008 - Android Programming: Dr. J. Christy Jackson

This document provides information about an Android programming course taught by Dr. J. Christy Jackson at VIT. It includes details about class times, textbooks, exams, projects, and online class format. The course will cover introduction to mobile and Android topics over multiple modules, with an emphasis on learning programming and creating an Android mobile application as a project. Students are encouraged to form groups of up to 3 people and integrate a database or Google Maps into their app.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 87

SWE2008 – Android Programming

Dr. J. Christy Jackson


Welcome back to VIT

• Please make sure you are sitting in the


correct class
• SWE2008 Android Programming–
A2+TA2 Slot – Dr. Christy Jackson J
Class Timings
• Monday 4:45 – 5:35PM
• Tuesday 2:00 – 2:50 PM
• Thursday 2:55 – 3:45 PM
Very Little About Me
• Name: J. Christy Jackson
• B.E (CSE)- Karunya University, Coimbatore
• MS(IT)- Griffith University, Brisbane, Australia
• Ph.D. -  VIT Chennai
• Worked as an Oracle SQL forms and reports developer
and now in VIT for almost 8+ years
• Email: [email protected] or
[email protected] 
• Phone: +91 8939109547 ( WhatsApp is appreciated)
Text Book
Joseph Annuzzi, Jr., Lauren Darcey, Shane Conder,
“Introduction to Android Application Development”,
Create Space Independent Publishing Platform, Fourth
Edition, 2014.
• Reference Books
• 1. Wei-Meng Lee, Beginning Android 4 Application Development,
Wrox, 2012
• 2. Budi Kurniawan. Introduction to Android Application
Development, 2014
• 3. Dawn Griffiths, Head First Android Development, O’reilly, 2015
• 4. Rajiv Ramnath, Roger Crawfis, and Paolo Sivilotti, Android SDK
3 for Dummies, Wiley, 2011
• 5. Rick Rogers, John Lombardo, Zigurd Mednicks and Blake
Meike , “ Android
My recommendation
• Android Studio 4.0 Development Essentials
- Java Edition: Developing Android Apps
Using Android Studio 4.0, Java and Android
Jetpack
• Learn Android Studio 4: Efficient Java-
Based Android Apps Development 2nd ed.
Edition
Marks Split Up - Theory
• CAT – I 30 Marks 15 Marks
• CAT - II 30 Marks 15 marks
• Digital Assignment 30 Marks 30 Marks
• TEE 60 Marks 40 Marks
• Total 100 Marks
Project Marks Split Up
• Review-1 – 20 marks
• Review-2 – 30 marks
• Review-3 – 50 marks
Examinations
• Model Question Paper will be given well in advance
• Marks split up for each question and how many questions
would be there in the exam
• This applies for CAT as well as Term End Exams
Project
• Maximum of 3 Students in a Group
• Should create an android mobile application
• At the end of the project, App has to be deployed on the
mobile phone
• Every App should have an integration of either the
database of google maps
Online Classes
• Convenience of software to be used
• Internet
• Laptop
• Good earphones
• Set up an environment to work/study from
home
• Project Reviews/ Project Work
Gclassroom/Gmeet/ MS Teams
• Attendance will be taken sometime during
the class
• Kindly Mute after entering the class / you
may also choose to turn off your video
• Polls will be available
• Links for submission
• Android Studio/ Flutter
Pre-requisite
• SWE1007 has to be completed
• Should have strong fundamental knowledge on Java
Basic Java Test
1. How will you create an Object in Java
2. How will you inherit from a parent class?
Lab Class and Virtual Class
Guidelines for a Successful Android Programming
Course
• Notebook and Pen is compulsory for this course
• Try to be on time
• Be attentive in the class and please DO NOT get
distracted
• Follow the tips given for answering the Higher order
thinking (HOT) questions
• Learn Programming (No other choice)
WhatsApp Group
• Will be created after add/drop
MODULE -1 INTRODUCTION
TO MOBILE AND ANDROID
History of mobile
Basic Java Test – Answer -1

• Class_Name Object_Name = new Class_Name();


• Helloclass helloobject = new Helloclass();
Basic Java Test – Answer -2
class Super {
.....
.....
}
class Sub extends Super {
.....
.....
}
BRIEF HISTORY OF
MOBILE
The beginning…
The Brick Era
• It was Portable! calls
• It was Portable!
• More expensive than payphones
• Enormous battery
• Stakeholders: – Stockbrokers, salespeople, …
• After a while, more cellular radio towers and… it got (a
little bit) smaller
The Candy Bar Era
• 2G network : GSM, CDMA, TDMA, SMS
• More cellular towers less power needed much smaller
• Better voice quality
• Added SMS
• Everyone wanted to have a mobile phone – economic
prosperity in EU, USA, and JP
The Feature Phone Era
• 2.5G network: GPRS calls SMS & MMS music & photos
• Camera
• MMS
• Data-capable devices
• Internet on mobile (very poor)
• high prices
• poor marketing
• inconsistent rendering
The Smartphone Era
• 3G, HSDPA, WI -FI calls SMS & MMS music & photos
• 3G, HSDPA, WI -FI
• Like a feature phone, but simulating a PC
• Its own OS (es. Symbian)
• Larger screens, stylus
• The Mobile Platform becomes key
• (push) email as primary driver
The Touch Era
• 3G, 4G calls SMS & MMS music & photos APPS
• Accelerometers
• GPS/Location-based
• User-centered design – true impact on his eveyday life
• true impact on his everyday life
• • Rich interfaces
• • A personal media platform
• • Mobile web - everyday
Wireless Application Protocol (WAP)
• WAP was a stripped-down version of Hypertext Transfer
Protocol (HTTP), which is the backbone protocol of the
World Wide Web
• WAP browsers were designed to run within the memory
and bandwidth constraints of the phone
Mobile Ecosystem

S Consumers
e OEMs OS Vendors
c
u
r
i
Services & Developers
t
Infrastructure
y
Carriers
Wireless Networks
Wireless Networks: Current Landscape

• Wireless LANs

• Cellular Networks

• Proximity Technologies
Wireless LANs

• Home & enterprise hotspots

• High data rates

• Easy to use, plug & play components

• Integrated in hardware

• Limited coverage area

• 802.11 family of standards


Cellular Networks
• High mobility

• Initially designed for voice

• Real time, always-on

• Extended to offer Internet & multimedia

• Data rates lower than wifi

• Deployed successfully all over the world

• High error rates

• Weak and proprietary cryptographic algorithms like

COMP128
Proximity Technologies
• Near Field Communication (NFC)

• Inches

• Secure

• Bluetooth

• Bluetooth versions 3 & 4

• Security issues

• Proximity detection & battery power


Wireless Networks: Use Cases
• Mobile TV

• Mobile Games

• Video/Audio Streaming

• Conferencing

• Content Download

• M2M Applications
Mobile Device Architecture

Applications

Software Stack

Operating System

Device Hardware
Operating Systems:
• Real Time Operating Systems (RTOS)

• Limited capacity, minimal

• Specific use case

• Compact

• Efficient

• Open Source and proprietary RTOS (BeRTOS,

FreeRTOS, VxWorks, PikesOS, LynxOS,


Nucleus RTOS)
Operating Systems: Smart Phones
• Feature rich

• Modern OS

• Capabilities and services

• Free and proprietary OS (J2ME,

Symbian, FreeBSD, Linux variants like


HP WebOS, Maemo)
Operating Systems & OEMs
• OEMs bake OS into the device

• OS cannot be changed

• OS defines key features of device

• Security characteristics

• Multithreading

• Resource sharing
Mobile Device Architecture

Applications

Software Stack

Operating System

Device Hardware
Software Stack
• Software layer put on top of OS

• Middleware or mobile platform

• Stack exposes device capabilities

• Defines application structure

• Open source & proprietary (Android,

iPhone, Blackberry OS)


Android Architecture

http://developer.android.com/guide/basics/what-is-android.html
Difference between SDK and API
• an API is an interface. It's like the specification of the
telephone system or the electrical wiring in your house.
Anything can use it as long as it knows how to interface.
You can even buy off-the-shelf software to use a particular
API, just as you can buy off the shelf telephone equipment
or devices that plug into the AC wiring in your house.
• an SDK is implementation tooling. It's like a kit that
allows you to build something custom to hook up to the
telephone system or electrical wiring.
API Vs SDK
Examples of APIs: Examples of SDKs:

• Java API • JDK


• Google Maps API • GWT
• Flash Player API • Flex SDK
• Android SDK
WHY MOBILE?
Size and Scope of the Mobile Market
• China – 24%
• India – 21%
• United States – 6%
• Indonesia – 4%
• Brazil – 3%
• Pakistan – 3%
Size and Scope of the Mobile Market
• Mobile devices have already outpaced majority of
media we rely on everyday, including computers
• Today more people access the web via a mobile
device than a computer
• The largest and most available mass medium to
mankind
• This is a good justification to create mobile
products/application
7th Mass Medium
• First Mass Medium – Printing Press
• Second Mass Medium – Recordings
• Third Mass Medium – Cinema
• Fourth Mass Medium – Radio
• Fifth Mass Medium – Television
• Sixth Mass Medium – The Internet
• Seventh Mass Medium – Mobile Phone
Mobile’s Unique Benefits
• The First Truly Personal Mass Media
• The First always on mass media
• The first always carried mass media
• The only mass media with a built in
payment channel
The Eighth Mass Medium: What’s Next?
• Ubiquity
• Includes Ubiquitous Computing, Ubiquitous Networks, and
ubiquitous media.
• We are moving to an age where the web, together with
the mobile technology, can create a write once publish
anywhere environment
• Ubiquitous computing (ubicomp) is a concept in
software engineering and computer science
where computing is made to appear everywhere and
anywhere. In contrast to desktop computing, ubiquitous
computing can occur using any device, in any location,
and in any format.
DESIGNING FOR
CONTEXT
Mobile App Vs Mobile Website Design
• 4 Types of Mobile Applications
• Responsive Website.
• Native Application.
• Web Application.
• Hybrid Application.
Responsive Websites
• A responsive website is one that adapts to whatever
device it is being viewed on.
• Whether that is a desktop computer, tablet or mobile
device, the same website will display the same content
using a visual design most suited to that device.
Responsive Websites
• Responsive websites are good for…
• Information rich websites.
• Users that are looking to gather information.
• If you are unsure what option you need then a responsive
website is normally a good starting point.
Native Apps
• Native apps are applications that run physically on the
mobile device and are coded specifically for the operating
system of that device.
• These are the applications you typically find in either the
Google Play or iOS App Store.
• They can tap into the wider functionality of the device;
including the camera, microphone, compass,
accelerometer and swipe gestures.
Web Application
• A web application shares characteristics with both a native
application and a responsive website.
• Web apps are limited in what they can do effectively
in terms of features and they will generally always
require an Internet connection to work. 
• As with a responsive website a web application is built
using HTML, CSS and Javascript and lives entirely online.
Hybrid Applications
• Somewhere between native and web apps you’ll
find hybrid apps.
• They are usually quicker to build (and thus cheaper) than
native apps, but a step-up from what you can expect out
of browser-based web apps
• An advantage that hybrid apps have over native is that
it’s faster and easier to develop
The 3 C’s of Mobile Web
• Cost
If you don't develop your mobile website responsibly, the
user could get stuck with a big bill in order to view your
content.
• Content
Issues like navigation, image sizes, page weight and
scripts all need to be considered when thinking about your
website on mobile devices.
• Context
What does your website add to the users mobility? How
do you add value to the their physical context? What is the
context in which they will use your site? On a bus or train?
Best Practices for designing with Context in Mind

• Display only five categories per page


• Try to prioritize by activity of popularity.
• Keep total file sizes, including images and styles,
as small as possible.
• Use ordered lists instead of unordered lists for
navigation
Best Practices for designing with Context in Mind

• Keep the Information Architecture Simple


Time to Introduce Yourselves
• Name
• Where are you from?
• Languages you speak?
• Try to talk about something which your interested in for
about 2 minutes (Ex: I am a big fan of sports, etc)
ANDROID APPLICATION
DEVELOPMENT
ENVIRONMENT
Setting up
• Setting up Android Studio is fairly straightforward and is
easier than ever thanks to nearly everything being
bundled into one installer.
• Download it and you’ll get not only Android Studio but also
the Android SDK, the SDK manager and more.
• The only other thing you’ll need is the Java Development
Kit,.
• Remember, Android Studio is only really your window into
Java! Note: Android Studio and the SDK are rather large,
so make sure you have some space free on your C:\ drive
before you get started.
Setting up
• Follow the simple instructions during installation and it
should also set you up with an Android platform that you
will be able to develop with as well.
• Be sure to tick the checkbox to tell the installer that you
want the Android SDK as well and make a note of where
Android Studio itself and the SDK are being installed.
These are the defaults that it selected for my installation:
• Pick a directory for the SDK that has no spaces in it.
• Note that the AppData folder that Android Studio has
selected here is a hidden folder in Windows.
• That means you’ll need to select ‘Show Hidden Folders’ if
you want to browse to it using the explorer.
Starting a new project
• Once Android Studio is up and running, you’ll want to dive
in and create a new project.
• You can do this by launching Android Studio and then
selecting New Project, or you can choose File > New >
New Project at any time from the IDE itself.
Starting a new project
• You’ll then have the opportunity to choose from a number
of different types of activity.
• Activities are effectively ‘screens’ in an app. In some
cases, this will be the entire app or in others, your app
might transition from one screen to the next.
• You’re free to start a new project with no activity (in which
case, you would choose ‘Add No Activity’) but you’ll
almost always want one, so it’s easier to let Android
Studio set you up with something resembling a blank app
template to begin with.
Starting a new project
• Often you’ll choose a ‘Basic Activity’, which is the default look
and feel for a new Android App. This will include a menu in the
top right corner, as well as a FAB button – Floating Action
Button – which is a design choice that Google is trying to
encourage. An ‘Empty Activity’ is the same thing but without the
added chrome.
• Pick the option that best suits the app you have in mind to build
and this will impact on the kind of files you are presented with
when you first start things up. You’ll also be able to choose your
app’s name at this point, the minimum Android SDK you want
to support and the package name. The package name is the
final file name that the app will have when you upload it to the
Play Store – a combination of the app’s name, along with the
name of the developer.
Meet Gradle
• Android Studio tries to keep things nice and simple for users by
providing all of the necessary tools and features in one place.
• Things only get more complicated once you need to interact with some
of these other elements.
• For instance, you might notice that Android Studio mentions ‘Gradle’
occasionally. This is a ‘build automation tool’ which essentially helps
Android Studio to turn all those different files into one single APK.
• You should be able to leave Gradle to do its thing most of the time, but
you will occasionally need to jump into the build.gradle files
• if you want to add a new ‘dependency’ allowing advanced features for
your app. Sometimes, if things stop working, you can choose Build >
Clean Project and this will essentially reaffirm where all the files are
and what their roles are. There are normally going to be two of these
Gradle build files, one for the whole project and one for the ‘module’
(the app).
Debugging, virtual devices and the SDK manager
• Once you’re ready to test your app, you have two options.
One is to run it on your physical device and the other is to
create a virtual device (emulator) to test it on.
• Running it on your device is simple. Just plug it in via
USB, make sure you’ve allowed USB debugging and
installations from unknown sources in your phone’s
settings and then hit the green play button at the top, or
‘Run > Run App’.
• You’ll see a message telling you that Gradle build is
running (i.e. your code is being made into a full app) and
then it should spring to life on your device. This is faster
than ever right now thanks to the Instant Run feature.
App Live Reports
• While your app is running, you’ll be able to get live reports
through the ‘logcat’ tab in the Android Monitor, found in
the lower half of the screen.
• Should something go wrong causing your app to crash or
become unresponsive, then red text will appear and this
will give you a description of the problem. You might find
that it’s just a matter of having forgotten permissions or
something else that’s easy to fix.
• It essentially saves you a ton of time versus blindly trying
to guess what went wrong. Make sure to filter the types of
messages you want to see here.
App Live Reports
• You can also switch to the monitors tab and see useful
information such as the CPU usage etc. The Android
Device Monitor takes this monitoring a step further and
lets you monitor everything at once, complete with handy
UI.
AVD Manager
• It’s unlikely you’d ever want to develop for Android without
some kind of Android device in your possession. However,
one of the biggest challenges for Android devs is 
fragmentation. In other words: it’s not good enough that
your app works on your device, it also needs to work on
10″ and 15″ devices. And it needs to work on devices that
are running older versions of Android or that are very
underpowered.
• This is where the ‘Android Virtual Device’ comes in. This
is essentially an emulator that you can use to mimic the
look and performance of any other Android device, setting
such things as screen size, power and Android version.
AVD Manager
• To use the virtual device though, you first need to build
one by downloading the required components and setting
the specifications as you want them. To do this, navigate
to Tools > Android > AVD Manager.
• You’ll then choose your hardware and choose the Android
platform you want it to run. If the Android version you want
to run hasn’t been downloaded yet, then the option will be
presented next to it.
The SDK Manager
• If you want to target a specific version of Android, or if you
want to create a virtual device running a specific version,
then you are going to need to download the necessary
platform and SDK tools.
• You can do this through the SDK manager, which you’ll
find by selecting Tools > SDK Manager.
• In here, you’ll also be able to find additional resources
such as the Google Glass Development Kit or the Android
Repository which provides you with additional functionality
to use in your app.
Creating signed APKs
• Finally, once you’re done testing your app and you’re ready to
release it into the great wide world, you’ll want to select Build >
Generate Signed APK.
• This will give you the file you’ll need to upload to Google Play and
which will contain all of the various files, resources and more.
• You’ll be prompted to create or enter a Key store.
• This is a kind of ‘certificate of authenticity’ that proves the APK
you’re uploading is the app you’re saying it is.
• This prevents someone from hacking your Google Play account
and then uploading a malicious APK as an ‘update’ to your app!
• You’ll need to keep this file safe, as once it’s lost, there’s no way
to update your app again! Choose ‘release’ as your build type if
you want to make this something that you can release and then
click ‘finish’.
PBL – Review - 1
• PowerPoint presentation about your work is compulsory
• Team Members
• Project Title
• Summary of your project
• Tools used
• What will the output be

You might also like