【问题标题】:Implementation of Android EventSource Using Git REPO https://github.com/streamdataio/eventsource-android/ private onConnect Error使用 Git REPO 实现 Android EventSource https://github.com/streamdataio/eventsource-android/ private onConnect 报错
【发布时间】:2016-05-28 04:49:43
【问题描述】:

我正在使用 https://github.com/streamdataio/eventsource-android/ 的 EventSource REPO 我创建了一个 onConnect ();方法,然而, eventsource.connect();method 带有红色下划线并说我无法访问它,因为它是私有的?我在网上看了,每个人都使用这个 REPO 没有问题,这是怎么回事?

 private void connect() {
    // Create headers: Add the streamdata.io app token
    Map<String, String> headers = new HashMap<String, String>();
    headers.put("X-Sd-Token", streamdataioAppToken);

    // Create the EventSource with API URL & Streamdata.io authentication token
    try {
        eventSource = new EventSource(new URI(streamdataioProxyPrefix), new URI(myApiUrl), new SSEHandler(), headers);
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }

    // Start data receiving
    eventSource.connect();

}

【问题讨论】:

    标签: android git github private eventsource


    【解决方案1】:

    我是来自 streamdata.io 的 Lorie。感谢您查看我们的示例项目。事实上,您是第一个报告此类问题的用户。您提供的这段代码似乎没有任何问题。请确保您的 eventSource 对象在您的代码中较早声明为 EventSource 类型,并且您导入了正确的 EventSource 类:tylerjroach.com.eventsource_android.EventSource; 如果您仍然遇到此问题,我建议您将代码放在 GitHub 公共存储库中并将链接发送给我们,以便我们帮助您解决此问题。

    【讨论】:

    • 您好,我想知道添加 REPO 可能是一个错误。我按照这个过程,克隆了 REPO,组装了发布,构建了 APK,然后我将它作为一个模块添加到我的 android studio 项目中,并将它作为编译依赖项添加到我的应用程序中。这是正确的程序吗?
    • 你们还有公司号吗...?
    • 是的,它似乎无法识别我导入的 org.jboss.netty.channel.ChannelFuture 连接
    • 如需进一步帮助,请向我们发送 GitHub 存储库链接,我们可以在该链接中浏览您的整个代码,看看我们是否找到问题的根源。要联系流数据支持,请发送电子邮件至 support@streamdata.io
    猜你喜欢
    • 1970-01-01
    • 2022-07-19
    • 1970-01-01
    • 2019-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-28
    • 1970-01-01
    相关资源
    最近更新 更多