As explained here, Google Play provides url protocol
market://details?id=<package_name>
Applying on Blogger :
Place the following javascript code at the bottom and before </body>. This will change Google Play links only on Android.
<script>
if (/(android)/i.test(navigator.userAgent)) {
document.querySelectorAll('a[href]').forEach(function (link) {
link.href = link.href.replace('https://play.google.com/store/apps/','market://');
});
}
</script>
Answer from user6144987 on Stack OverflowIs Google Play Store Free?
Why Should I Download Google Play Store?
What Are the Alternatives to Google Play Store?
I got it working by using the below url on redirect
window.location.href = "https://play.app.goo.gl/?link=https://play.google.com/store/apps/details?id=com.myapp";
When I visit this url from the browser of my mobile, it does not open the play store within browser but opens the play store app instead. This serves my purpose.
You can do this by checking URL in shouldOverrideUrlLoading method of your WebViewClient. See below
String market_url = "market://details?id=package_name";
String website_url = "https://play.google.com/store/apps/details?id=package_name";
onCreate ()
WebView webview = (WebView) findViewById(R.id.webview);
webview.loadUrl("file:///android_asset/index.html"); // path to html
webview.setWebViewClient(new Callback());
private class Callback extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.equals(website_url)) {
try {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(Uri.parse(market_url));
startActivity(intent);
} catch (ActivityNotFoundException e) {
}
}
return (false);
}
}
index.html
<a href="https://play.google.com/store/apps/details?id=package_name">App link</a>
This will always open your link in play store.
This is really annoying. I don't need to download a million apps when I already have a web browser. I just want to go to the website. The website exists. I can visit it on my computer. I don't want links to open in an app, I want links to open in Chrome. It's my web browser. It's the thing I use to open links. Especially if I don't even have the app downloaded. When I click a link, my intention is to go to that URL, not to open the Google Play store. If I wanted to open the Google Play store, I have that option. All I have to do is click on the Google Play store icon, and the Google Play store opens. If I want to visit a URL, why do I have to open the Google Play store? Why can't I just visit the URL in my web browser like you normally do with URLs? This is so frustrating and maddening. It's like they try to make these things as difficult and impossible as possible. Every time I want to do something incredibly simple, I have to spend several hours trying to figure out how to do it. This is so ridiculous. These things can do such complex things, but if you want them to do something simple, like open a URL in a web browser, you have to bend over backwards giving yourself migraines all day just to figure out how to do it. Can anybody help me?
Actually, there are some alternatives to the Google Play Store out there - all with different approaches. F-Droid's goal is to provide only FOSS (free open-source software) apps. Others would be, for example, https://apkpure.com/
Back to your main question:
Accessing the Google Play Store without a Google account is not possible.
BUT
You can access the Google Play Store with a fake account to expose less data to Google.
As mentioned in the comments, one popular solution is the Aurora Store (also available on F-Droid). What it does is, it takes your request and sends it with a fake account to the Google Play API to get the apps. So, Google will log that an app was downloaded, maybe some more information like country (not sure what is required by the API) BUT without your real identity.
To prevent running into limits (those fake accounts created by Aurora are used by thousands of clients), I created my own fake account on Google without any real data and used this with all my family and friends' degoogled phones.
I don't know of any way to access Google Play without an account, but many of the apps on the Play Store can be downloaded from F-Droid.