Skip to content

Instantly share code, notes, and snippets.

@brettnak
Created January 27, 2011 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brettnak/797869 to your computer and use it in GitHub Desktop.
Save brettnak/797869 to your computer and use it in GitHub Desktop.
AppStoreHQ Deals - Developer Guide Snippets
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/main_menu_deal_item"
android:title="@string/menu_item_title"
/>
</menu>
import com.appstorehq.android.deals.api.AppStoreHQDealsController;
@Override
public boolean onOptionsItemSelected( MenuItem item ) {
switch ( item.getItemId() ) {
case R.id.main_menu_deal_item:
Log.d( LOG_TAG, "Starting the AppStoreHQDealsController" );
/**
* To kick off the Deals dialog flow call:
*
* AppStoreHQDealsController.processRebate( Context context, long appStoreHQAppId );
*
* Arguments:
*
* Context context:
* The running context of this activity. Just pass the
* running instance of the current activity, ie:
* 'ReferenceImplementation.this'
* Of course, if you're still in scope ( like we are here )
* you can just use 'this'.
*
* long appStoreHQAppId:
* The application id of your application on AppStoreHQ.
* You can find this from the URL of your application on AppStoreHQ.
* For example, AppESP's url is:
* http://www.appstorehq.com/appespbyappstorehq-android-334556/app
* and it's app id is 334556
*/
AppStoreHQDealsController.processRebate(
ReferenceImplementation.this,
ReferenceImplementation.sAppStoreHQAppId );
break;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment