I have a free version of app and i want to link the app store on click of the buy button on the app. How to i do this, i have completely no idea and please help me with some code.
Thanks in advance
What I did was
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
buyButton = (Button)findViewById(R.id.buybutton);
buyButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=app name"));
}
}
}
Use this code to redirect user to the market:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=your.game.package.name"));
startActivity(intent);
Hope this helps.
use below code
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=your_package_name"));
startActivity(intent);
refer this link
http://developer.android.com/guide/publishing/publishing.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With