小编bwt*_*bwt的帖子

CoTURN:如何使用TURN REST API?

我已经建立了coturn并成功运行它.IP:192.168.1.111.现在我遇到的问题是通过REST API获取Turn凭证. http://tools.ietf.org/html/draft-uberti-behave-turn-rest-00根据该段落的要求格式应该是

GET /?service=turn&username=mbzrxpgjys

应该是JSON.现在我的问题是:

a)如何配置和命令TURN SERVER使其在REST API模式下运行?

b)如何以正确的格式编写http请求以便TURN SERVER正确回复?你能举个例子吗?

api rest webrtc turn coturn

17
推荐指数
3
解决办法
9019
查看次数

针对 Android 11 时 SpeechRecognizer 不可用

虽然测试增加了targetLevel 30后的应用程序,我发现SpeechRecognizer没有提供任何更多,即SpeechRecognizer.isRecognitionAvailable() 总是返回false。

如果我将 targetLevel 设置回 29,而不更改任何其他内容,则它再次可用。这发生在真实设备(Pixel 3a)和模拟器上。

这似乎不是行为改变。Recognizer API 提到的唯一要求是Manifest.permission.RECORD_AUDIO

我在 logcat 中也没有发现任何线索。

android android-speech-api android-11

12
推荐指数
1
解决办法
2006
查看次数

如何向存储访问框架指示我不再​​需要加载动画?

我正在为Dropbox编写DocumentsProvider.我正在尝试遵循Google指南创建自定义提供程序,以及Ian Lake 在Medium发布的相同内容.

我试图在存储访问框架中包含该功能,其中一个表明有更多数据要加载.

queryChildDocuments()方法的相关部分如下所示:

@Override
public Cursor queryChildDocuments(final String parentDocumentId,
                                  final String[] projection,
                                  final String sortOrder)  {

    if (selfPermissionsFailed(getContext())) {
        // Permissions have changed, abort!
        return null;
    }

    // Create a cursor with either the requested fields, or the default projection if "projection" is null.
    final MatrixCursor cursor = new MatrixCursor(projection != null ? projection : getDefaultDocumentProjection()){
        // Indicate we will be batch loading
        @Override
        public Bundle getExtras() {
            Bundle bundle = new Bundle(); …
Run Code Online (Sandbox Code Playgroud)

storage android frameworks storage-access-framework dropbox-sdk-js

10
推荐指数
1
解决办法
277
查看次数

Compose - 图像重组

在我的视图模型中,我有:

var uri = savedStateHandle.getStateFlow("uri", Uri.EMPTY)
    private set
Run Code Online (Sandbox Code Playgroud)

在我看来:

val uri by viewModel.uri.collectAsState()

                Image(
                    painter = rememberAsyncImagePainter(
                        ImageRequest
                            .Builder(LocalContext.current)
                            .data(data = uri)
                            .build()
                    ),
                    contentDescription = "",
                    modifier = Modifier
                        .padding(vertical = 16.dp)
                        .size(avatarSize.value)
                        .clip(CircleShape)
                        ,
                    contentScale = ContentScale.Crop
                )
Run Code Online (Sandbox Code Playgroud)

当我保存新图像时,它会使用相同的 uri 保存在本地存储中,因此我的图像不会重新组合并显示旧图像。我可以更改 uri,然后按预期重新组合图像,但如何通知我的图像应该重新组合,即使 uri 仍然相同?

android android-jetpack-compose coil

4
推荐指数
1
解决办法
1255
查看次数

改造和简单的问题 - 尝试为Android制作RSS阅读器

我正在尝试使用Retrofit下载XML数据并使用Simple解析它,然后将其加载到ListView中.

不幸的是,下载的数据不会出现在屏幕上 有人能告诉我问题出在哪里吗?

这是我的模特:

@Root(name = "item")
public class Article {
    @Element(name = "title")
    private String title;
    @Element(name = "author")
    private String author;
    @Element(name = "description")
    private String description;
Run Code Online (Sandbox Code Playgroud)

接口代码:

public interface Service {
    @GET("/rss/news")
    public void getArticle(Callback<List<Article>> callback);
}
Run Code Online (Sandbox Code Playgroud)

片段代码:

public class ArticlePreviewFragment extends Fragment {

    protected ArticlePreviewAdapter adapter;
    protected List<Article> previewList;
    private ListView listView;

    public ArticlePreviewFragment() {}

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        previewList = new ArrayList<>();
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) …
Run Code Online (Sandbox Code Playgroud)

java android rss-reader simple-framework retrofit

3
推荐指数
1
解决办法
2622
查看次数

如何删除饼图中的底部空间?

我在我的应用程序中使用饼图,现在饼图显示正常,唯一的问题是饼图底部的空间。以下是饼图的代码,并输出我想要的和我想要得到的。

使用此库绘制饼图

https://github.com/PhilJay/MPAndroidChart

 PieChart pieChart = (PieChart) view.findViewById(R.id.fragment_chart);
        pieChart.setUsePercentValues(true);
        Display display = getActivity().getWindowManager().getDefaultDisplay();
        int height = display.getHeight();  // deprecated

        int offset = (int)(height * 0.65); /* percent to move */

       /* RelativeLayout.LayoutParams rlParams =
                (RelativeLayout.LayoutParams)pieChart.getLayoutParams();
        rlParams.setMargins(0, 0, 0, -offset);
        pieChart.setLayoutParams(rlParams);*/
        // IMPORTANT: In a PieChart, no values (Entry) should have the same
        // xIndex (even if from different DataSets), since no values can be
        // drawn above each other.
        ArrayList<PieEntry> yvalues = new ArrayList<PieEntry>();
        yvalues.add(new PieEntry(8f, 0));
        yvalues.add(new PieEntry(15f, 1)); …
Run Code Online (Sandbox Code Playgroud)

android android-layout pie-chart mpandroidchart

2
推荐指数
1
解决办法
3158
查看次数