Six steps of SDK integration for Android receiver with dolphin star scanning code and screen casting

Time:2020-10-19

Scan the code and cast the screen, open the network, monopolize the device, do not need to download additional software, scan the wechat code, and discover the device. Support standard DLNA protocol and double speed playback. Video, audio, picture projection. It’s better. It also supports custom operation actions based on DLNA extension. It seems to charge. I didn’t experience it.

Here is a brief record of the integration process.

Follow the catalog build.gradle Add private mevan warehouse

maven {url 'http://nexus.dolphinstar.cn/repo/openmavenx'}

II. App/ build.gradle

2.1 adding dependencies

implementation 'cn.dolphinstar:playerCore:3.0.20'

2.2 enable java8 support

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

3. Authority

4. Network

Note that after Android 9, HTTPS is forced to support HTTP. Should be in AndroidManifest.xml Add the application node of

android:networkSecurityConfig="@xml/network_security_config"

network_security_config.xml

5. Appid

go toDolphin star platform control centerRegister and create an app to get appid

In APP / SRC / main / assets
Add file dpsappinfo
Add build value pair
APPID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

6. Start up service

//Start configuration
StartUpCfg cfg = new StartUpCfg();
cfg.PlayerName = "MY TV-" +(int) (Math.random() * 900 + 100);
cfg.AppSecret  ="; // secret of app
//Start service
MYOUPlayer.of(MainActivity.this)
    .StartService(cfg)
    .subscribe(s -> {
       //Screen casting service started successfully
       Log. E ("mainactivity", "display service started successfully");
    }, e -> {
       //Screen casting service failed to start
        Log. E ("mainactivity", "screen projection service startup failed): + e.getmessage());
    });

Finish it!!!