Wroclaw University of Technology  –  Faculty of Electronics  –  Internet Engineering

"Application Programming: Mobile Computing"
  INEA00112  LABORATORY   '2016

Time           Tuesday 17:05-18:45
Place:         Laboratory L.2.3 / C-16
Instructor :   Marek Piasecki
Tutor.hrs :   Monday 15:00-17:00,  Tuesday 11:00-13:00,  room: 321/C-3

Assessment of Students' Solutions:

Laboratory Tasks:



Laboratory (A0)  -  ANDROID - Introduction, Android Studio configuration
Getting familiar with Android platform and its Integrated Development Environment.
  1. Download Main reading: chapter 2 and 3  from
    free Techotopia ebook  "Android Studio Development Essentials"
  2. Follow instructions from chapter 2 to configure Android Studio environment
  3. Use SDK Manager to check/install/uninstall  Android SDK ( platform, samples, tools, documentation, etc.) for selected API version
  4. Use Virtual Device Manager to create Android Emulator for API level (version) installed in the exercise (c)
  5. Follow instructions from chapter 3 to test the proces of creation / building / running sample "Blank Activity" application. Utilize virtual device created in exercise (d).
  6. Use Device Monitor (DDMS) and its windows: Devices, FileExplorer, Emulator control and LogCat, to explore the state of emulator and test your sample application.

Archival materials for Eclipse IDE:

 
Laboratory (A1.a)   -  ANDROID  - Understand Activity Life Cycle.
Download, unpack and import example 03-1-LifeCycleDemo (Eclipse project)
from V.Matos archives, or try to create your own version of such Android application, signaling changes of internal state through notifying Toasts e.g.
      Toast.makeText(this, "onCreate", 1).show();
implemented for all following events:  onCreate, onStart, onResume,
onSaveInstanceState, onPause, onStop, onDestroy, onRestart.

Hint:
This task could be simplified with the use of
       Code > Override Methods…        (shortcut: Ctrl+O)
option from the Android Studio’s top menu.
(sort by percent of classes which override the method)

Observe and note the sequence of messages displayed by the Toast-commands after:
  1. Click on application FINISH button
  2. Click on the emulator’s HOME button
  3. Click on the emulator’s CALL ( Green phone)
  4. Long press on the emulator’s HANG-UP button
  5. Receiving a text-message from other emulator
  6. Making a voice-call from other emulator.
Every time, return to the same "running" state, through clicking on device's launch pad,
and selecting your application icon.

Supplementary reading:
       - Android Application's Life Cycle 
   
 
Laboratory (A1.b)   -   ANDROID - Creating example Currency Converter app.
  1. Follow instructions from lecture slides Android Devlopment Introduction  (pg.32-39)
    to create new Android project and implement single activity "Currency Converter".

  2. Use the AndroidMonitor view (Alt+6), or separate Dalvik Debug Monitor Server  (DDMS) tool, to test and debug internal state of emulator and your Currency Converter application. Utilise the control printouts generated by instructions:
           Log.i( "TAG_for_filtering", "Example message" );
    to visualise the flow of the program execution in the LogCat window.
 

Laboratory (A2)  -  ANDROID - Experiments with UI design
Create single screen/activity application demonstrating the use of:  Layouts, Widgets, and Menu components to compose the user interface:
  1. Implement a program demonstrating various possibilities for changes in the color, size and font style (of the displayed TextView content), as a result of pressing different buttons or selecting various menu options.
  2. Create your implementation of a general-purpose mathematical calculator.
  3. Develop some kind of multiple-choice e-learning application, that supports memorizing the correlation of predefined number of word-pairs, in two different languages (e.g. Polish and English)
Supplementary readings:
  - Lesson 4: Graphical User Interfaces (Victor Matos)
  - Using ConstraintLayout to design your views (Google Developers CodeLabs)


Laboratory (A3)  -   ANDROID -   Intents and multi-screen apps
Create a multi-activity application demonstrating the use of Android's Intents
to start another activity or build-in Intent handlers (platform provided applications) like: Contacts, Phone Dialer, Web Browser, Google Map, etc:
  1. display the phone contacts list (and optionally receive the data of the selected contact),
  2. send an SMS message to selected receiver,
  3. display google map of the place with the given geographic coordinates (latitude/longitude),
  4. display an “About” screen and return the data bundle containing student's name, email and the version number of the application.
At least one of sub-activities have to be self-made by the student.
At least one of them must return back some results to the launching code.

Supplementary readings:
  - Lesson 10: Android Intents (by Victor Matos)
  - Android Intents - Tutorial (by Lars Vogel)
  - Retrieving Details for a Contact


Laboratory (A4)  -   ANDROID  -  Telephony API
Create "TelephonyDemo" application which provides options for:
  1. Gather basic information about the phone state (CallState, PhoneType, NetworkType, subscriber SIM ID, etc) 
    documentation:  [Listing 7.1]  ,  android.telephony.TelephonyManager
  2. Block all outgoing voice calls to specified phone number
    documentation:  [Listing 7.6]
  3. React to an incoming SMS, automatically sending back another SMS with the name of student (and phone position?) added to the message body.
    documentation:  [Listing 7.7 and 7.8] ,  android.telephony.SmsManager
  4. Monitor / listen to phone state changes (ie. the availability of data connection or changes of signal strength)
    documentation:  [Listing 7.2] ,  android.telephony.PhoneStateListener
Supplementary reading:
  - Chapter 7. Telephony API  - example chapter from book "Android in Action"
  - Requesting Permissions at Run Time - how to solve the permission denied error
    (in API / targetSdkVersion of 23 or higher)

Android

Laboratory (A_Project)  -   ANDROID -  advanced application
  • Theme of final Android project may be proposed by student.

  • Each student selects at least two of mobile technology aspects
    (which are not included in laboratories A0 - A4):
    1. mobile database (SQLite)
    2. built-in smartphone sensors: accelerometer, gyroscope, magnetometer, gps
    3. networking, data synchronization or web services
    4. 3D graphics or animation on mobile device
    5. Bluetooth communication between mobile devices
    6.  . . . ?
  • Students use the period of three laboratories assigned to this project,
    to create entirely individual mobile application,
    that demonstrates selected technology aspects.

  • The application should have a user interface of some (non-trivial) complexity.
    At least three Windows/Activities/Fragments/Tabs are expected.





iOS

Archival laboratory '2015: "Programming iOS 7 in Objective-C" ►

Current laboratory schedule: "Programming iOS 10 in Swift 3.0"  ▼

Laboratory ( i1 )  -  iOS Intro, development environment, startup application
Getting familiar with Apple iOS10 mobile platform and XCode8 IDE:
  1. Use instructions from Techotopia ebook/tutorial
    Chapter 16. Creating an Interactive iOS 10 App
    to create new iOS project and implement single screen "Currency Converter"

  2. Use iPhone emulator and XCode tools to test and debug your application.

  3. Rebuild and expand this first "converter" program to the form of a general-purpose mathematical calculator (analogous to the calculator made ​​for the Android platform).
      
  4. Students who don't know the Mac OS and XCode IDE environment,
    may start learning from Chapter 4. A Guided Tour of Xcode 8
    which provides a brief introduction: how to create a new project, how graphically design a user interface, and finally, how to test iOS app on the iPhone emulator.
Supplementary materials:
  - Lecture 1 - Introduction to iOS 10, Xcode 8 and Swift 3 - video on YouTube,
  - Lecture 2 - MVC, iOS, Xcode - demonstration - based on materials from the
     Stanford University CS193P course "Developing iOS 10 Apps with Swift"

  - On line Swift 3.1 documentation
     or local copy of  "Swift 3.0 programming language" PDF handbook.

  - Techotopia - iOS 10 App Development Essentials (with Swift 3),


Archival resources:
  - Techotopia - iOS 9 App Development Essentials (with Swift 2.2),
  - PDF presentation: Walkthrough iOS 5



Laboratory ( i2 )  -  iOS - ViewController life cycle, Segues in Storyboard
  1. Study the concept of ViewController in iOS Model-View-Controller architecture:
    CS193p - Lecture 6 - View Controller Life cycle slides
    (and accompanying video , the lifecycle discussion starts from minute 42.30)

    Implement basic "life cycle" methods (e.g. viewDidLoad, viewWill/DidAppear, viewWill/DidDisappear, willRotateToInterfaceOrientation, ..., etc)
    for main ViewController in Converter/Calculator application created during the laboratory ( i1 )

    Use print(...) function to display debug information visualising the sequence of ViewController life cycle events (in similar manner like Toast or Log.i for visualising Android Activity lifecycle in laboratory A1). 

  2. Get familiar with the method of visual composition of Segues between sequence of windows (ViewControllers) in multi-screen iOS application:
    Techotopia - Chapter 24 - Using Storyboards and Segues in XCode 8

    Analyse the example "Psychologist" application
    (created as demo for archival "Lecture 6: Multiple MVCs and Segues" from year 2011
    - watch last 25 minutes of this video , starting from minute 44)
    Create similar "StudyAdvisor" application, which will assist in the choice of the  field/speciality of study at our Faculty of Electronics.
    (using questions like: Are you more interested in computer hardware or software?
    What is your favourite programming language: Java, C++, Asembler? , etc.)    


Laboratory ( i3 )  -  TableViewController, Master-Detail programming pattern
  1. Study the concept of UITableView and TableViewController in iOS architecture:
      - simple introductory tutorial - Introducing Table Views in Swift 3
      - Stanford slides CS193p - Lecture 9 - Table View  (or video 1h 30min)
    More advanced Apple Developer tutorials:
      - Working with Table Views (master TableView)
      - Implementing Navigation  (connect with detail Meal sub-View)

  2. Create your version of Master-Detail application which utilize master TableViewController to display a brief list of example data items (cars, animals, ...)
    and detail ViewController to present more precise information about selected item.

    The default theme could be application presenting a brief list all specialities at our Faculty of Electronics and related detail information about selected speciality.

    Depending on your preferences, you can use  Static_Cells  for predefined fixed list of items, or Dynamic_Prototypes for variable number of items
    (e.g. loaded from a mutable array or database).
Supplementary materials:




Windows Phone7.x / 8.x
Windows 10 Mobile

Archival laboratory schedule '2015:  "Programming Windows Phone 7.0 / 7.5 / 7.8"
 Archival laboratory schedule '2016:  "Programming Windows Phone 8.1"

Current (updated 2017) laboratory schedule for programming Windows Mobile 10
     using UWP
(
Universal Windows Platform)

Laboratory (W1)  -  Windows 10 Mobile - Introduction, IDE, application lifecycle
Homework / preparation for the lab:
As part of the preparation for the first Windows Mobile lab, watch the introductory presentations from the Microsoft portal Get started with Windows apps
and step by step tutorial, explaining how to create simple UWP application:

Task to do in the laboratory:
Practical programming exercises in Visual Studio 2015 (or newer version 2017).
Getting familiar with the possibilities of creating applications for mobile devices using the Universal Windows Platform:
  1. Use tips from (above) homework materials, to write your own "Currency Converter" application, with similar functionality like the Android Currency Converter application (from Android A2 lab)

  2. Or alternatively (in a more advanced version), instead of a simple currency converter, you can implement a mathematical calculator similar to the "Android calculator with history", made in the laboratory A3.
Auxiliary materials for laboratory:


Laboratory (W2)    Adaptive User Intarface, Pages and Navigation
  1. Based on suggestions from below listed free-ebook chapters:
    UWP-008 - XAML Layout with Grids
    UWP-009 - XAML Layout with StackPanel
    UWP-017 - XAML Layout with RelativePanel
    expand "converter" program, from the first laboratory (W1), to the form of a general-purpose mathematical calculator which adaptively resize its interface for different devices (analogous to the calculator made ​​for the Android platform).

    Implement interface changes for at least three different frame sizes or orientations.
    For more information on interface adaptability for different screen sizes, orientations
    and for different devices, see sections:
       UWP-037 - Utilizing the VisualStateManager to Create Adaptive Triggers
       UWP-038 - Working with Adaptive Layout
       UWP-039 - Adaptive Layout with Device Specific Views
    from below listed UWP ebook  (chapter 37 starts at page 189).
     
     
  2. Study the chapter UWP-019-Working with Navigation and create simple application which contains at least three pages and buttons which enable skipping from one page to another.
Supplementary materials:


Laboratory (W3)    Application distribution through Windows App Store
  1. Study the instructions:
      - chapter from Beginners book UWP-056 - Submitting to the Windows Store
      - Developers Guide to Windows  10 - Submit App PPTx slides (or video 57min)
    demonstrating how to:
      - use Windows Dev Center dashboard to prepare and submit your application
        to Windows App Store.
      - make your app available to beta testers on Windows 10 devices

  2. Register as an app developer and use DevCenter dashboard
    to upload one of your self-developed (during previous laboratories)
    Windows 10 Mobile application to Windows App Store.
    Finalize the application submission and approval process by sending the link (to your app beta testing / targeted distribution page in Windows Store) to laboratory instructor.


    Students Hint:
      - Windows Store registration with student code obtained from Microsoft Imagine