I have been trying to get the methods used in the .java file of an Android Application for my project. I have used parser that are available on internet but they parse out only the user defined methods or the core java methods. I would like to extract the methods that are also part of android framework just like how eclipse shows the list of methods and variables in the Java outline tab.
I have tried using javaparser, AST Parser and Java API java.lang.reflect.Method. For example, if I have a java file like following
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getResources().getBoolean(R.bool.portrait_only)) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
} else {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
}
public void showLogin() {
registerNumberEditText.setVisibility(View.VISIBLE);
passwordEditText.setVisibility(View.VISIBLE);
loginButton.setVisibility(View.VISIBLE);
textView1.setVisibility(View.INVISIBLE);
txtProg.setVisibility(View.INVISIBLE);
loginStat = true;
}
}
For the above code I need the list of methods and parameters used in the code like
Methods:
OnCreate
getResources
getBoolean
setRequestedOrientation
showLogin
setVisibility
but not
Methods:
showLogin
Thank you for helping me out...