Overview
Try and Purchase is a feature of Samsung Apps that allows developers to advertise their Samsung Apps applications (target application). Developers add banners or links to their applications (source application), which jump to the target application when users tap them from the source application.
Implementing Try and Purchase requires the following steps.
- Implement the function to jump to the Samsung Apps client.
- Implement code to call the function above.
- Add the privilege “INSTALLATION” to your manifest.
To implement the above steps, please follow the instructions below.
1. Implement the function to jump to the Samsung Apps client. The following function launches the Samsung Apps client and causes it to display the detailed information view of the target application. You should change the value of the variable "appId" to the value of App ID for your target application (which was retrieved from the bada developers site: http://developer.bada.com). If the target application is a preloaded or postloaded application, you need to add the ‘+’ (plus) sign to the end of App ID, as in: String appId(L”w2pk0g6479+”);
result YourClass::LaunchSamsungApps() { result r = E_FAILURE; ArrayList argList; r = argList.Construct(); if(IsFailed(r)) { return r; } // Do not change this value. String samsungAppsAppId(L"1rfjf7285p"); // Change this value. String appId(L"w2pk0g6479"); r = argList.Add(appId); if(IsFailed(r)) { return r; } AppManager* pAppManager = AppManager::GetInstance(); if(!pAppManager) { return E_FAILURE; } r = pAppManager->LaunchApplication(samsungAppsAppId, &argList); if(IsFailed(r)) { return r; } return E_SUCCESS; }
2. Implement the code to call the function created in step 1. Developers must make their own banners or links to the target application. The event handlers of the banners or links must invoke the function above.
3. Add the privilege “INSTALLATION” to your manifest. You need to set the privilege “INSTALLATION” for your source application in the bada developers site (http://developer.bada.com). Then download and update your manifest.xml file to the new one from the bada developers site. The updated manifest.xml file must contain the following contents:
<Privilege> <Name>INSTALLATION</Name> </Privilege>
To see an actual sample implementation of the Try and Purchase feature, please see the sample application "CalculatorTrial."



11:28 am

