Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Testing and securing android studio applications
  • Table Of Contents Toc
Testing and securing android studio applications

Testing and securing android studio applications

By : Cruz Zapata, Antonio Hernández Niñirola
4.6 (5)
close
close
Testing and securing android studio applications

Testing and securing android studio applications

4.6 (5)
By: Cruz Zapata, Antonio Hernández Niñirola

Overview of this book

If you are a developer with some Android knowledge, but you do not know how to test your applications using Android Studio, this book will guide you. It is recommended that you are familiar with Android Studio IDE.
Table of Contents (13 chapters)
close
close
12
Index

Code examples using HTTPS


You already understand how HTTPS works theoretically, but how can an Android developer use secure connections using HTTPS?

To establish an HTTP connection, all you need to do is run the following three lines of code:

URL url = new URL("http://wikipedia.org");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
InputStream in = connection.getInputStream();

Wikipedia supports secure communications, so let's change the code to make it use HTTPS instead of HTTP, as shown in the following code:

URL url = new URL("https://wikipedia.org");
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
InputStream in = connection.getInputStream();

Can you see the difference? Well, if you can see the difference, congratulations! You have a very sharp eye. If you can't, here is a little hint: check the protocol in the URL again and the HttpURLConnection class. Now you see the little s after http in the URL and in the class name, and yes, that is...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Testing and securing android studio applications
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon