Pages

Showing posts with label coverage. Show all posts
Showing posts with label coverage. Show all posts

Saturday, February 20, 2016

Android Code Coverage Unit Testing

This is a very small post for all those who have been strugling to generate the Android Test Coverage Using the ant scripts give by android sdk itself.


I am assuming that you have created one project containing the actual source code to be tested - assume it is called "MyProject" and you have created another test project that tests MyProject, that is named MyProjectTest.


Then, you have written jUnit tests using the inherent testing support framework with android. Now, you have run your unit tests and they run successfully in ecplise. You then, what to check on the code coverage of these unit tests. Here are the steps for the same:



  •    At the command prompt, change directory to the MyProject folder
  •    Rename the existing build.xml to build_orig.xml
  •    Run this command:
android update project -p . (including the last dot)
  •    Then change directory to cd ..MyProjectTest
  •    Rename the existing build.xml to build_orig.xml
  •    Run this command:
android update test-project -m D:/..../source/MyProject -p .  (including the last dot and where you give your complete path to the MyProject folder after -m)
  •    Then, run the  command -
ant emma debug install test
This should generate a html report of the coverage under MyProjectTest/coverage


Troubleshooting:

  •    Incase you get an error "remote object coverage.ec does not exist" then start adb shell in another command prompt - in order to give write permissions to the sdcard for writing the coverage.ec file
  •    Then, run the following command at the shell
mount -o remount rw /sdcard
  •    Then you should be able to generate the report.


Read More..

Wednesday, February 17, 2016

Android is ready for work



(Cross-posted on the Android Blog.)

Over a billion people today carry Android smartphones—devices that are more powerful than the computers we used just a few years ago.

For many, these phones have become essential tools to help us complete important work tasks like checking email, editing documents, reviewing sales pipelines and approving deals. But for the majority of workers, smartphones and tablets are underutilized in the workplace. Their business and innovation potential remain largely untapped.

Today were announcing the Android for Work program to tap into that potential. With a group of partners, were helping businesses bring more devices to work by securing, managing and innovating on the Android platform.

Android for Work features four key technology components:

  • Work profiles – We’ve built on the default encryption, enhanced SELinux security enforcement and multi-user support in Android 5.0, Lollipop to create a dedicated work profile that isolates and protects work data. IT can deploy approved work apps right alongside their users personal apps knowing their sensitive data remains secured. People can use their personal apps knowing their employer only manages work data and won’t erase or view their personal content.
  • Android for Work app – For devices running Ice Cream Sandwich through Kitkat, or that don’t run work profiles natively, we’ve created the Android for Work app. The app, which delivers secure mail, calendar, contacts, documents, browsing and access to approved work apps, can be completely managed by IT.
  • Google Play for Work – Google Play for Work allows businesses to securely deploy and manage apps across all users running Android for Work, simplifying the process of distributing apps to employees and ensuring that IT approves every deployed app.
  • Built-in productivity tools – For everyday business tasks, we’ve created a suite of business apps for email, contacts and calendar, which supports both Exchange and Notes and provides document editing capabilities for documents, spreadsheets and presentations.
We’re joined by a number of partners as part of the Android for Work program, including many familiar names within the Android ecosystem:
Our partners bring IT:

  • Consistent management – Enterprise mobility management (EMM) providers integrate with standardized management APIs to create a simple way to manage all Android devices, new and old, from one dashboard. All Android for Work capabilities are delivered through EMM partners, with more providers available soon.
  • Secure business apps – Software vendors and developers can create a single version of any Google Play app that can be securely deployed to any Android device without alterations or wrapping. And they can create standard management configurations that allow IT to apply policies per app.
  • Innovative devices – Android smartphone and tablet makers are a key part of the Android for Work program, as they create devices and experiences that add additional value for customers.

Together with a wide range of management, application and device makers, we believe the Android for Work program provides businesses and workers with the choice and flexibility they need to get things done at work.

Learn more by visiting google.com/work/android.


Read More..