CEG 3900: 2017 Spring Midterm

80 minutes 100 points Weight 20%

Use your Linux/Windows laptop while answering. You are welcome to use IdeaJ, and Android Studio + SDK tools, but not websites. Apart from these, this is a closed book, closed notes exam. Do not give or take help during the exam. In particular, you are honor bound not to Internet surf or access any content already existing (other than as indicated) once you access the exam until you turnin the mt-answers.pdf and other files. Please leave wide margins in the pdf. All submissions are to be done in the MidTerm dropbox on Pilot.

1 Part I

(5 points each) The following statements may or may not be (fully or partially) valid. First, explain the underlined technical term(s). Then, explain/ discuss/ dispute the statement. It is possible to write, say, five, sentences each, and yet receive full score.

  1. An Android Activity always runs in the background.
  2. There cannot be an Android APK that does not include the AndroidManifest.xml file.
  3. Every Android app must connect with a cloud service.
  4. A client runs on the Android device, and a server runs on the PC.

2 Part II

(40 points) Develop the following APK using Android Studio. It is being done in the "exam environment", and many imperfections will be forgiven.

  1. Here is a link to the code of Eeny Meeny Miny Moe threads that we discussed in the lectures. Turn this into a proper Android APK, with mods as follows. There are several numbers in the main method: 500, 100, 200, 300, 5000. In the app, they should be in the "settings". Replace the System.out.println() with four rectangular areas one for each thread showing the value of int i. Submit the APK and the source code bundle.

3 Part III

(10 points each) Answer the following, at the level of Android app development details, Android internals, etc.

  1. Here is a link to ./anUnknown.apk. What activities does it have? How did you discover? What is the best way to discover these?
  2. Write the equivalent of Compute, using Java-8 stream, map and reduce, and without using loops.
    List <Integer> a = Arrays . asList (45, 56, 67, 78, 89);
    List <Integer> b = Arrays . asList (22, 44, 55, 66, 77);
    int Compute() {
      int r = 0;
      for (int i = a.length; i > 0; i--) {
        r += a[i] * b[i];
      return r;
  3. Give the pre-condition (assertion) of Compute above as Java assert.
  4. Make a simple APK out of the Compute above. Introduce the app in the first screen. In subsequent screens, interactively obtain the lists for a and b. After an OK, invoke Compute(), and show r, the result. Submit the APK and the source code bundle.

4 Part IV

  1. (0 points) [For survey purposes only.] Please record your effort, in minutes, for each of the above items. Other feedback you wish to give is also welcome.

5 End

Copyright © 2017 www.wright.edu/~pmateti • 2017-03-08