Android Market: problems with details page - android

I am trying to open the Android Market in my application's details page.
I am using the following code:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=my.app.package"));
startActivity(intent);
However, it seems like this does not work in some devices.
Has anyone experienced a similar issue?

According to the documentation, it seems like the Market application filters out applications based on several criteria:
"filtering might also depend on the country and carrier, the presence or absence of a SIM card, and other factors." http://developer.android.com/guide/appendix/market-filters.html
Probably your application is being filtered out by one of those factors.
One of the best ways to confirm this is to login with your google account in the web market, go to the details page, then try to install the application.
You'll get a message similar to "Your operator is not supported"

Related

link to publisher in google play not working

In my native android app i have a "more apps" button which I want to link to all my apps on google play.
I'm following this link: http://developer.android.com/distribute/tools/promote/linking.html#UriSummary
As per the documentation in the link above, i used this query: market://search?q=pub:publisher_name. For publisher name i used my name without the brackets. BUT when i run the app and click on the "more apps" button, the google play store app opens and shows this message:
No results found for "pub:my_name_here"
If i remove the "pub" the url like this:market://search?q=publisher_name
then it shows all my apps. But the problem is that along with my apps, other apps are also being shown which match my surname. Not sure how to resolve this. All i want is to link to only my apps on google play.
I tried searching on Google, StackOverflow but did not find the solution. I tested this on Galaxy Note II. Not sure if it is a device specific issue. Has anyone come across something like this? Thanks!
Just to add to this, I also had this issue and found that adding quotation marks around my developer name solved it.
Instead of this:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pub:Liam Cottle"));
Change it to this:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pub:\"Liam Cottle\""));
The Google Play store app will only show results which match the quoted name exactly... Well, that's what I found anyway.
We have the same issue and the old link used to work up until now.
The workaround so far is to use
Intent marketIntent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://play.google.com/store/search?q=Vendor+Name"));
startActivity(marketIntent);
This works, but this is triggering the open with window and it also requires us to update every single app.
Edit: The provided answer by Liam does not work as this is the exact link and quotation we have been using for years, which just recently stopped working, the only working solution is using the web link above.

Send a link to whatsapp group directly from browser (or from app)

I want to enable users to share a URL+ text with a WhatsApp group. I want this to work both from iPhones and Androids. However my app is in a browser (it's a website). I'm currently looking into 2 options, but both have issues:
1) The first potential solution - sharing directly from the browser.
I checked out WhatsApp's URL schema and used the following URL to share through my app:
"whatsapp://send?text=Hello%2C%20World!"
However there were several problems with this approach:
It seems to work only with iPhones and not with Androids. Is there a comparable solution somewhere for Androids?
It enables to choose who to send to only after you are redirected to WhatsApp, unless you know the address book ID (=abid) of the user. First, I do not know how to access the abid of users? Second, I am trying to send to a group, in which case there is no abid (right?), and therefore it seems impossible to do this. Is that true?
Also, what happens for Android apps? What is the comparable to the abid, for a group, and how do I get it?
2) The second potential solution - creating a native app which is identical with the browser-based app, but this specific part (where we do the "sharing") is native.
However, it seems to me that in this case I have very similar problems to the ones described above:
I can see how to do this for iOS on WhatsApp's website (see the link above). However, does the WhatsApp URL schema work with Android native apps as well?
Again, the address book ID issue is the same. How do I get it? It may be easier to get the abid on iOS given that we are now a native app, but does it exist for a group? And how about the Android app? Would this share to WhatsApp group work there?
Sharing directly from the browser works both in iPhone and Android if you use WhatsApp version 2.11 or higher. As you said it DIDN'T USED TO work in Android.
U can use the same URL
"whatsapp://send?text=Hello%2C%20World!"
Knowing abid is not possible as far as I know.
Hope this was helpful.
Thank You.
in Android you can invite friends from an app using Intent, see the following Code
final ComponentName name = new ComponentName("com.whatsapp", "com.whatsapp.ContactPicker");
Intent oShareIntent = new Intent();
oShareIntent.setComponent(name);
oShareIntent.setType("text/plain");
oShareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Your Message");
startActivity(oShareIntent);
I hope this solves your problem

Leaving feedback in the market for application does not work

I had made one application and it was OK, but didn't provide the feedback option to the users. Now I made another app and trying to put feedback option - leaving feedback for the app thing from the mobile itself.
I checked the following link for the help and used the same code to put in my app:
How to launch the Google Play intent in 'Give Feedback' mode on Android?
String pkgnm = getPackageName();
Intent mktfdbk = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + pkgnm));
mktfdbk.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(mktfdbk);
My app is using an AlertDialog where user would click on "YES" to possibly leave the feedback on market.
Obviously at the moment my app is not in the market it wont show up anything even if using above code... but seeing the code and just for testing purpose I changed the package name to my previous app which I created and is still in the market.
But when executing the above code, it tries to connect to internet and then says "The requested item could not be found". Internet access is there, I have also used uses-permission for internet (not even sure if that was needed but I put it anyways). What am I doing wrong?

Tell if running AOSP or Google Android?

I've searched and cannot find this, though mainly a challenge of knowing what to search for, I'm sure it's been asked before.
How does an app deduce whether it is running on a "Google Android" device, or an AOSP device (e.g. Kindle Fire etc)?
You can try to enumerate an existing accounts on device using AccountManager class: getAccountsByType(), passing com.google as desired account type. If there is no accounts of this type, this mean either it is AOSP device or the user didn't create Google account yet.
If it is not enough for you, you can use PackageManager class and query some Google-specific package using getPackageInfo() method. For example, com.android.vending - Google Play app.
But pay attention that no one of these methods can guaranty you that target device is running AOSP.
This is not trivial, but most apps do not need to even care. If you do, then it usually means you need some unique features therefore it's simpler to check if certain feature is present or not, instead of what label is on the device. You may also check for presence of certain packages (like Google Play), but lack of it does not mean automatically it is i.e. Fire.
You can check whether you can open market urls by using an Intent.
Documentation on the intent's extras is here.
The Intent would look like this:
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.example.android"));
//you can use any package identifier for the check.
startActivity(intent);
} catch (ActvitiyNotFoundException anfe) {
//There's no market installed.
//So you can guess that you're not on a device with Google experience
}
The downside of this method would be, that the user will be taken to the Play Store if it's available.

"no activity found to handle intent" Not all phones have Android Market installed

Not all phones have Android Market installed, and therefore using intent to open market app fails.
What's the best way to handle this?
Hide this feature if user doesn't have Android Market installed (how would I detect this?).
Handle the possible error, how (and possibly suggest that the user downloads the Android Market)?
The problem with the answer above is that if you just pass a URL the user will be prompted how to handle the Intent.
A more graceful way to do it IMO, expanding upon the 1st answer above, is to test whether the market app is installed, and then if not, pass a URL (which actually you would then want to test to see if something can handle that intent, but if you happen to have a device without both the play store and a browser then I would question why the user would have my app installed in the first place (another story I suppose)....
Perhaps there is a better way, but here's what works for me:
private String getMarketURI(String marketURL) {
String returnURL = "";
PackageManager packageManager = getApplication().getPackageManager();
Uri marketUri = Uri.parse("market://" + marketURL);
Intent marketIntent = new Intent(Intent.ACTION_VIEW).setData(marketUri);
if (marketIntent.resolveActivity(packageManager) != null) {
returnURL = "market://" + marketURL;
} else {
returnURL = "https://play.google.com/store/apps/" + marketURL;
}
return returnURL;
}
And then use it like so:
marketIntent.setData(Uri.parse(getMarketURI("details?id=com.yourapps.packagename")));
If your app is being provided by Android Market, then it does have Android Market installed. :)
Okay that is snide, but there is an important truth -- Google goes to a lot of effort to enforce compatibility guarantees on devices for them to be allowed to ship with Android Market, so that is how you can know that whatever you are running on will behave as it should.
If you are delivering your app from something besides Android Market, you need to get information from whoever is delivering the app about what compatibility guarantees they have.
If they don't have compatibility guarantees (or you are just putting a raw .apk up on a web site or such), then you have a complete crap shoot. The device you are running on could have had its software modified in pretty much any way, and have any kind of differences in behavior you can imagine.
That said, if you want to determine whether there is an activity on the current device to handle a particular Intent, you can use this: PackageManager.resolveActivity
Use the web address as the intent target and then if there is no android market it will open in a browser.

Categories

Resources