{"_id":"597aba0623d0290026b95900","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":2,"parentDoc":null,"metadata":{"title":"","description":"","image":[]},"updates":["59b60c93b822d80010b844dd","5a27f6a4eaec590012c5501f"],"next":{"pages":[],"description":""},"createdAt":"2017-07-28T04:13:58.636Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"These are the step-by-step procedures to integrate an application for Activity EULA\n\n1. Ensure that you register your application.\n2. After the registration click the download button and a popup will appear\n3. Choose Bundled option and wait for the generated sdk zipped named market-sdk.zip to be downloaded.\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. For your Custom EULA Activity just follow procedure #2 and place the instantiation of class on EULA activity onCreate method and omit the marketPartner.start() code snippet. For the EULA Activity buttons, Ok/Accept, invoke the code snippet marketPartner.onEulaAccepted() otherwise invoke marketPartner.onEulaDeclined() for Cancel/Decline button click.\n7. Add all applicable permissions on your AndroidManifest.xml file.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Import Mobi.Info partner interfaces 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.cf.iie.partner.IMarketPartner;\\n\\nimport com.cf.iie.partner.MarketPartner;\\n\\n//Create an instance of IMarketPartner interface. Place this code snippet in your Main //Activity onCreate or the    button click event\\n\\n:::at:::Override\\nprotected void onCreate(Bundle savedInstanceState) {\\n  \\n\\tsuper.onCreate(savedInstanceState);\\n  \\n\\tsetContentView(R.layout.activity_main);\\n                \\n\\tIMarketPartner marketPartner = new MarketPartner.Builder(MainActivity.this)\\n        \\n//The type of EULA to be use\\n//Set the value  to IMarketPartner.EULA.ACTIVITY in order for MOBI service to know what //type of EULA was set.\\n\\t.setPartnerEulaType(IMarketPartner.EULA.ACTIVITY)\\n                                                      \\n//this need to be set in order for the service know where the custom activity is located.\\n//Contains the package name and the Activity name of your custom EULA.\\n//If for example your current EULA package is com.eula.test and your Activity was named CustomEulaActivity\\n//the value to be set should be com.eula.test.CustomEulaActivity\\n\\t.setPartnerEula(\\\"com.eula.test.CustomEulaActivity\\\")                                                                        \\n//Optional if only you wish to add additional information to be transmitted to the MOBI server for example\\n//Your own appid or any identifier which you think is useful for future log checking\\n\\t.addIntegrationData(\\\"test_key_1\\\",\\\"data you wish to add\\\")\\n  \\n\\t.addIntegrationData(\\\"test_key_2\\\",\\\"data you wish to add\\\")\\n  \\n\\t.build();\\n  \\n\\tmarketPartner.start();          \\n\\n}\\n\\n//For your Custom EULA Activity follow procedure #2 and place the instantiation of class //on EULA activity onCreate method and omit the marketPartner.start() code snippet. \\n//For the EULA Activity buttons, Ok/Accept, invoke the code snippet   marketPartner.onEulaAccepted() otherwise invoke marketPartner.onEulaDeclined() for //Cancel/Decline button click.\\npublic class CustomEulaActivity extends Activity implements OnClickListener{\\n  \\n     private IMarketPartner marketPartner = null;\\n        \\n     @Override\\n     protected void onCreate(Bundle savedInstanceState) {\\n          \\n        super.onCreate(savedInstanceState);\\n\\n        this.setTheme(android.R.style.Theme_Dialog);\\n          \\n        requestWindowFeature(Window.FEATURE_NO_TITLE);\\n          \\n        setContentView(R.layout.eula_activity);\\n                \\n        marketPartner = new MarketPartner.Builder(MainActivity.this)\\n                \\n \\n//The type of EULA to be use\\n//Set the value  to IMarketPartner.EULA.ACTIVITY in order for MOBI service to know what type of EULA was set.\\n\\t.setPartnerEulaType(IMarketPartner.EULA.ACTIVITY)                                                            \\n                                                        \\n//this need to be set in order for the service know where the custom activity located.\\n//Contains the package name and the Activity name of your custom EULA.\\n//If for example your current EULA package is com.eula.test and your Acitivity was named //CustomEulaActivity\\n//the value to be set should be com.eula.test.CustomEulaActivity. \\n\\t.setPartnerEula(\\\"com.eula.test.CustomEulaActivity\\\")\\n\\n//Optional if only you wish to add additional information to be transmitted to the MOBI server for example\\n//Your own appid or any identifier which you think is useful for future log checking\\n\\t.addIntegrationData(\\\"test_key_1\\\",\\\"data you wish to add\\\")\\n\\n\\t.addIntegrationData(\\\"test_key_2\\\",\\\"data you wish to add\\\")\\n\\n\\t.build();                       \\n               \\n\\tButton btnOk = (Button)findViewById(R.id.btnOk);\\n       \\n\\tButton btnDecline = (Button)findViewById(R.id.btnDecline);              \\n        }\\n        \\n        public void onClick(View view) {\\n          \\n                int id = view.getId();\\n          \\n                switch(id){\\n                    \\n                        case R.id.btnOk:\\n                    \\n                                marketPartner.onEulaAccepted();\\n                    \\n                                break;\\n                    \\n                        case R.id.btnDecline: \\n                    \\n                                marketPartner.onEulaDeclined();\\n                    \\n                                break;\\n                    \\n                        default: break;\\n                }\\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=\\\"android.permission.ACCESS_FINE_LOCATION\\\" />\\n<uses-permission android:name=\\\"android.permission.BLUETOOTH\\\" />\\n<uses-permission android:name=\\\"android.permission.BLUETOOTH_ADMIN\\\" />\\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        {\\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 'org.altbeacon:android-beacon-library:2.7'\\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\"\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.cf.iie.MarketService\\\" android:exported=\\\"false\\\"/>\\n<service android:name=\\\"com.cf.iie.MarketBeaconService\\\" android:enabled=\\\"true\\\" android:exported=\\\"false\\\" >\\n  \\n<activity android:name=\\\"com.cf.iie.MarketEula\\\"  android:theme=\\\"@android:style/Theme.Dialog\\\"  >\\n   <intent-filter>\\n        <action android:name=\\\"com.cf.iie.action.START_EULA\\\" >\\n        <category android:name=\\\"android.intent.category.DEFAULT\\\" >\\n   </intent-filter>\\n</activity>\\n\\n<receiver android:name=\\\"com.cf.iie.MarketBootReceiver\\\" >\\n    <intent-filter>\\n       <action android:name=\\\"android.intent.action.BOOT_COMPLETED\\\" >\\n    </intent-filter>\\n</receiver>\\n\\n<receiver android:name=\\\"com.cf.iie.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<service\\n        android:name=\\\"org.altbeacon.beacon.service.BeaconService\\\"\\n        android:enabled=\\\"true\\\"\\n        android:exported=\\\"false\\\"\\n        android:isolatedProcess=\\\"false\\\"\\n        android:label=\\\"beacon\\\" />\\n\\n<service\\n        android:name=\\\"org.altbeacon.beacon.BeaconIntentProcessor\\\"\\n        android:enabled=\\\"true\\\"\\n        android:exported=\\\"false\\\" />\\n\\n<receiver android:name=\\\"org.altbeacon.beacon.startup.StartupBroadcastReceiver\\\">\\n    <intent-filter>\\n\\t\\t<action android:name=\\\"android.intent.action.BOOT_COMPLETED\\\" />\\n\\t\\t<action android:name=\\\"android.intent.action.ACTION_POWER_CONNECTED\\\" />\\n\\t\\t<action android:name=\\\"android.intent.action.ACTION_POWER_DISCONNECTED\\\"/>\\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\\tpackage=\\\"com.market.demo\\\"\\n\\tandroid:versionCode=\\\"1\\\"\\n\\tandroid:versionName=\\\"1.0\\\" >\\n\\t<uses-sdk\\n\\t\\tandroid:minSdkVersion=\\\"9\\\"\\n\\t\\tandroid:targetSdkVersion=\\\"24\\\" />\\n\\t\\t\\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=\\\"android.permission.ACCESS_FINE_LOCATION\\\" />\\n\\t<uses-permission android:name=\\\"android.permission.BLUETOOTH\\\" />\\n\\t<uses-permission android:name=\\\"android.permission.BLUETOOTH_ADMIN\\\" />\\n\\t<uses-permission android:name=\\\"com.google.android.gms.permission.ACTIVITY_RECOGNITION\\\" />\\n\\t\\n\\t<application\\n\\t\\t\\t   android:allowBackup=\\\"true\\\"\\n\\t\\t\\t   android:theme=\\\"@style/AppTheme\\\" >\\n\\t\\t<meta-data android:name=\\\"com.google.android.gms.version\\\"\\n\\t\\t\\t   android:value=\\\"@integer/google_play_services_version\\\" />\\n \\n\\t\\t<activity\\n\\t\\t\\t  android:name=\\\".SplashScreen\\\"\\n\\t\\t\\t  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 \\n\\t\\t<activity android:name=\\\".MainActivity\\\"  android:label=\\\"@string/app_name\\\" />\\n\\t\\t<service android:name=\\\"com.cf.iie.MarketService\\\" android:exported=\\\"false\\\"/>\\n\\t\\t<service android:name=\\\"com.cf.iie.MarketBeaconService\\\" android:enabled=\\\"true\\\" android:exported=\\\"false\\\" >\\n\\t\\t<activity android:name=\\\"com.cf.iie.MarketEula\\\"  android:theme=\\\"@android:style/Theme.Dialog\\\"  >\\n\\t\\t\\t<intent-filter>\\n\\t\\t\\t\\t<action android:name=\\\"com.cf.iie.action.START_EULA\\\" >\\n\\t\\t\\t\\t<category android:name=\\\"android.intent.category.DEFAULT\\\" >\\n\\t\\t\\t</intent-filter>\\n\\t\\t</activity>\\n    \\n\\t\\t<receiver android:name=\\\"com.cf.iie.MarketBootReceiver\\\" >\\n\\t\\t\\t<intent-filter>\\n\\t\\t\\t\\t<action android:name=\\\"android.intent.action.BOOT_COMPLETED\\\" >\\n\\t\\t\\t\\t</intent-filter>\\n\\t\\t</receiver>\\n    \\n\\t\\t<receiver android:name=\\\"com.cf.iie.MarketConnectivityChange\\\"  android:enabled=\\\"true\\\"     android:exported=\\\"true\\\">\\n\\t\\t\\t<intent-filter>\\n\\t\\t\\t\\t<action android:name=\\\"android.net.conn.CONNECTIVITY_CHANGE\\\">\\n\\t\\t\\t</intent-filter>\\n\\t\\t</receiver>\\n    \\n\\t\\t<service\\n\\t\\t\\tandroid:name=\\\"org.altbeacon.beacon.service.BeaconService\\\"\\n\\t\\t\\tandroid:enabled=\\\"true\\\"\\n\\t\\t\\tandroid:exported=\\\"false\\\"\\n\\t\\t\\tandroid:isolatedProcess=\\\"false\\\"\\n\\t\\t\\tandroid:label=\\\"beacon\\\" />\\n \\n\\t\\t<service       \\n\\t\\t\\tandroid:name=\\\"org.altbeacon.beacon.BeaconIntentProcessor\\\"\\n\\t\\t\\tandroid:enabled=\\\"true\\\"\\n\\t\\t\\tandroid:exported=\\\"false\\\" />\\n \\n\\t\\t<receiver android:name=\\\"org.altbeacon.beacon.startup.StartupBroadcastReceiver\\\">\\n\\t\\t\\t<intent-filter>\\n\\t\\t\\t\\t<action android:name=\\\"android.intent.action.BOOT_COMPLETED\\\" />\\n\\t\\t\\t\\t<action android:name=\\\"android.intent.action.ACTION_POWER_CONNECTED\\\" />\\n\\t\\t\\t\\t<action android:name=\\\"android.intent.action.ACTION_POWER_DISCONNECTED\\\"/>\\n\\t\\t\\t</intent-filter>\\n\\t\\t</receiver>\\n     \\n\\t</application>\\n</manifest>\\n\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"This page will help you get started with Activity EULA Integration. To use this documentation accordingly a publisher MUST be a registered mobi partner otherwise it will be for naught.","slug":"activity-eula-integration","type":"basic","title":"Activity EULA Integration"}

Activity EULA Integration

This page will help you get started with Activity EULA Integration. To use this documentation accordingly a publisher MUST be a registered mobi partner otherwise it will be for naught.

These are the step-by-step procedures to integrate an application for Activity EULA 1. Ensure that you register your application. 2. After the registration click the download button and a popup will appear 3. Choose Bundled option 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. For your Custom EULA Activity just follow procedure #2 and place the instantiation of class on EULA activity onCreate method and omit the marketPartner.start() code snippet. For the EULA Activity buttons, Ok/Accept, invoke the code snippet marketPartner.onEulaAccepted() otherwise invoke marketPartner.onEulaDeclined() for Cancel/Decline button click. 7. Add all applicable permissions on your AndroidManifest.xml file. [block:api-header] { "type": "basic", "title": "Import Mobi.Info partner interfaces 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.cf.iie.partner.IMarketPartner;\n\nimport com.cf.iie.partner.MarketPartner;\n\n//Create an instance of IMarketPartner interface. Place this code snippet in your Main //Activity onCreate or the button click event\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n \n\tsuper.onCreate(savedInstanceState);\n \n\tsetContentView(R.layout.activity_main);\n \n\tIMarketPartner marketPartner = new MarketPartner.Builder(MainActivity.this)\n \n//The type of EULA to be use\n//Set the value to IMarketPartner.EULA.ACTIVITY in order for MOBI service to know what //type of EULA was set.\n\t.setPartnerEulaType(IMarketPartner.EULA.ACTIVITY)\n \n//this need to be set in order for the service know where the custom activity is located.\n//Contains the package name and the Activity name of your custom EULA.\n//If for example your current EULA package is com.eula.test and your Activity was named CustomEulaActivity\n//the value to be set should be com.eula.test.CustomEulaActivity\n\t.setPartnerEula(\"com.eula.test.CustomEulaActivity\") \n//Optional if only you wish to add additional information to be transmitted to the MOBI server for example\n//Your own appid or any identifier which you think is useful for future log checking\n\t.addIntegrationData(\"test_key_1\",\"data you wish to add\")\n \n\t.addIntegrationData(\"test_key_2\",\"data you wish to add\")\n \n\t.build();\n \n\tmarketPartner.start(); \n\n}\n\n//For your Custom EULA Activity follow procedure #2 and place the instantiation of class //on EULA activity onCreate method and omit the marketPartner.start() code snippet. \n//For the EULA Activity buttons, Ok/Accept, invoke the code snippet marketPartner.onEulaAccepted() otherwise invoke marketPartner.onEulaDeclined() for //Cancel/Decline button click.\npublic class CustomEulaActivity extends Activity implements OnClickListener{\n \n private IMarketPartner marketPartner = null;\n \n @Override\n protected void onCreate(Bundle savedInstanceState) {\n \n super.onCreate(savedInstanceState);\n\n this.setTheme(android.R.style.Theme_Dialog);\n \n requestWindowFeature(Window.FEATURE_NO_TITLE);\n \n setContentView(R.layout.eula_activity);\n \n marketPartner = new MarketPartner.Builder(MainActivity.this)\n \n \n//The type of EULA to be use\n//Set the value to IMarketPartner.EULA.ACTIVITY in order for MOBI service to know what type of EULA was set.\n\t.setPartnerEulaType(IMarketPartner.EULA.ACTIVITY) \n \n//this need to be set in order for the service know where the custom activity located.\n//Contains the package name and the Activity name of your custom EULA.\n//If for example your current EULA package is com.eula.test and your Acitivity was named //CustomEulaActivity\n//the value to be set should be com.eula.test.CustomEulaActivity. \n\t.setPartnerEula(\"com.eula.test.CustomEulaActivity\")\n\n//Optional if only you wish to add additional information to be transmitted to the MOBI server for example\n//Your own appid or any identifier which you think is useful for future log checking\n\t.addIntegrationData(\"test_key_1\",\"data you wish to add\")\n\n\t.addIntegrationData(\"test_key_2\",\"data you wish to add\")\n\n\t.build(); \n \n\tButton btnOk = (Button)findViewById(R.id.btnOk);\n \n\tButton btnDecline = (Button)findViewById(R.id.btnDecline); \n }\n \n public void onClick(View view) {\n \n int id = view.getId();\n \n switch(id){\n \n case R.id.btnOk:\n \n marketPartner.onEulaAccepted();\n \n break;\n \n case R.id.btnDecline: \n \n marketPartner.onEulaDeclined();\n \n break;\n \n default: break;\n }\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=\"android.permission.ACCESS_FINE_LOCATION\" />\n<uses-permission android:name=\"android.permission.BLUETOOTH\" />\n<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" />\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 {\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 'org.altbeacon:android-beacon-library:2.7'\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", "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.cf.iie.MarketService\" android:exported=\"false\"/>\n<service android:name=\"com.cf.iie.MarketBeaconService\" android:enabled=\"true\" android:exported=\"false\" >\n \n<activity android:name=\"com.cf.iie.MarketEula\" android:theme=\"@android:style/Theme.Dialog\" >\n <intent-filter>\n <action android:name=\"com.cf.iie.action.START_EULA\" >\n <category android:name=\"android.intent.category.DEFAULT\" >\n </intent-filter>\n</activity>\n\n<receiver android:name=\"com.cf.iie.MarketBootReceiver\" >\n <intent-filter>\n <action android:name=\"android.intent.action.BOOT_COMPLETED\" >\n </intent-filter>\n</receiver>\n\n<receiver android:name=\"com.cf.iie.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<service\n android:name=\"org.altbeacon.beacon.service.BeaconService\"\n android:enabled=\"true\"\n android:exported=\"false\"\n android:isolatedProcess=\"false\"\n android:label=\"beacon\" />\n\n<service\n android:name=\"org.altbeacon.beacon.BeaconIntentProcessor\"\n android:enabled=\"true\"\n android:exported=\"false\" />\n\n<receiver android:name=\"org.altbeacon.beacon.startup.StartupBroadcastReceiver\">\n <intent-filter>\n\t\t<action android:name=\"android.intent.action.BOOT_COMPLETED\" />\n\t\t<action android:name=\"android.intent.action.ACTION_POWER_CONNECTED\" />\n\t\t<action android:name=\"android.intent.action.ACTION_POWER_DISCONNECTED\"/>\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\tpackage=\"com.market.demo\"\n\tandroid:versionCode=\"1\"\n\tandroid:versionName=\"1.0\" >\n\t<uses-sdk\n\t\tandroid:minSdkVersion=\"9\"\n\t\tandroid:targetSdkVersion=\"24\" />\n\t\t\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=\"android.permission.ACCESS_FINE_LOCATION\" />\n\t<uses-permission android:name=\"android.permission.BLUETOOTH\" />\n\t<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\" />\n\t<uses-permission android:name=\"com.google.android.gms.permission.ACTIVITY_RECOGNITION\" />\n\t\n\t<application\n\t\t\t android:allowBackup=\"true\"\n\t\t\t android:theme=\"@style/AppTheme\" >\n\t\t<meta-data android:name=\"com.google.android.gms.version\"\n\t\t\t android:value=\"@integer/google_play_services_version\" />\n \n\t\t<activity\n\t\t\t android:name=\".SplashScreen\"\n\t\t\t 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 \n\t\t<activity android:name=\".MainActivity\" android:label=\"@string/app_name\" />\n\t\t<service android:name=\"com.cf.iie.MarketService\" android:exported=\"false\"/>\n\t\t<service android:name=\"com.cf.iie.MarketBeaconService\" android:enabled=\"true\" android:exported=\"false\" >\n\t\t<activity android:name=\"com.cf.iie.MarketEula\" android:theme=\"@android:style/Theme.Dialog\" >\n\t\t\t<intent-filter>\n\t\t\t\t<action android:name=\"com.cf.iie.action.START_EULA\" >\n\t\t\t\t<category android:name=\"android.intent.category.DEFAULT\" >\n\t\t\t</intent-filter>\n\t\t</activity>\n \n\t\t<receiver android:name=\"com.cf.iie.MarketBootReceiver\" >\n\t\t\t<intent-filter>\n\t\t\t\t<action android:name=\"android.intent.action.BOOT_COMPLETED\" >\n\t\t\t\t</intent-filter>\n\t\t</receiver>\n \n\t\t<receiver android:name=\"com.cf.iie.MarketConnectivityChange\" android:enabled=\"true\" android:exported=\"true\">\n\t\t\t<intent-filter>\n\t\t\t\t<action android:name=\"android.net.conn.CONNECTIVITY_CHANGE\">\n\t\t\t</intent-filter>\n\t\t</receiver>\n \n\t\t<service\n\t\t\tandroid:name=\"org.altbeacon.beacon.service.BeaconService\"\n\t\t\tandroid:enabled=\"true\"\n\t\t\tandroid:exported=\"false\"\n\t\t\tandroid:isolatedProcess=\"false\"\n\t\t\tandroid:label=\"beacon\" />\n \n\t\t<service \n\t\t\tandroid:name=\"org.altbeacon.beacon.BeaconIntentProcessor\"\n\t\t\tandroid:enabled=\"true\"\n\t\t\tandroid:exported=\"false\" />\n \n\t\t<receiver android:name=\"org.altbeacon.beacon.startup.StartupBroadcastReceiver\">\n\t\t\t<intent-filter>\n\t\t\t\t<action android:name=\"android.intent.action.BOOT_COMPLETED\" />\n\t\t\t\t<action android:name=\"android.intent.action.ACTION_POWER_CONNECTED\" />\n\t\t\t\t<action android:name=\"android.intent.action.ACTION_POWER_DISCONNECTED\"/>\n\t\t\t</intent-filter>\n\t\t</receiver>\n \n\t</application>\n</manifest>\n", "language": "xml" } ] } [/block]