0

I have an url in my app like "zoommtg://us04.zoom.com". I want to open it in browser by Intent. As it is not http or https, it can't be parsed by Uri.parse(url). Again if I try url="http://"+url; it works but deletes the ":" from "zoommtg://" resulting wrong url! I am using the solution of this Question

2
  • That is not an URL that any browser will be able to handle. If you put this into a browser manually, does it work? It looks like Zoom app could handle that. Jul 15, 2021 at 8:15
  • @GenerousBadger Clicking on the link doesn't open zoom app directly. Instead, the link should be opened in browser and then browser will start zoom.
    – KasRoudra
    Jul 15, 2021 at 9:20

2 Answers 2

0

if it is working for https but not other requests, then you can try setting cleartexttraffic to true in your AndroidManifest.xml file.

Do tell if that fixes it. :)

1
  • src/main/AndroidManifest.xml:14: error: No resource identifier found for attribute 'cleartexttraffic' in package 'android'
    – KasRoudra
    Jul 15, 2021 at 6:46
0

zoommtg seems to be "custom protocol" declaration, which isn't resolveable by web browser, but if you are shure, that http(s) url version will work then just replace scheme

String url = "zoommtg://us04.zoom.com";
url = url.replaceFirst("zoommtg", "https")

if you really need to use unsecure http then you have to allow app to do such requests, see how to

btw. you still can use Uri class, it isn't limited to web protocols... check out some description of this structure

URI = scheme:[//authority]path[?query][#fragment]

you can parse your String to Uri and just replace scheme part

Uri.Builder builder = Uri.parse(url).buildUpon();
url = builder.scheme("https").build().toString();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.