more android
play

More Android 1 How hard was week 9 code review assignment? A) - PowerPoint PPT Presentation

More Android 1 How hard was week 9 code review assignment? A) Easy B) Moderate C) Challenging D) Unreasonable 2 How long did week 9 assignment take? A) Less than 2 hours


  1. More ¡Android ¡ 1

  2. How ¡hard ¡was ¡week ¡9 ¡code ¡review ¡assignment? ¡ A) ¡Easy ¡ B) ¡Moderate ¡ C) ¡Challenging ¡ D) ¡Unreasonable ¡ 2

  3. How ¡long ¡did ¡week ¡9 ¡assignment ¡take? ¡ ¡ A) ¡Less ¡than ¡2 ¡hours ¡ B) ¡2 ¡to ¡4 ¡hours ¡ C) ¡4 ¡to ¡6 ¡hours ¡ D) ¡6 ¡to ¡8 ¡hours ¡ E) ¡More ¡than ¡8 ¡hours ¡ 3

  4. Unix ¡ � wc ¡ ¡ ¡-­‑-­‑ ¡“word ¡count” ¡ � grep ¡– ¡“search ¡files ¡for ¡parNcular ¡strings” ¡ � find ¡– ¡“idenNfy ¡files ¡with ¡matching ¡names” ¡ 4

  5. TesNng ¡ � Two ¡kinds ¡of ¡tests ¡for ¡Android ¡Projects: ¡ � Normal ¡non-­‑UI ¡tests ¡(‘test’ ¡directory) ¡ � Just ¡use ¡Junit ¡as ¡normal ¡ � User ¡Interface ¡tests ¡(‘androidTest’ ¡directory) ¡ � Use ¡Espresso ¡ 5

  6. Which ¡is ¡not ¡an ¡Android ¡logging ¡level ¡ A) ¡ERROR ¡ B) ¡DEBUG ¡ C) ¡WTF ¡ D) ¡VERBOSE ¡ E) ¡All ¡of ¡the ¡above ¡are ¡valid ¡ 6

  7. Logging ¡ � Dump ¡messages ¡to ¡the ¡log; ¡see ¡with ¡Android ¡Monitor ¡ � Log ¡messages ¡have: ¡ � Priority ¡(ERROR, ¡WARN, ¡INFO, ¡DEBUG, ¡VERBOSE) ¡ � Tag ¡ � Message ¡ � Usage: ¡ ¡(use ¡logd ¡shortcut) ¡ private final static String TAG = ClassName.class.getSimpleName(); 
 Log. d (TAG, “functionName: your message here"); 
 7

  8. What ¡is ¡going ¡to ¡happen? ¡ A) ¡Success ¡ B) ¡Fail ¡– ¡Networking ¡on ¡main ¡thread ¡excepNon ¡ C) ¡Fail ¡– ¡Didn’t ¡iniNalize ¡networking ¡library ¡ D) ¡Fail ¡– ¡Don’t ¡have ¡permission ¡to ¡access ¡network ¡ E) ¡Fail ¡– ¡Can’t ¡translate ¡URL ¡to ¡IP ¡address ¡ 8

  9. Android ¡Permission ¡Model ¡ � Users ¡don’t ¡want ¡apps ¡to ¡violate ¡their ¡privacy ¡ � Users ¡grant ¡apps ¡permission ¡to ¡do ¡things ¡ � Access ¡the ¡network, ¡camera, ¡calendar, ¡phone ¡book, ¡etc. ¡ � Historically, ¡these ¡have ¡been ¡granted ¡at ¡install ¡Rme ¡ � All ¡or ¡nothing ¡model ¡ � StarNng ¡in ¡Marshmallow, ¡incremental ¡permission ¡model ¡ � Request ¡“mandatory” ¡permissions ¡at ¡install ¡Rme ¡ � Request ¡other ¡permissions ¡as ¡needed ¡(for ¡clarity) ¡ � Allow ¡users ¡to ¡revoke ¡permissions ¡ � App ¡must ¡check ¡permissions ¡before ¡doing ¡controlled ¡things. ¡ 9

  10. Threads ¡ � When ¡you ¡write ¡code, ¡you ¡tell ¡the ¡machine ¡what ¡to ¡do ¡ � One ¡thing ¡at ¡a ¡Rme. ¡ � Hard/bad ¡to ¡interleave ¡mulNple ¡things ¡ ¡ � E.g., ¡a ¡user ¡interface ¡with ¡long ¡latency ¡tasks ¡ 10

  11. Threads, ¡cont. ¡ � Computer ¡programs ¡are ¡made ¡up ¡of ¡threads ¡ � Each ¡thread: ¡ � Performs ¡a ¡series ¡of ¡task ¡ � In ¡the ¡order ¡specified ¡by ¡the ¡code ¡ � One ¡at ¡a ¡Rme ¡ � Hard/bad ¡to ¡interleave ¡mulNple ¡things ¡on ¡a ¡single ¡thread ¡ � E.g., ¡a ¡user ¡interface ¡with ¡long ¡latency ¡tasks ¡ � SoluNon: ¡use ¡mulNple ¡threads; ¡dedicate ¡a ¡thread ¡to ¡the ¡UI ¡ � So ¡it ¡is ¡always ¡responsive ¡ � Do ¡slow ¡stuff ¡on ¡other ¡threads ¡ � Have ¡to ¡handle ¡communicaRon/synch ¡between ¡threads ¡ 11

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend