I am new salesforce and have good knowledge of java and android development.. Since the Default authection of salesforce template app uses web view I want to do it without using web view through some posts I found that it is possible by using Username-password flow but my question is is it possible to implement it in android.If so then how
You're not expected to use this flow, so it is unlikely that the Android mobile toolkit would include code to do this. It is a security risk, and it also is a red flag that will prevent your app from passing a security review and being listed on the AppExchange.
If you really want to do this, you're going to have to write all the logic for it yourself, by modifying the imported library code. Assuming you're a competent Android developer, you should already know how to use a HTTPS connection to acquire a resource. There's no special magic you need to do. Simply provide the correct parameters, listed in the documentation, to the correct endpoint, and you'll be logged in.
Not clear what you are trying to do. But from
Username-password flow I guess you are looking are looking for ways to authenticate a salesforce user using their login credentials?
If so, you can use Salesforce Partner API
login operation, which takes userid/password and creates a session. Later you can use that session id to invoke other apis.