Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Testing and securing android studio applications

You're reading from  Testing and securing android studio applications

Product type Book
Published in Aug 2014
Publisher Packt
ISBN-13 9781783988808
Pages 162 pages
Edition 1st Edition
Languages

What to test


In the previous chapters, you learned about the Android testing API working with Android Studio. Apart from knowing about activity and UI testing, considering what parts of your application should be evaluated is also important.

Network access

If your application depends on the network access, you should examine the behavior of your application when different network states are given. Consider the following suggestions:

  • If your application completely depends on the network when it is launched and there is no network access, it should at least show a default home screen. Your application should not show a blank screen with any information on it. Let the user know that he/she should review the device connectivity. The network state can be checked using the ConnectivityManager class in the following code:

    ConnectivityManager connManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo netInfo = connManager.getActiveNetworkInfo();
    if (netInfo != null...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}