Your SlideShare is downloading. ×
0
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Android the Agile way
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Android the Agile way

821

Published on

Thiyagu, Krishna, Soundar and Ashwin presented at xconf on some tools that can help support extreme programming practices on a project based of the Android platform

Thiyagu, Krishna, Soundar and Ashwin presented at xconf on some tools that can help support extreme programming practices on a project based of the Android platform

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
821
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Android - A Practitioner's take on doing it The Agile Way Thiyagu, Krishna, Soundar, Ashwin
  • 2. Can we run an Android Application Development Project the Agile Way?
  • 3. As a practitioner, what are the effects of the Technical Stack on the process?
  • 4. How can I follow the 'Extreme Programming' Practices?
  • 5. As ThoughtWorks why can we expect Android Projects?
  • 6. Enterprises are looking for a Mobile Presence
  • 7. Mostly CRUD Applications though.
  • 8. Then Why a native app over a Web App?
  • 9. Native Applications are much more enabled than a web application 
  • 10. etc.....
  • 11. But why Android?
  • 12. Steep increase in the user  base
  • 13. Lots of new Vendors
  • 14. So as ThoughtWorks, why have this capability?
  • 15. We want to build something cool !
  • 16. Disclaimer
  • 17. Why is this not just a Java Project?
  • 18. When you’re working with Android, it sure feels like you are writing regular old standard Java SE code
  • 19. You are not!!
  • 20. So what is the difference? Its the runtime!!!!
  • 21. In the Android platform, we have the Dalvik Runtime which is specially designed for devices that are contrained in terms of memory, speed and battery power.
  • 22. Dalvik is not even a Java Virtual Machine at all!
  • 23. It does not understand byte code. Instead...
  • 24. It understands Dex Code
  • 25. Everything you need as a programmer is available in the Dalvik implementation of Java
  • 26. Why do I mention all this?
  • 27. Because you might want to use something like JMock to mock your dependencies when writing your unit tests
  • 28. Its not a full Java SE implementation
  • 29.  
  • 30. Test Driven Development
  • 31. The Application to be tested must/needs to run on a device instance
  • 32. Any entity that aims to test the Android Application must be on the device instance as well
  • 33. So the test in itself is Another Application!
  • 34. Android Testing and Instrumentation
  • 35. <ul><li>public class LoginActivity extends Activity  </li></ul><ul><li>     /* declarations of states*/     </li></ul><ul><li>     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.login);              loginButton = (Button) findViewById(R.id.login_login_button);         usernameText = (TextView) findViewById(R.id.user_name_input);         passwordText = (TextView)findViewById(R.id.pass_word_input);          </li></ul><ul><li>         loginButton.setOnClickListener(new OnClickListener() { </li></ul><ul><li>             public void onClick(View v) {                 String username = usernameText.getText().toString();                 String password = passwordText.getText().toString();                 MyApplication.getLoginService().login(username, password);             }         });     } } </li></ul>
  • 36. <ul><li>public class LoginActivityTest extends ActivityUnitTestCase&lt;LoginActivity&gt; { </li></ul><ul><li>    public LoginActivityTest() { </li></ul><ul><li>        super(LoginActivity.class); </li></ul><ul><li>    } </li></ul><ul><li>  </li></ul><ul><li>    protected void setUp() throws Exception { </li></ul><ul><li>        super.setUp(); </li></ul><ul><li>        ... </li></ul><ul><li>    } </li></ul><ul><li>   /* Other tests for testing whether the button and text box exists*/  </li></ul><ul><li>   public void testOnClickOfLoginButtonItShouldSendUserNameAndPassWordToLoginServiceForVerifying() </li></ul><ul><li>{ </li></ul><ul><li>         String userName = &amp;quot;rapidftr&amp;quot;; </li></ul><ul><li>        userNameEditText.setText(userName); </li></ul><ul><li>         String passWord = &amp;quot;rapidftr&amp;quot;; </li></ul><ul><li>        passWordEditText.setText(passWord); </li></ul><ul><li>  </li></ul><ul><li>        LoginService loginService = EasyMock.createMock(LoginService.class); </li></ul><ul><li>        EasyMock.expect(loginService.login(userName, passWord)).andReturn(true); </li></ul><ul><li>        EasyMock.replay(loginService); </li></ul><ul><li>  </li></ul><ul><li>        RapidFTRApplication.setLoginService(loginService);        </li></ul><ul><li>  </li></ul><ul><li>        loginButton.performClick();        </li></ul><ul><li>  </li></ul><ul><li>        EasyMock.verify(loginService); </li></ul><ul><li>     } </li></ul><ul><li>} </li></ul>
  • 37. Does the service Locator Pattern Seem like a bad idea?
  • 38. Ensure that your Mocking Framework is supported by the Dalvik VM
  • 39. The problem with easy mock .... Mocking Concrete Classes
  • 40. So can we clean up this mockery?
  • 41. Split the code into 2 types: 1.Android Framework Dependent  2.Android Framework Independent
  • 42. Over Engineering the code is Dangerous.
  • 43. ActivityInstrumentationTestCase    
  • 44. Continuous Integration
  • 45. Android Debugger Bridge adb install, -r, standup-timer-app.apk
  • 46. The Testing Application and the Application under test are deployed on the same device instance
  • 47. Android Maven Plugin  &amp;Ant Script     Android SDK Path Platform Used Device Instance to use
  • 48. &lt;plugin&gt;                    &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt;                    &lt;artifactId&gt;maven-android-plugin&lt;/artifactId&gt;                    &lt;version&gt;2.5.1&lt;/version&gt;                    &lt;configuration&gt;                        &lt;sdk&gt;                             &lt;path&gt;android_sdk&lt;/path&gt;                            &lt;platform&gt;7&lt;/platform&gt;                        &lt;/sdk&gt;                        &lt;emulator&gt;                            &lt;avd&gt;my_avd&lt;/avd&gt;                        &lt;/emulator&gt;                        &lt;deleteConflictingFiles&gt;                             true                        &lt;/deleteConflictingFiles&gt;                        &lt;undeployBeforeDeploy&gt;true&lt;/undeployBeforeDeploy&gt;                    &lt;/configuration&gt;                    &lt;extensions&gt;true&lt;/extensions&gt;    &lt;/plugin&gt;
  • 49. Independent parts of the build
  • 50.     // start tracing to &amp;quot;/sdcard/calc.trace&amp;quot;     Debug.startMethodTracing(&amp;quot;calc&amp;quot;);     // ...     // stop tracing     Debug.stopMethodTracing();
  • 51. &nbsp;
  • 52. &nbsp;
  • 53. Time for Demo

×