@@ -13,29 +13,46 @@ and can follow the commands described in this README as is. For OEMs to use the
13
13
flavor, you will need to update the "Preview" part of the commands to "Oems", all other instructions
14
14
are the same.
15
15
16
- ## Running the Sample
16
+ ## Defining the SDK API
17
+ The SDK running in the Privacy Sandbox needs a public API defined with Kotlin interfaces and
18
+ annotated with Privacy Sandbox tool annotations. This allows us to generate an SDK provider that
19
+ compatible with your custom interfaces. To use it just extend ` AbstractSandboxedSdkProviderCompat ` ,
20
+ it will be generated in the same package that defined the ` @PrivacySandboxService ` interface.
17
21
18
- The Privacy Sandbox should have a class which extends ` SandboxedSdkProvider ` .
19
- This class works as an entry point for the sandbox to interact with the SDK.
20
- The Privacy Sandbox SDK provider library is implemented in the ` sdk-implementation ` module.
22
+ ## Running the Sample
23
+ The sample contains a working SDK in the ` example-sdk ` module. The SDK is bundled for release and
24
+ app consumption in the ` example-sdk-bundle ` module, this is where the SDK version, package name and
25
+ signing information is defined.
21
26
22
- The client app is implemented in the ` client-app ` module. This app interacts with the SDK running
23
- in the Privacy Sandbox.
27
+ The client app is implemented in the ` client-app ` module. The ` existing-sdk ` module represents a
28
+ modified version of a regular SDK that runs in the app as usual but is also capable of loading and
29
+ interacting with the example SDK.
24
30
25
31
There are two methods for building and installing the SDK. The preferred option is use Android
26
- Studio's UI to handle building and deploying the SDK and launching the client app. However, it is
32
+ Studio's UI to handle building and deploying the SDK and launching the client app. However, it is
27
33
possible to build the app bundle and install the APK via the command line, then run the client app.
28
34
29
- ### From the UI
35
+ ### Setting up your device
36
+ You will need to override a few flags to get the Privacy Sandbox enabled on your device. Before
37
+ installing the app, run the following commands:
38
+
39
+ ``` shell
40
+ adb shell device_config put adservices adservice_system_service_enabled false
41
+ adb shell device_config put adservices global_kill_switch false
42
+ adb shell device_config put adservices disable_sdk_sandbox false
43
+ adb shell device_config put adservices sdksandbox_customized_sdk_context_enabled true
44
+ ```
45
+
46
+ ### Launch sample from the UI
30
47
In Android Studio, edit your run configuration as follows:
31
- Edit run configurations > client-app > Deploy > Default APK. Then, under Launch Options,
48
+ Edit run configurations > client-app > Deploy > APK from app bundle . Then, under Launch Options,
32
49
Launch > Specified Activity > Activity > ` com.example.client.MainActivity `
33
50
34
51
Press the run button. Your app should launch and you can proceed to the
35
52
[ Testing the client] ( #testing-the-client ) section.
36
53
37
54
### Command Line
38
- Build the APK bundle by running
55
+ Build the APK bundle by running
39
56
40
57
``` shell
41
58
./gradlew client-app:buildPrivacySandboxSdkApksForPreviewDebug
@@ -54,8 +71,7 @@ Finally, run the client app via Android Studio's UI.
54
71
### Testing the client
55
72
56
73
- Click on the "load SDK" button, a toast should show that SDK loaded successfully.
57
- - Click on the "Request Webview", this should remote render a webview from the
58
- sandbox to be viewed inside the activity .
74
+ - Click on the "Show banner view" after the SDK is loaded and a banner rendered by the SDK will be
75
+ displayed. If you click it, an Activity customized by the SDK will be launched .
59
76
60
77
- For more information, please read the [ documentation] ( https://developer.android.com/design-for-safety/privacy-sandbox/guides/sdk-runtime ) .
61
-
0 commit comments