Android 如何为此使用Firebase远程配置?

Android 如何为此使用Firebase远程配置?,android,firebase,firebase-remote-config,Android,Firebase,Firebase Remote Config,我如何使用Google Firebase远程配置方法在需要Videoview URL时进行更改 更多细节:我有一个视频视图,使用URL来显示视频或流,但我希望能够在需要时更改这些链接。无需创建新的应用程序更新 我的活动: package tk.protvapp.protv; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.os.Bundle; i

我如何使用Google Firebase远程配置方法在需要Videoview URL时进行更改

更多细节:我有一个视频视图,使用URL来显示视频或流,但我希望能够在需要时更改这些链接。无需创建新的应用程序更新

我的活动:

package tk.protvapp.protv;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.MediaController;
import android.widget.VideoView;

public class FoxActivity extends Activity {
    VideoView myVideoView;
    View v;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_fox);

        myVideoView = (VideoView)this.findViewById(R.id.videofox1); MediaController mc = new MediaController(this); myVideoView.setMediaController(mc);
        final String urlStream = "//Search the link in remote config for paste here";
        myVideoView.start();
        myVideoView.findFocus();
        runOnUiThread(new Runnable() { @Override public void run() { myVideoView.setVideoURI(Uri.parse(urlStream)); } });
    }
    public void voltarhomefox(View v){
        Intent intent = new Intent(FoxActivity.this, HomeActivity.class);
        startActivity(intent);
    }
}
我的布局:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:ads="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#000"
    tools:context="tk.protvapp.protv.FoxActivity">


    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:onClick="voltarhomefox"
        android:text="VOLTAR" />

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/button2"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:id="@+id/frameLayout">

        <VideoView
            android:id="@+id/videofox1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </FrameLayout>

</RelativeLayout>

您可以在远程配置仪表板中定义密钥 视频地址= 并使用getStringvideo\uURL方法从代码中获取video\uURL的值