title: Make all methods in a particular class accessible by javascript in Android WebView and ProGuard configuration
body: <p>In my app's webview some contents are derived from a class object. From WebView's document <a href="https://developer.android.com/guide/webapps/webview.html" rel="nofollow noreferrer">here</a>:</p>
  
  <blockquote>
    <p>Caution: If you've set your targetSdkVersion to 17 or higher, you must add the @JavascriptInterface annotation to any method that you want available to your JavaScript (the method must also be public). If you do not provide the annotation, the method is not accessible by your web page when running on Android 4.2 or higher.</p>
  </blockquote>
  
  <p>What if I have a class and I would like to make all methods of this class accessible by my WebView? Do I need to add <code>@JavascriptInterface</code> to every single method? Is there another way to achieve this efficiently?</p>
  
  <p>On the other hand, I am not familiar with ProGuard, I've read some posts here as well as some other stuffs (e.g. <a href="http://proguard.sourceforge.net/manual/usage.html" rel="nofollow noreferrer">usage page for proguard</a>) about ProGuard. I am confused about it and its usage. Do I have to configure ProGuard on this issue? </p>
  
  <p>Currently I seem to be able to access methods with <code>@JavascriptInterface</code> without configuring them in ProGuard. However I saw many post regarding ProGuard and JavascriptInterface (like <a href="https://stackoverflow.com/questions/6271485/android-proguard-javascript-interface-fail">post 1</a> and <a href="https://stackoverflow.com/questions/13775320/javascript-interface-not-working-with-android-4-2?noredirect=1&amp;lq=1">post 2</a>) are using the <code>keep</code> options with those classes, if I didn't get it wrong is this because those methods/classes are only used by the javascript in WebView, hence marking them "never used" and will be removed by ProGuard?</p>
  
  <p>Thanks!</p>