Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Exporting types from Android App Using ClassyShark

DZone's Guide to

Exporting types from Android App Using ClassyShark

In this post, MVB Boris Farber gives a quick tutorial on how to export types from an Android mobile application, using the tool ClassyShark.

· Mobile Zone
Free Resource

Discover how to focus on operators for Reactive Programming and how they are essential to react to data in your application.  Brought to you in partnership with Wakanda

Following my recent article, I got a few suggestions asking about adding a type analysis export to the ClassyShark output.

Types analysis is important for Android developers when dealing with deprecated APIs, duplicate dependencies, and security analysis.

The tricky part is: we need to pay attention to both app and library types. The app own types are easy, as one can see them in their IDE, however, the dependencies are more difficult to grasp. On top of that, for Android, there is no distinction between the types in the app and the ones in dependencies (like third-party libraries).

For code inside the app a few surprises might come with inner classes and synthetic methods that add to class and method count (see the multidex limit) to the ClassyShark output, so in this article, I would like to describe how to use this feature.

You can find the same minimalistic UI here and a released jar (classyshark-types-export.jar) here. Say hello to ClassyShark Types Exporter!

How do you use the exporter? It is pretty easy:

  • Double click on the jar, and then the file chooser pops up.
  • Select your APK.

  • Once the APK is selected the exporter starts to export, showing the export progress that might take 30–40 secs (checked with MacBook Pro).
  • Once the exporter finishes the work, it creates a text file in the same folder as the running jar. This text file holds a list with all types from the APK.

Happy coding!

Learn how divergent branches can appear in your repository and how to better understand why they are called “branches".  Brought to you in partnership with Wakanda

Topics:
mobile ,android ,types

Published at DZone with permission of Boris Farber, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}