{"_id":"5982cf576f093c001fffb4c3","project":"57170dacd2a6510e008408f9","version":{"_id":"57170dacd2a6510e008408fc","hasDoc":true,"hasReference":true,"project":"57170dacd2a6510e008408f9","__v":2,"createdAt":"2016-04-20T05:03:40.116Z","releaseDate":"2016-04-20T05:03:40.116Z","categories":["57170dacd2a6510e008408fd","571717cefdcb310e00f23e49"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"57170dacd2a6510e008408fd","project":"57170dacd2a6510e008408f9","__v":0,"version":"57170dacd2a6510e008408fc","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-04-20T05:03:40.137Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"user":"57170e372be45f0e00caae4f","githubsync":"","__v":1,"parentDoc":null,"updates":["5a27f7f7a30f7d003c1535c0"],"next":{"pages":[],"description":""},"createdAt":"2017-08-03T07:23:03.918Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":11,"body":"1. Ensure that you register your application.\n2. After the registration click the download button and a popup will appear\n3. Choose ala carte option on that dialog and check which permissions you wish to integrate and wait for the generated sdk zipped named market-sdk.zip to be downloaded.\n   \n4. Once downloaded, unzip the file and upon unzipping copy the market-sdk-2.1.0.jar file\nand paste to your project libs folder\n5. Import all the pertinent classes and interface on the Main Activity of the application.\n6. Declare a private variable for IMarket interface.\n7. Instantiate the Market Builder class on android Activity onCreate method:\n8. Invoke the start() method of Market object instance. \n\n\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Import Mobi.Info partner interface and classes\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"//In your project, open the Main Activity of the application and import all pertinent classes and interfaces as shown below:\\n\\nimport com.bghb.jcj.IMarket;\\n\\nimport com.bghb.jcj.Market;\\n\\n//Declare a private variable for IMarket interface.\\n\\nprivate IMarket market = null;\\n\\n//Instantiate the Market.Builder on android Activity onCreate method:\\n\\n:::at:::Override\\nprotected void onCreate(Bundle savedInstanceState) {\\n  \\nsuper.onCreate(savedInstanceState);\\n  \\nsetContentView(R.layout.activity_main);\\n                \\nmarket = new Market.Builder(this)\\n  \\n.setSandBox(false)\\n  \\n.build();\\n\\nmarket.start();\\n  \\n}\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"import android.os.Bundle;\\nimport android.support.v7.app.AppCompatActivity;\\nimport android.view.Menu;\\nimport android.view.MenuItem;\\nimport com.test.IMarket;\\nimport com.test.IMarketDialogStatusListener;\\nimport com.test.Market;\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Adjust AndroidManifest.xml To Unlock The Necessary User-Permissions\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<uses-permission android:name=\\\"android.permission.INTERNET\\\" />\\n<uses-permission android:name=\\\"android.permission.ACCESS_NETWORK_STATE\\\" />\\n<uses-permission android:name=\\\"android.permission.RECEIVE_BOOT_COMPLETED\\\" />\\n<uses-permission android:name=\\\"android.permission.READ_PHONE_STATE\\\" />\\n<uses-permission android:name=\\\"android.permission.GET_ACCOUNTS\\\" />\\n<uses-permission android:name=\\\"com.android.browser.permission.READ_HISTORY_BOOKMARKS\\\" />\\n<uses-permission android:name=\\\"com.google.android.gms.permission.ACTIVITY_RECOGNITION\\\" />\\n\\t  \\t\\n    \",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Specify Required Dependencies\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"dependencies {\\n        compile files('libs/market-sdk-2.1.0.jar')\\n        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {\\n                exclude group: 'com.android.support', module: 'support-annotations'\\n        })\\n        compile 'com.android.support:appcompat-v7:25.3.1'\\n        compile 'com.android.support.constraint:constraint-layout:1.0.2'  \\n                \\n        compile 'com.google.android.gms:play-services-location:9.8.0'\\n        compile 'com.google.android.gms:play-services-ads:9.8.0'\\n}\\n\\n\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Specify Required Services,Receivers and Activity\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"within <application>:\\n\\n<service android:name=\\\"com.bghb.jcj.MarketService\\\" android:exported=\\\"false\\\"/>\\n\\n<activity android:name=\\\"com.bghb.jcj.MarketEula\\\"  android:theme=\\\"@android:style/Theme.Dialog\\\"  >\\n   <intent-filter>\\n       <action android:name=\\\"com.bghb.jcj.action.START_EULA\\\" >\\n       <category android:name=\\\"android.intent.category.DEFAULT\\\" >\\n   </intent-filter>\\n</activity>\\n\\n<receiver android:name=\\\"com.bghb.jcj.MarketBootReceiver\\\" >\\n    <intent-filter>\\n       <action android:name=\\\"android.intent.action.BOOT_COMPLETED\\\" >\\n    </intent-filter>\\n</receiver>\\n\\n<receiver android:name=\\\"com.bghb.jcj.MarketConnectivityChange\\\"  android:enabled=\\\"true\\\"     android:exported=\\\"true\\\">\\n    <intent-filter>\\n        <action android:name=\\\"android.net.conn.CONNECTIVITY_CHANGE\\\">\\n    </intent-filter>\\n</receiver>\\n          \",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"A sample of the AndroidManifest.xml file in its entirety\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n<manifest\\n\\txmlns:android=\\\"http://schemas.android.com/apk/res/android\\\"\\n    package=\\\"com.market.demo\\\"\\n    android:versionCode=\\\"1\\\"\\n    android:versionName=\\\"1.0\\\" >\\n\\t<uses-sdk\\n        android:minSdkVersion=\\\"9\\\"\\n        android:targetSdkVersion=\\\"24\\\" />\\n\\t<uses-permission android:name=\\\"android.permission.INTERNET\\\" />\\n\\t<uses-permission android:name=\\\"android.permission.ACCESS_NETWORK_STATE\\\" />\\n\\t<uses-permission android:name=\\\"android.permission.RECEIVE_BOOT_COMPLETED\\\" />\\n\\t<uses-permission android:name=\\\"android.permission.READ_PHONE_STATE\\\" />\\n\\t<uses-permission android:name=\\\"android.permission.GET_ACCOUNTS\\\" />\\n\\t<uses-permission android:name=\\\"com.android.browser.permission.READ_HISTORY_BOOKMARKS\\\" />\\n\\t<uses-permission android:name=\\\"com.google.android.gms.permission.ACTIVITY_RECOGNITION\\\" />\\n\\t\\n\\t<application\\n        android:allowBackup=\\\"true\\\"\\n        android:theme=\\\"@style/AppTheme\\\" >\\n\\t\\t<meta-data android:name=\\\"com.google.android.gms.version\\\"\\n            android:value=\\\"@integer/google_play_services_version\\\" />\\n \\n\\t\\t<activity\\n            android:name=\\\".SplashScreen\\\"\\n            android:label=\\\"@string/app_name\\\" >\\n\\t\\t\\t<intent-filter>\\n\\t\\t\\t\\t<action android:name=\\\"android.intent.action.MAIN\\\" />\\n\\t\\t\\t\\t<category android:name=\\\"android.intent.category.LAUNCHER\\\" />\\n\\t\\t\\t</intent-filter>\\n\\t\\t</activity>\\n\\t\\t<activity android:name=\\\".MainActivity\\\"  android:label=\\\"@string/app_name\\\" />\\n\\t\\t\\n\\t\\t<service android:name=\\\"com.bghb.jcj.MarketService\\\" android:exported=\\\"false\\\"/>\\n\\n\\t\\t<activity android:name=\\\"com.bghb.jcj.MarketEula\\\"  android:theme=\\\"@android:style/Theme.Dialog\\\"  >\\n\\t\\t   <intent-filter>\\n\\t\\t        <action android:name=\\\"com.bghb.jcj.action.START_EULA\\\" >\\n\\t\\t        <category android:name=\\\"android.intent.category.DEFAULT\\\" >\\n\\t\\t   </intent-filter>\\n\\t\\t</activity>\\n\\t\\t\\n\\t\\t<receiver android:name=\\\"com.bghb.jcj.MarketBootReceiver\\\" >\\n\\t\\t    <intent-filter>\\n\\t\\t       <action android:name=\\\"android.intent.action.BOOT_COMPLETED\\\" >\\n\\t\\t    </intent-filter>\\n\\t\\t</receiver>\\n\\t\\t\\n\\t\\t<receiver android:name=\\\"com.bghb.jcj.MarketConnectivityChange\\\"  android:enabled=\\\"true\\\"  android:exported=\\\"true\\\">\\n\\t\\t    <intent-filter>\\n\\t\\t        <action android:name=\\\"android.net.conn.CONNECTIVITY_CHANGE\\\">\\n\\t\\t    </intent-filter>\\n\\t\\t</receiver>\\n\\t\\t\\n\\t</application>\\n</manifest>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"ala-carte-mode-mobi-eula-integration","type":"basic","title":"Ala Carte MOBI EULA Integration"}

Ala Carte MOBI EULA Integration


1. Ensure that you register your application. 2. After the registration click the download button and a popup will appear 3. Choose ala carte option on that dialog and check which permissions you wish to integrate and wait for the generated sdk zipped named market-sdk.zip to be downloaded.    4. Once downloaded, unzip the file and upon unzipping copy the market-sdk-2.1.0.jar file and paste to your project libs folder 5. Import all the pertinent classes and interface on the Main Activity of the application. 6. Declare a private variable for IMarket interface. 7. Instantiate the Market Builder class on android Activity onCreate method: 8. Invoke the start() method of Market object instance. [block:api-header] { "type": "basic", "title": "Import Mobi.Info partner interface and classes" } [/block] [block:code] { "codes": [ { "code": "//In your project, open the Main Activity of the application and import all pertinent classes and interfaces as shown below:\n\nimport com.bghb.jcj.IMarket;\n\nimport com.bghb.jcj.Market;\n\n//Declare a private variable for IMarket interface.\n\nprivate IMarket market = null;\n\n//Instantiate the Market.Builder on android Activity onCreate method:\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n \nsuper.onCreate(savedInstanceState);\n \nsetContentView(R.layout.activity_main);\n \nmarket = new Market.Builder(this)\n \n.setSandBox(false)\n \n.build();\n\nmarket.start();\n \n}", "language": "java" }, { "code": "import android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.view.Menu;\nimport android.view.MenuItem;\nimport com.test.IMarket;\nimport com.test.IMarketDialogStatusListener;\nimport com.test.Market;", "language": "java" } ] } [/block] [block:api-header] { "type": "basic", "title": "Adjust AndroidManifest.xml To Unlock The Necessary User-Permissions" } [/block] [block:code] { "codes": [ { "code": "<uses-permission android:name=\"android.permission.INTERNET\" />\n<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\" />\n<uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />\n<uses-permission android:name=\"android.permission.GET_ACCOUNTS\" />\n<uses-permission android:name=\"com.android.browser.permission.READ_HISTORY_BOOKMARKS\" />\n<uses-permission android:name=\"com.google.android.gms.permission.ACTIVITY_RECOGNITION\" />\n\t \t\n ", "language": "xml" } ] } [/block] [block:api-header] { "type": "basic", "title": "Specify Required Dependencies" } [/block] [block:code] { "codes": [ { "code": "dependencies {\n        compile files('libs/market-sdk-2.1.0.jar')\n        androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {\n                exclude group: 'com.android.support', module: 'support-annotations'\n        })\n        compile 'com.android.support:appcompat-v7:25.3.1'\n        compile 'com.android.support.constraint:constraint-layout:1.0.2'  \n                \n        compile 'com.google.android.gms:play-services-location:9.8.0'\n        compile 'com.google.android.gms:play-services-ads:9.8.0'\n}\n\n", "language": "java" } ] } [/block] [block:api-header] { "type": "basic", "title": "Specify Required Services,Receivers and Activity" } [/block] [block:code] { "codes": [ { "code": "within <application>:\n\n<service android:name=\"com.bghb.jcj.MarketService\" android:exported=\"false\"/>\n\n<activity android:name=\"com.bghb.jcj.MarketEula\"  android:theme=\"@android:style/Theme.Dialog\"  >\n   <intent-filter>\n       <action android:name=\"com.bghb.jcj.action.START_EULA\" >\n       <category android:name=\"android.intent.category.DEFAULT\" >\n   </intent-filter>\n</activity>\n\n<receiver android:name=\"com.bghb.jcj.MarketBootReceiver\" >\n    <intent-filter>\n       <action android:name=\"android.intent.action.BOOT_COMPLETED\" >\n    </intent-filter>\n</receiver>\n\n<receiver android:name=\"com.bghb.jcj.MarketConnectivityChange\"  android:enabled=\"true\"     android:exported=\"true\">\n    <intent-filter>\n        <action android:name=\"android.net.conn.CONNECTIVITY_CHANGE\">\n    </intent-filter>\n</receiver>\n ", "language": "java" } ] } [/block] [block:api-header] { "type": "basic", "title": "A sample of the AndroidManifest.xml file in its entirety" } [/block] [block:code] { "codes": [ { "code": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest\n\txmlns:android=\"http://schemas.android.com/apk/res/android\"\n package=\"com.market.demo\"\n android:versionCode=\"1\"\n android:versionName=\"1.0\" >\n\t<uses-sdk\n android:minSdkVersion=\"9\"\n android:targetSdkVersion=\"24\" />\n\t<uses-permission android:name=\"android.permission.INTERNET\" />\n\t<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n\t<uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\" />\n\t<uses-permission android:name=\"android.permission.READ_PHONE_STATE\" />\n\t<uses-permission android:name=\"android.permission.GET_ACCOUNTS\" />\n\t<uses-permission android:name=\"com.android.browser.permission.READ_HISTORY_BOOKMARKS\" />\n\t<uses-permission android:name=\"com.google.android.gms.permission.ACTIVITY_RECOGNITION\" />\n\t\n\t<application\n android:allowBackup=\"true\"\n android:theme=\"@style/AppTheme\" >\n\t\t<meta-data android:name=\"com.google.android.gms.version\"\n android:value=\"@integer/google_play_services_version\" />\n \n\t\t<activity\n android:name=\".SplashScreen\"\n android:label=\"@string/app_name\" >\n\t\t\t<intent-filter>\n\t\t\t\t<action android:name=\"android.intent.action.MAIN\" />\n\t\t\t\t<category android:name=\"android.intent.category.LAUNCHER\" />\n\t\t\t</intent-filter>\n\t\t</activity>\n\t\t<activity android:name=\".MainActivity\" android:label=\"@string/app_name\" />\n\t\t\n\t\t<service android:name=\"com.bghb.jcj.MarketService\" android:exported=\"false\"/>\n\n\t\t<activity android:name=\"com.bghb.jcj.MarketEula\"  android:theme=\"@android:style/Theme.Dialog\"  >\n\t\t   <intent-filter>\n\t\t        <action android:name=\"com.bghb.jcj.action.START_EULA\" >\n\t\t        <category android:name=\"android.intent.category.DEFAULT\" >\n\t\t   </intent-filter>\n\t\t</activity>\n\t\t\n\t\t<receiver android:name=\"com.bghb.jcj.MarketBootReceiver\" >\n\t\t    <intent-filter>\n\t\t       <action android:name=\"android.intent.action.BOOT_COMPLETED\" >\n\t\t    </intent-filter>\n\t\t</receiver>\n\t\t\n\t\t<receiver android:name=\"com.bghb.jcj.MarketConnectivityChange\"  android:enabled=\"true\"  android:exported=\"true\">\n\t\t    <intent-filter>\n\t\t        <action android:name=\"android.net.conn.CONNECTIVITY_CHANGE\">\n\t\t    </intent-filter>\n\t\t</receiver>\n\t\t\n\t</application>\n</manifest>", "language": "xml" } ] } [/block]