link to an existing app in the market

Put your problem here if it does not fit any of the other categories.

link to an existing app in the market

Postby JJ » Wed Jul 29, 2009 5:59 pm

Hi
I am having problems going to the android market (from the code in the
mobile)

I am trying the two following approaches, both unsuccessful:

1)
myWebView = (WebView) findViewById(R.id.webview);
myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.loadUrl("http://market.android.com/search?
q=pname:com.android.main.v30");
myWebView.setVisibility(RelativeLayout.VISIBLE);

with this approach, I get a frustrating not found error 404

2)
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://search?
q=pname:com.android.main.v30"));
startActivity(intent);

with this, I get the following error
07-29 12:48:56.103: ERROR/AndroidRuntime(240):
android.content.ActivityNotFoundException: No Activity found to handle
Intent { action=android.intent.action.VIEW data=market://search?
q=pname:com.android.main.v30 }

Does anybody know what I am missing?

Thanks a lot
JJ
Developer
Developer
 
Posts: 35
Joined: Tue May 13, 2008 1:18 pm

Top

Postby stifry » Fri Aug 14, 2009 12:13 am

Try this:

Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://market.android.com/search?q=pub:\"Trackaroo\""));
startActivity(marketIntent);
Visit Trackaroo.com!
Trackmaster - Motorsports Lap Timer
Dynomaster - Performance Dyno
Image Image
User avatar
stifry
Developer
Developer
 
Posts: 46
Joined: Tue Feb 17, 2009 7:50 pm

Postby vihil » Wed Oct 21, 2009 2:17 am

i stumbled upon the same "problem" and just wanted to emphasize that the emulator does not have a Market app and thus the urls do not catch there :)

i haven't tested it on my device yet but i assume both URIs should work there (http:// and market://). it might be good for the app to verify whether the device does have the Market available.
vihil
Freshman
Freshman
 
Posts: 3
Joined: Thu Dec 11, 2008 2:39 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 14 guests