23
Mobile Programming Sharif University of Technology Spring 2016 Lecture 1 Omid Jafarinezhad

Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

MobileProgramming

Sharif University of Technology

Spring 2016

Lecture 1

Omid Jafarinezhad

Page 2: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

AndroiD and IOS

Page 3: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Apps, apps, and more apps

Page 4: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,
Page 5: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,
Page 6: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,
Page 7: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Common app views – Login, Register

Page 8: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Common app views – Stream, Detail

Page 9: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Common app views – Creation, Settings

Page 10: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Common app views – Maps

Page 11: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

AndroiD

Page 12: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Mobile app architecture

Views

Controllers Models

Networking Authentication

OS FoundationsUI Core, Event Loop, System Components

Device HardwareGPS, Accelerometer, Bluetooth

Page 13: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Views, controllers and models

Views (objects) Controllers (objects) Models (objects)

Page 14: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

The Android Framework

Page 15: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

What's in an app: application components

• Activities: An activity is the key execution component. You need at least oneactivity in an app that deals with the UI but you probably will have multiple activity.

• Fragments: Fragments are new to Android but very important in programming the UI. I think of

them as mini-activities.

• Services: Typically services are long running programs that don't need tointeract with the UI. Examples of services could be listening to music, updating the location -- say for a map activity/fragment. Typically an activity will control a service -- that is, start it, pauseit, bind and get data from it.

• Content providers: Apps share data. The nice thing about Android is you can not only callinternal apps such as the camera but you can get data from apps that you might need for yourapplication.

• Broadcast receivers: If an service has data it can initiate broadcasts (something like ``I gotthe location for anyone interested''). The other end of that are components (e.g., an activity) thatare broadcast receivers.

Page 16: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

App execution

Page 17: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Android Development Tools

• The Android Software Development Kit (Android SDK)contains the necessary tools to create, compile andpackage Android applications.

• The Android SDK contains the Android debug bridge (adb),which is a tool that allows you to connect to a virtual or realAndroid device, for the purpose of managing the device ordebugging your application.

• The Android SDK contains a tool called dx which convertsJava class files into a .dex (Dalvik Executable) file.

• The Android tooling uses Gradle as build system.

Page 18: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Android Development Tools

• Android Studio includes a debugging toolcalled the Dalvik Debug Monitor Server(DDMS), which provides port-forwardingservices, screen capture on the device, threadand heap information on the device, logcat,process, and radio state information, incomingcall and SMS spoofing, location data spoofing,and more.

Page 19: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,
Page 20: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Android Development Tools

• Android requires that all apps be digitally signed with a certificate before they can be installed. Android uses this certificate to identify the author of an app, and the certificate does not need to be signed by a certificate authority. Android apps often use self-signed certificates. The app developer holds the certificate's private key.

Page 21: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Android IDE (integrated development environment)

• Android Studio • Eclipse + ADT Plugin• IntelliJ IDEA

• What are the main differences?– Build Tools– Code Completion/Refactoring– User Interface Design– Project Organization– IDE Performance/Stability

Page 22: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Homework 1

• What is the exact difference between

– User Experience (UX),

– Usability, and

– User Interface (UI)?

Page 23: Mobile Programming - ce.sharif.educe.sharif.edu/courses/94-95/2/ce327-1/resources/root/Lecture Notes/… · interact with the UI. Examples of services could be listening to music,

Course workload

• Programming Assignments : 4 pts

• Final App: 4 pts

• Research Assignments : 2 pts

• Midterm Exam: 5 pts

• Final Exam: 6 pts