I have 2 android apps. Both are installed on the phone. Lets say the package name for the two are com.android.test1 and com.android.test2. How can i call the method M
You cannot directly call a method of one app from another app. Instead, you have to invoke one activity from another and fetch result using Intent filters.
These links might help you
http://www.vogella.com/articles/AndroidIntent/article.html
http://saigeethamn.blogspot.in/2009/08/android-developer-tutorial-for_31.html