On some phones which does not have default android browser
williams-sgvu opened this issue · 8 comments
Hi I tried this library & really working fine on those phones which have default android browser but those who don't have default android browser there it does not work.
For ex : Motorolo, Nexus phones does not have default android browser, they have google chrome browser, xiaomi have their inbuilt different browser.
Then I tried to look a c files of your project there I found you have a mentioned package name and activity name of browser that looks like only the reason it does not work in some phones.
if (version >= 17 || version == 0)
{
execlp("am", "am", "start", "--user", "0", "-n",
"com.android.browser/com.android.browser.BrowserActivity",
"-a", "android.intent.action.VIEW",
"-d", url, (char *)NULL);
}
else
{
execlp("am", "am", "start", "-n",
"com.android.browser/com.android.browser.BrowserActivity",
"-a", "android.intent.action.VIEW",
"-d", url, (char *)NULL);
}
Can we have simple action.View instead of specifying any browser package name and activity name. Let OS handle it so whatever browser is available on device then our source code will open that browser.
I'm looking forward for your help on this. Thanks & lastly great work!! (y).
Thanks for your suggestion. I just wanted to keep it easy to use, and I used libcurl to request url, so I didn't consider other browsers. I'll have a try.
What changes we have to do so that it will work in other browsers also so i can also try. Do you have any idea till when you can release updated library ?
Just try the method as you say.
Okay. I tried that but did not work for me. I am not sure what wrong I did either in compilation or in that native execlp
method. Please can you try now
It's available now. Just use execlp("am", "am", "start", "-a", "android.intent.action.VIEW", "-d", url, (char *)NULL)
Thanks great. Please let me know is it working fine now ? and what have to write in build.gradle instead of this "compile 'com.coolerfall:android-app-uninstall-watcher:1.0.2' "? . Have you uploaded on jcenter or something related repository ?
I will push to maven later. You can use library directly.
Great. It is working but I noticed that it does not work on xiaomi phones which has android 4.4 or 4.0 OS etc as well. Any reason why ?