简体   繁体   English

Windows Phone 7-Internet连接不可用时,关闭或不初始化应用程序

[英]Windows Phone 7 - Close or Do not initialize an application when internet connection is not available

I am developing an application which is fully depended on internet. 我正在开发完全依赖互联网的应用程序。 So i can detect if the internet connection is available or not. 这样我就可以检测互联网连接是否可用。 But the problem is if the internet connection is not available i have to close the application or the application shouldn't be initialized. 但是问题是,如果互联网连接不可用,我必须关闭该应用程序,否则不应初始化该应用程序。

What exactly i need is this. 我真正需要的是这个。 Two Scenarios one with internet connection available and other is not. 两种方案中的一种可以连接互联网,而另一种则不能。 When the application is opened with internet connection everything will be normal. 通过Internet连接打开应用程序后,一切正常。

When internet connection is not available and the application is opened it should show a message box saying "Sorry no internet connection is found. Application is now closing" and go back to start screen. 当无法使用Internet连接并打开应用程序时,应显示一个消息框,提示"Sorry no internet connection is found. Application is now closing" ,然后返回到开始屏幕。

If you do this your App would not be certified to the marketplace. 如果您这样做,则您的应用将无法通过市场认证。 Even with that error, your app must be responsive. 即使出现该错误,您的应用也必须响应。

I suggest you to create a placeholder in case there is no connection. 我建议您在没有连接的情况下创建一个占位符。

Better is to introduce a option, like shake to re-try connecting (like the Facebook app). 最好是引入一个选项,例如摇动以重试连接 (例如Facebook应用程序)。 Just doing nothing, and enforcing a re-start of the application is a terrible user experience, and just poor craftsmanship. 仅执行任何操作并强制重新启动应用程序是一种糟糕的用户体验,并且工艺水平很差。

And as mentioned by MSicc, any app closing down in any other way than via. 而且正如MSicc所提到的,任何应用程序都可以通过via以外的任何其他方式关闭。 the back-button, won't pass marketplace certification. 后退按钮,不会通过市场认证。

A mobile app needs to endure slow/no-connections in many situations, and it needs to be responsible even if you're doing a operation that requires internet access. 在许多情况下,移动应用程序需要承受慢速/无连接的情况,并且即使您要进行需要访问互联网的操作,也需要负责任。 If it's not, users will give you bad ratings, and nobody will use your app in the end. 如果不是这样,用户会给您不好的评分,最终没人会使用您的应用。

实际上,XNA支持一种方法。

new Microsoft.Xna.Framework.Game().Exit();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何检查Windows Phone 8应用程序中的Internet连接可用性 - How to check the internet connection availability in windows phone 8 application Windows phone7:检查Internet连接可用性 - Windows phone7: Check Internet connection availability Windows Phone 8.1:检查Internet连接 - Windows Phone 8.1: Check Internet Connection Windows Phone 8.1模拟器检查Internet连接 - Windows Phone 8.1 emulator check Internet connection Internet连接可用时,通过API在两个ASP.NET MVC 5应用程序之间共享数据 - Sharing data between two asp.net mvc 5 application through api when internet connection available WinForms - 当应用程序启动时没有可用的互联网连接时,mscorlib.dll 中的 System.Reflection.TargetInvocationException - WinForms - System.Reflection.TargetInvocationException in mscorlib.dll when no internet connection is available on application start 在“开始”按钮上关闭应用程序(Windows Phone 7) - Close Application on START Button (Windows Phone 7) 应用程序关闭 Windows Phone 时的析构函数崩溃 - Destructor crash on application close windows phone 当应用程序关闭时,DB连接会立即关闭吗? - When application close, will DB connection close instantly? Blazor 当没有可用的 inte.net 时,服务器应用程序速度很慢 - Blazor Server application is slow when there is no internet available
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM