35
CWC Grooming Session: Android

Grooming Session Android CWC

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Grooming Session Android CWC

CWC Grooming Session: Android

Page 2: Grooming Session Android CWC

Outline

Problem Set for CWCJudgment CriteriaPragmatic Practices in Android Development

Some Dos and Don’tsUX Design Fundamentals

Designing for PerformanceDesigning for ResponsivenessSupporting Multiple ScreensLocation Based Services

UI Design PatternsTesting

Page 3: Grooming Session Android CWC

Problem SetA courier service company wants to give its delivery employees ability to perform deliveries easily and enable them to do on site reporting quickly. In order to solve this problem, they want to have an Android application which will be delivered to designated employees.

The key features of the app would be to

1. See the tasks assigned to an employee2. See the delivery locations on Maps3. View task details of a delivery item with associated location information

and recipient phone number.4. After a successful delivery the details are emailed or synchronized with

server and task lists are auto updated based on that.5. Ability to do any reporting from on site.6. Tracking the performance of an application user through graphical charts

or aided system.

Page 4: Grooming Session Android CWC
Page 5: Grooming Session Android CWC

Problem SetRequired Features of Android (For your preparation)

1. Location Based Service2. Consuming Web Services3. Integrating Maps Library4. Using SQLite Database5. Unit Testing6. Black-Box Testing

Page 6: Grooming Session Android CWC

Battle: Round 11. A codebase and bare bone project along with

requirement specification will be provided to each group over online repository on 20th January

2. You have to implement the unimplemented features of the specification

3. You will also have to improve the given source code4. During round 1 of the battle you’ll be given 3-4

assignments on your project5. Your deliverables of round 1 of the battle will be

judged with the following criteria

Page 7: Grooming Session Android CWC

Judgment Criteria 1. User Experience Design2. Efficient handling of multiple screen sizes3. Power efficient design4. Database design5. Unit Testing6. Black-Box Testing7. Quick integration with open source components8. Application of Object oriented principles and design

patterns

Page 8: Grooming Session Android CWC

Pragmatic Practices: Some Dos and Don’ts

Page 9: Grooming Session Android CWC

Some DON’Ts (1)

SLOTHBe Fast, Be Responsive

Golden Rules

Don't do work that you don't need to doDon't allocate memory if you can avoid it

Page 10: Grooming Session Android CWC

Some DON’Ts (1) SLOTHBe Fast, Be Responsive

Optimize judiciouslyAvoid creating objectsUse native methodsPrefer Virtual over InterfacePrefer Static over VirtualAvoid internal setters and gettersDeclare constants finalAvoid float and enumsUse package scope with inner classes

Performance Pointers

Source: http://developer.android.com/guide/practices/design/performance.html

Page 11: Grooming Session Android CWC

Some DON’Ts (1) SLOTHBe Fast, Be Responsive

"Application Not Responding“-ANRRespond to user input within 5 secondsBroadcast Receiver must complete in 10 seconds

Users perceive a lag longer than 100 to 200ms Use Threads and AsyncTasks within Services

Responsiveness

Source: http://developer.android.com/guide/practices/design/responsiveness.html

Page 12: Grooming Session Android CWC

Some DON’Ts (1) SLOTHBe Fast, Be Responsive

Responsiveness

Page 13: Grooming Session Android CWC

Some DON’Ts (2)

GLUTTONYUse System Resources Responsibly

Don'tsDON'T over use WakeLocksDON'T update Widgets too

frequentlyDON'T update your location

unnecessarilyDON'T over use Services

DOsDO use Receivers and Alarms not Services and ThreadsDO let users manage updates

Page 14: Grooming Session Android CWC

Some DON’Ts (2) GLUTTONYUse System Resources Responsibly

What is a WakeLock?

Force the CPU to keep runningForce the screen to stay on (or stay bright)Drains your battery quickly and efficiently

Page 15: Grooming Session Android CWC

Some DON’Ts (2) GLUTTONYUse System Resources Responsibly

Using WakeLock?Do you really need to use one?

Use the minimum level possible PARTIAL_WAKE_LOCK SCREEN_DIM_WAKE_LOCK SCREEN_BRIGHT_WAKE_LOCK FULL_WAKE_LOCK

Release as soon as you canSpecify a timeout

Page 16: Grooming Session Android CWC

Some DON’Ts (3)

HOSTILITYDon’t Fight Your Users

User experience should be your top priorityRespect user expectations for navigating your appDon't hijack the native experienceRespect user preferences

Page 17: Grooming Session Android CWC

Some DON’Ts (3)

HOSTILITYDon’t Fight Your Users

Respect User Expectations For Navigation Flow

The back button should always navigate back through previously seen screensAlways support trackball navigationUnderstand your navigation flow when entry point is a

notification or widgetNavigating between application elements should be easy and intuitive

Page 18: Grooming Session Android CWC

Some DON’Ts (3) HOSTILITYDon’t Fight Your UsersDon’t Hijack The Native Experience

Don't hide the status bar Back button should always navigate through previous screensUse native icons consistently Don't override the menu buttonPut menu options behind the

menu button

Page 19: Grooming Session Android CWC

Some DON’Ts (4)

ARROGANCEDon’t Fight The System

Don't use undocumented APIs. Seriously. Don't use undocumented APIs

Make your app behave consistently with the system

Respect the application lifecycle model

Support both landscape and portrait modes

Don't disable rotation handling

Page 20: Grooming Session Android CWC

Some DON’Ts (5) DISCRIMINATIONDesign For Everyone

Avoid Size Discrimination

Don’t make assumptions about screen size or resolutions

Use Relative Layouts and Device Independent Pixels

Optimize assets for different screen resolutions

Source: http://developer.android.com/guide/practices/screens_support.html

Page 21: Grooming Session Android CWC

Some DON’Ts (5) DISCRIMINATIONDesign For Everyone

Ensure Future Hardware Happiness

Specify uses-feature node for every API you use.Mark essential features as required.Mark optional features as not required.Check for API existence in code.

Page 22: Grooming Session Android CWC

Some DON’Ts (5) DISCRIMINATIONDesign For Everyone

Ensure Future Hardware Happiness

Specify uses-feature node for every API you use.Mark essential features as required.Mark optional features as not required.Check for API existence in code.

Page 23: Grooming Session Android CWC

UX Design FundamentalsUI GuidelinesDesigning for PerformanceDesigning for ResponsivenessSupporting Multiple Screens

Page 24: Grooming Session Android CWC

Location Based ServicesSource: http://developer.android.com/guide/topics/location/obtaining-user-location.html

Page 25: Grooming Session Android CWC

Location Based Services (Contd.)

How often do you need updates?What happens if GPS or Wifi LBS is disabled?How accurate do you need to be?What is the impact on your battery life?What happens if location 'jumps'?

Page 26: Grooming Session Android CWC

Location Based Services (Contd.)

Restricting Updates• Specify the minimum update frequency• Specify the minimum update distance

Page 27: Grooming Session Android CWC

Location Based Services (Contd.)

Use Criteria to Select a Location Provider

Page 28: Grooming Session Android CWC

Location Based Services (Contd.)

Use Criteria to Select a Location Provider

Specify your requirements and preferencesAllowable power drainRequired accuracyNeed for altitude, bearing, and speedCan a cost be incurred?

Find the best provider that meets your criteriaRelax criteria (in order) until a provider is foundCan limit to only active providersCan use to find all matching providers

Page 29: Grooming Session Android CWC

UI and UX Design (Some Tips)

Page 30: Grooming Session Android CWC

UI and UX Design (Some Tips)

Page 31: Grooming Session Android CWC

UI and UX DesignSome Resources:1. http://developer.motorola.com/docstools/library/Best_Practices_for_Use

r_Interfaces/

2. http://www.androidpatterns.com/3. http://pshyama.wordpress.com/2011/07/05/android-os-research/4. http://www.slideshare.net/mswolfson/android-ui-patterns5. http://www.youtube.com/watch?v=M1ZBjlCRfz06. http://speckyboy.com/2010/05/10/android-app-developers-gui-kits-icons

-fonts-and-tools/

7. http://coding.smashingmagazine.com/2011/06/30/designing-for-android/8. http://www.androiduipatterns.com/2011/07/trending-android-ui-anti-pat

terns.html

Page 32: Grooming Session Android CWC

Black-Box Testing Testing of functionality of the application. The tester knows

what the software is supposed to do, but not how. Specific knowledge of the application's code/internal

structure not required. Test cases are built around specifications and requirements. The test designer selects valid and invalid inputs and

determines the correct output. Can be applied to all levels of software testing:

unit, integration, system and acceptance.

Black-BoxInput Output

Page 33: Grooming Session Android CWC

Black-Box Testing in Android: Robotium A test framework created to make it easy to write powerful

and robust automatic black-box test cases for Android. Full support for Activities, Dialogs, Toasts, Menus and Context

Menus. Benefits

Powerful test with minimal knowledge of app under test Handles multiple Android activities automatically Minimal time to write solid test cases Improved readability of test cases

Resources Project Home: http://code.google.com/p/robotium/ Wiki: http://code.google.com/p/robotium/wiki/Getting_Started Tutorials: http://code.google.com/p/robotium/wiki/RobotiumTutorials

Page 34: Grooming Session Android CWC

Testing in AndroidSources:

http://developer.android.com/guide/topics/testing/testing_android.html

Page 35: Grooming Session Android CWC

Questions???