在 Android 应用程序中显示启动消息的好方法是什么?

发布于 2024-10-03 22:26:53 字数 277 浏览 0 评论 0原文

总之,

我正在开发一个 Android 应用程序,该应用程序在启动时通过 TCP(通过 WiFi)连接到其他硬件。我对处理连接的软件非常满意——它在建立套接字连接以及连接意外丢失时的处理方面做得很好。

不幸的是,我的应用程序目前只显示一个空白的屏幕,直到建立连接为止,我预计这种事情可能会给我的用户带来不必要的担忧。

我不知道如何发布一条启动消息,通知用户我有一条毛巾,无需惊慌。有人能指出我实现此目标的方法吗?我会对任何清晰的内容感到满意,无论是图形还是文本。

谢谢, R。

All,

I'm developing an Android application that connects to other hardware on start up via TCP (over WiFi) . I'm pretty happy with the software that handles the connection -- it does a good job of establishing the socket connection as well as handling things when the connection is unexpectedly lost.

Unfortunately, my application currently just displays a blank, empty screen until the connection is established, and I expect that this sort of thing may produce unwarranted worry on the part of my users.

I can't figure out how to put up a start-up message informing the user that I have a towel and that there's no need to panic. Can anybody point me to a method for accomplishing this? I'll be happy with just about anything that's legible, whether graphical or textual.

Thanks,
R.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

你的往事 2024-10-10 22:26:53

无论您选择什么,您都需要显示启动屏幕,更重要的是在建立 TCP 连接之前开始响应 UI 事件 - 即,您不应该在 UI 线程上尝试 TCP 连接,就好像它需要比预期更长的时间您可能会收到应用程序未响应错误。

Whatever you choose, you need to get the startup screen displayed and more importantly start responding to UI events before the TCP connection is made - ie, you shouldn't do the TCP connection attempt on the UI thread, as if it takes longer than expected you may get an application not responding error.

情深如许 2024-10-10 22:26:53

AsyncTask 中进行网络连接(另一个线程,因此不会阻塞用户界面)。然后就可以在UI中显示各种进度指示器了。

Do the networking in AsyncTask (another thread, so it won't block the UI). Then you can display all kinds of progress indicators in the UI.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文