Reputation: 1549
Everybody must have seen on Google Play that whenever we click install button on the website the particular app is downloaded and installed on the android device owned by user. How could I possibly do that on my android app and website i.e If the user logon to my website with his gmail Id and buys a product (which are some data files) and those files are downloaded to the sdcard of the android device. Have any one worked on similar technique and how it could be possible. Please help?
Upvotes: 1
Views: 746
Reputation: 4233
You are combining couple of problems together.
Android will try to install any binary extension with .apk when you click on it. So even from your email attachment you will be able to download a apk file to sd card and install it onto the device.
You can sell an individual items through your website. Standard solution would be to set up in app purchase through Google play or implement something similar. Alternatively From your app you can complete this sign on and purchase and download whatever place you like.
Edit 1
You can simply use multiple Activities to facilitate additional item purchase.
Alternatively you can use webview and HTML to complete above scenarios.
Upvotes: 0
Reputation: 30855
One way is you can implement GCM(Google Could Message) for sending the request to the device from server now by getting the request of installation get the URL/URI of that application and download it in device. Once the download was completed you can install this apk file by using this code
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File
(Environment.getExternalStorageDirectory() + "/yourapk.apk")), "application/vnd.android.package-archive");
startActivity(intent);
This way you can implement this feature in your website.
Note: For this device has one application for this to get the message from GCM and implement based on this like Google has Google Play Store. User must install your application for this.
Upvotes: 1