O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Android Development with Kotlin, Part 3 - Code and App Management

261 visualizações

Publicada em

- Code Management
- Open Source
- Version Control & Git
- App Stores
- Testing Mobile Apps
- Automated Tests
- Visual Studio App Center
- Espresso Test Recorder
- Firebase Test Lab
- Robo Tests
- App Distribution

Publicada em: Tecnologia
  • Hi there! Get Your Professional Job-Winning Resume Here - Check our website! http://bit.ly/resumpro
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • Seja a primeira pessoa a gostar disto

Android Development with Kotlin, Part 3 - Code and App Management

  1. 1. St. Pölten University of Applied SciencesSt. Pölten University of Applied Sciences Platzhalter für möglichen Bildeinsatz Android Development with Kotlin, Part 3 Code & App Management Andreas Jakl Digital Healthcare FH St. Pölten Platzhalter für möglichen Bildeinsatz Version 1.2
  2. 2. Andreas Jakl ▪ Focus areas ▪ AR / VR, mobile apps, sensors, interaction technology, software architecture, open source developer (NFC, Bluetooth Beacons) ▪ Microsoft MVP (Most Valuable Professional) ▪ mobility.builders community: Mobile Developer After-Work Events ▪ Previous Experience ▪ Tieto, Start-up (Mopius), Nokia (Finland), Siemens Mobile (Munich), FH Hagenberg (Mobile Computing) Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten https://www.andreasjakl.com/ @andijakl andreas.jakl@fhstp.ac.at 2
  3. 3. Contents ▪ Code Management ▪ Open Source ▪ Version Control & Git ▪ App Stores ▪ Testing Mobile Apps ▪ Automated Tests ▪ Visual Studio App Center ▪ Espresso Test Recorder ▪ Firebase Test Lab ▪ Robo Tests ▪ App Distribution Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 3
  4. 4. CODE MANAGEMENT Licenses and Collaboration Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 4
  5. 5. Source Code Licenses ▪ Copyright ▪ Automatically applies to code you write ▪ You retain all rights ▪ https://choosealicense.com/no-license/ ▪ Custom License ▪ Provide & sell software under your own terms ▪ Example: Windows 10: https://www.microsoft.com/en- us/Useterms/Retail/Windows/10/UseTerms_Retail_Windows_10_English.htm ▪ But: difficult for other companies to use ▪ Would need to do a legal check of your license ▪ What happens if your company is closed? Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 5 ©
  6. 6. Software Patents ▪ Europe ▪ Source code by itself not patentable (only copyright) ▪ But: broader “computer implemented inventions” that solves a technical problem in a “novel or non-obvious manner” ▪ US ▪ Generally patentable ▪ But do not necessarily “win” if challenged in court and not concrete enough Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 6 Source: https://fsfe.org/campaigns/swpat/swpat.en.html https://en.wikipedia.org/wiki/Software_patents_under_the_European_Patent_Convention https://www.epo.org/news-issues/issues/software.html https://en.wikipedia.org/wiki/Software_patents_under_United_States_patent_law
  7. 7. Open Source ▪ Software must be: ▪ Freely used ▪ Modified ▪ Shared ▪ Licenses ▪ Approved licenses by OSI: https://opensource.org/licenses ▪ Choose a license: https://choosealicense.com/ ▪ Most popular: GPL, Apache, MIT Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 7 Image source: Open Source Initiative by Simon Phipps, CC BY 2.5 https://en.wikipedia.org/wiki/File:Opensource.svg
  8. 8. Version Control & Collaboration ▪ Advantages ▪ Teams & Collaboration ▪ Tracking changes & history ▪ Branches for stable release + development ▪ Most popular: ▪ Git Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 8Source: https://www.openhub.net/repositories/compare
  9. 9. Git Basics ▪ Store finished changes with “commit”s ▪ Default “Master” branch for main version ▪ “HEAD” = current version Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 9 commit commit commit HEAD of master branch
  10. 10. Git Basics Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 10 working directory index (stage) HEAD add commit Some Git clients simplify and do this in one step
  11. 11. Git Basics Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 11 working directory index (stage) HEAD add commit your PC server HEAD push pull
  12. 12. Using GIT ▪ GIT Tools ▪ Windows, Mac, Linux ▪ Optional: more powerful user interfaces ▪ TortoiseGit – great Windows Explorer integration: https://tortoisegit.org/ ▪ GitHub Desktop – https://desktop.github.com/ Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 12
  13. 13. Hosting GIT Repositories ▪ Online services for collaboration ▪ GitHub: free for open source projects ▪ GitLab: install GIT on own server (free) ▪ Visual Studio Team Services ▪ Free for 5 users + MSDN subscribers, also for closed source projects ▪ Includes agile project planning, DevOps (automated testing & deployment) ▪ https://www.visualstudio.com/team-services/ Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 13
  14. 14. Create / Clone Git Repository Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 14
  15. 15. Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 15 Git versioning: History, contributors & changes (GitHub Desktop app)
  16. 16. Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 16 Git versioning: Reviewing your code changes before committing (GitHub Desktop app)
  17. 17. APPS & USER EXPERIENCE How to bring the technology to your customers? Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 17
  18. 18. App Stores Are Merciless Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 18
  19. 19. Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 19 Source: App Annie, Record Levels of App Downloads & App Store Consumer Spend in Q4 2017 https://www.appannie.com/en/insights/market-data/app-downloads-consumer-spend-q4-2017/
  20. 20. Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 20 Source: App Annie, Record Levels of App Downloads & App Store Consumer Spend in Q4 2017 https://www.appannie.com/en/insights/market-data/app-downloads-consumer-spend-q4-2017/
  21. 21. „Within 3 days, an app loses 77% of its users“ @andrewchen New data shows losing 80% of mobile users is normal, and why the best apps do better http://andrewchen.co/new-data-shows-why-losing-80-of-your-mobile-users-is-normal-and-that-the-best-apps-do-much-better/Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 21
  22. 22. Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 22 Source: Android, & Apple, & Google, & Microsoft, & AppBrain, & BlackBerry, & Various sources (WindowsCentral.com, & International Games Week Berlin), & Amazon, & VentureBeat, & CNET. (n.d.). Number of apps available in leading app stores as of March 2017. In Statista - The Statistics Portal. Retrieved January 27, 2018, from https://www.statista.com/statistics/276623/number-of-apps-available-in-leading-app-stores/.
  23. 23. Flurry: Enter the Matrix: App Retention and Engagement http://flurrymobile.tumblr.com/post/144245637325/appmatrixAndroid Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 23
  24. 24. Your Fate lies in the Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 24
  25. 25. App Reviews Bin Lu, et al.: Why People Hate Your App – Making Sense of User Feedback in a Mobile App Store. Carnegie Mellon University, 2013. Data from 13 million user reviews, 171,439 apps Claudia Iacob, Rachel Harrison: “Retrieving and Analysing Mobile Apps Feature Requests from Online Reviews”, Oxford Brookes University, 2013 Kahlid. H, et al.: “What Do Mobile App Users Complain About? A Study on Free iOS Apps”, Queen’s University, Kingston, 2014 Gunwoong Leea, T. S. Raghua: “Determinants of Mobile Apps' Success: Evidence from the App Store Market”, 2014 0 2 000 000 4 000 000 6 000 000 8 000 000 Downloads Negative reviews Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten25
  26. 26. Reviews vs Downloads Review count & rating correlate to downloads Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 26 Bin Lu, et al.: Why People Hate Your App – Making Sense of User Feedback in a Mobile App Store. Carnegie Mellon University, 2013 Data from 13 million user reviews, 171,439 apps Average rating: 3.9 (standard deviation: 1.48) 0 2 000 000 4 000 000 6 000 000 8 000 000
  27. 27. Review Analysis ▪ Analysis ▪ Most frequent complaints ▪ Functional errors ▪ Feature requests ▪ App crashes Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 27 Claudia Iacob, Rachel Harrison: “Retrieving and Analysing Mobile Apps Feature Requests from Online Reviews”, Oxford Brookes University, 2013 Kahlid. H, et al.: “What Do Mobile App Users Complain About? A Study on Free iOS Apps”, Queen’s University, Kingston, 2014 Gunwoong Leea, T. S. Raghua: “Determinants of Mobile Apps' Success: Evidence from the App Store Market”, 2014
  28. 28. Review Analysis ▪ Analysis ▪ Most negative impact ▪ Privacy and ethical issues ▪ Hidden app costs Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 28 Claudia Iacob, Rachel Harrison: “Retrieving and Analysing Mobile Apps Feature Requests from Online Reviews”, Oxford Brookes University, 2013 Kahlid. H, et al.: “What Do Mobile App Users Complain About? A Study on Free iOS Apps”, Queen’s University, Kingston, 2014 Gunwoong Leea, T. S. Raghua: “Determinants of Mobile Apps' Success: Evidence from the App Store Market”, 2014
  29. 29. TESTING STRATEGIES Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 29
  30. 30. Thousands of Mobile Devices in Use http://opensignal.com/reports/2015/08/android-fragmentation/ http://stats.unity3d.com/mobile/device-ios.html OpenSignal: 24,000 distinct Android devices used their app in 2015 Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 30
  31. 31. Capturing Crash Data Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 31
  32. 32. Monitoring Reviews Bin Lu, et al.: Why People Hate Your App – Making Sense of User Feedback in a Mobile App Store. Carnegie Mellon University, 2013 Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 32
  33. 33. Static Code Analysis Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 33
  34. 34. Emulator / Simulator Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 34 Emulator Emulates real hardware + more accurate – slow Android Simulator Simulates device behavior + faster – less accurate iOS / Windows
  35. 35. Reliable? Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 35 0%of your users will run your app on an emulator
  36. 36. Automated UI Tests Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 36 How many tests can you run per hour / build / release?
  37. 37. Automated UI Tests Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 37 Number of builds Cost Automated tests Manual tests
  38. 38. Own Devices Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 38 How many test devices do you have?
  39. 39. Visual Studio App Center ▪ Automated tests ▪ UI interaction ▪ Device features (GPS, etc) ▪ Performance ▪ 3,300+ devices ▪ Android & iOS ▪ http://appcenter.ms/signup Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 39
  40. 40. Workflow Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 40
  41. 41. + Continuous Integration Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 41
  42. 42. Executing Tests Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 42
  43. 43. Android App Testing ▪ Local JUnit test (test) ▪ Minimize execution time ▪ No Android framework dependencies ▪ Instrumented test, runs on device (androidTest) ▪ Lets you control your running app ▪ Automate user interaction (UI tests) ▪ Overview: https://developer.android.com/studio/test/index.html Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 43
  44. 44. Exercise: Espresso Test Recorder ▪ Open HelloWorld or GreetingApp solution project ▪ Record UI interactions ▪ Run > Record Espresso Test ▪ Execute tests: ▪ Right-click MainActivityTest > Run ▪ Further steps ▪ Change app so that it fails the test ▪ Add EditText to app, test entering text ▪ Update TextView with user-entered text ▪ Manually extend test script to check if user-entered text appears ▪ https://developer.android.com/studio/test/espresso-test-recorder.html Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 44
  45. 45. Firebase Test Lab ▪ Real devices in Google data center ▪ https://firebase.google.com/docs/test-lab/ ▪ Robo test ▪ Explores UI structure ▪ Automatically simulates user activities ▪ Optional: robo scripts for more control ▪ Scripted tests ▪ Using Espresso ▪ Reports ▪ Video, screenshots, device logs, performance, crash logs Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 45 Image credits: Google, https://firebase.google.com/docs/test-lab/
  46. 46. Exercise: Run Tests in the Cloud ▪ Tools > Firebase > Test Lab > Run Firebase Test Lab for Android ▪ Connect your app to Firebase ▪ Billing plan ▪ Spark = free: daily quota, 10 virtual tests / day, 5 physical tests / day ▪ Run test configuration Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 46
  47. 47. Exercise: Firebase Console ▪ Check test report: Firebase console Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 47
  48. 48. Exercise: Robo Test ▪ Run Robo test from Firebase Console ▪ Upload APK: ▪ <project>appbuildoutputsapkdebug Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 48
  49. 49. Developing & Maintaining Apps is a Challenge! Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 49
  50. 50. App Purge Apple: - Purged 47,300 apps in October 2016 (14,000 apps / month purged on average) - 2017: 180,000+ apps not compatible with iOS 11 (64 bit now required) Sensor Tower: Worldwide iOS App Store App Removals Increased 238% in October https://sensortower.com/blog/app-store-purge Nearly 200,000 Current Apps Could Be Incompatible with iOS 11 https://sensortower.com/blog/ios-11-incompatible-apps Dr. Windows: Bereinigung des Windows Store noch nicht abgeschlossen - nur noch ein Drittel aller Apps übrig http://www.drwindows.de/content/11332-bereinigung-windows-store-noch-abgeschlossen-nur-noch.html Google Android Developers Blog: How we fought bad apps and malicious developers in 2017 https://android-developers.googleblog.com/2018/01/how-we-fought-bad-apps-and-malicious.html Microsoft: - 2/3 of all apps purged between Oct – Nov 2016 (330k -> 125k) … but we still have 3 million apps only for the iPhone. Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten Google: - 2017: took down 700,000 apps that violated Google Play policies 50
  51. 51. How to Survive. Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 51
  52. 52. There is Hope! Tune: No, Americans do not install an average of zero apps per month https://www.tune.com/blog/no-the-average-american-does-not-download-0-apps-each-month/ The true number ist most likely even higher: 2 – 3 app installs / month Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 52
  53. 53. APP DISTRIBUTION Payments, Fees and Certificates Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 53
  54. 54. App Store Overview Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 54Source: https://en.wikipedia.org/wiki/List_of_mobile_app_distribution_platforms Apps 2,800,000 2,200,000 669,000 600,000 Fee $25 (1x) $99 / year $0 (1x, student) $19 (1x, individual) $99 (1x, company) $0 Cut per sale (from net) 70% 56 – 71% (depends on country) 70% (85% for app subscriptions) 70%
  55. 55. Google Play Store ▪ Prerequisites: ▪ Google Account ▪ Credit card ($25 fee) ▪ Sign-Up: ▪ Developer name ▪ Email Address ▪ Website ▪ Phone Number ▪ Instant activation ▪ Optional further steps ▪ Invite Co-Workers ▪ Set up merchant account for paid apps Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 55
  56. 56. Quality Guidelines ▪ Checklist ▪ Quality criteria & associated tests ▪ Work through tests, especially for 1st app ▪ https://developer.android.com/develop/quality- guidelines/index.html Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 56
  57. 57. App Signing ▪ All APKs digitally signed ▪ Android Studio: Debug certificate ▪ Automatically generated: C:Users<name>.androiddebug.keystore ▪ Not trusted for publishing to the Play Store ▪ Certificate valid for 365 days ▪ https://developer.android.com/studio/publish/app-signing.html Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 57
  58. 58. App Publishing ▪ App signing key ▪ Needed for updates! ▪ Google Play App Signing OR manual app signing ▪ https://support.google.com/googleplay/android-developer/answer/7384423 Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 58
  59. 59. THANK YOU! Android Development with Kotlin, Part 3 | 2018 | Andreas Jakl | FH St. Pölten 59

×