Geolocation plugin issue with android

I am a newbie with the ionic framework and just started with it’s conference app. However, I am not able to run the app on android. Please see the following use cases (My dev machine and phone both are connected with same wifi. )-

  1. npx cap open android: and then running with android studio. It opens the app with blank screen. Inspecting with chrome tells that it is pointing to http:localhost/.

  2. I tried using live-url to localhost:8100 which is also giving ERR_CONNECTION_REFUSED.

  3. npx cap run android -c -s -l --external: when debugging the app with android studio , it runs the app with and my app runs properly. Now I want to use the Geolocation plugin which gives error “Only secure origins are allowed (see:” I believe this is because the app is neither running on localhost nor has https connection.

Can anyone guide me how to resolve this issue ?