Windows Mobile 开发 - 从哪里开始? [英] Windows Mobile Development - Where to begin?

查看:37
本文介绍了Windows Mobile 开发 - 从哪里开始?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我很快就会开始 Windows 移动开发的道路.我对这个主题一无所知,我正在寻找有经验的人让我知道您可能知道的任何问题.

Okay, I will shortly be starting down the path of windows mobile development. I know nothing about the subject really and I am looking for people with experience to let me know of any gottchas you may know of.

现在我什至不知道需要什么,但假设应用程序只是一堆用于更新数据的 CRUD 表单.我所拥有的唯一其他要求知识是,当没有可用信号时,应用程序将需要支持离线存储.当信号返回时,这显然需要某种同步.

Right now I dont even have a breif of what is requied but the assumption is that the application will be very little more than a bunch of CRUD forms for updating data. The only other requirment knowladge I have is that the application will need to support offline storage when there is no signal avaliable. This in turn will obviously require some kind of syncronization when signal returns.

我最初的想法是,该应用程序将主要作为与 Web 服务层交互的前端.我假设 WCF 将是构建这些服务的合适技术?我还认为 SQL Server CE 是解决离线存储问题的好方法.

My initial thoughts are that the application will primarily be a front end to interact with a web service layer. Im assuming that WCF will be an appropriate technology for building these services? I also thought that SQL Server CE would be a good route to go down with regards to the offline storage issues.

您认为在该领域内有用的任何知识将不胜感激.建议,链接,书籍任何赞赏.

Any knowlage that you feel is useful within this domain would be appreciated. Advice, links, books anything appreciated.

已经注意到有两种方法可以进行离线同步.要么使用某种形式的消息队列,要么使用 SQL 同步工具.任何人都可以对这些进行比较和介绍吗?

It has been noted that there are two ways to go with off-line synchronization. To either use some form of message queuing or to use SQL synchronization tools. Could anyone offer a good comparison and introduction to these?

编辑 2:经过更多的挖掘,我的印象是基本上可以使用 3 种不同的方法:

EDIT 2: After a little more digging I get the impression that there are basically 3 different approaches I can use here:

  1. 嵌入式数据库,可在可能的情况下查询然后在线同步
  2. MSMQ 和 .NET 远程处理
  3. WCF 与使用 Exchange Server 的 ExchangeWebServiceMailTransport 绑定.​​

现在,关于第一个问题已经提出了一些很好的观点,我想我在某种程度上理解了我将面临的问题.但我想获得更多关于 MSMQ 实现和使用 WCF 新绑定的信息.

Now, there has been a nice few points raised on the first issue, and I think I understand at some level the issues I would face. But I'd like to get a little more information regarding MSMQ implementations and using WCFs new bindings.

推荐答案

这里是我迄今为止(大约 9 个月)的 .net Windows Mobile 开发经验的几句话.

Here a few words from my experience so far (about 9 months) of .net Windows Mobile development.

  1. 嗯,你偶尔会联系上.(或者更有可能偶尔断开连接).您必须选择是否要使用队列消息传递(即 WCF/SOAP/XML 或类似的东西)或数据库同步.我选择了 SQL 同步路线,所以我无法真正评论消息传递.SQL 同步路由不轻松!

  1. Well you are occasionally connected. (Or more likely occasionally disconnected). You have to choose whether you are going to use messaging with queues (i.e. WCF/SOAP/XML or something like it) or database synchronisation. I choose the SQL synchronisation route so I can't really comment on messaging. The SQL synchronisation route is not hassle free!

如果您像我一样使用 SQL compact 沿着同步路线走下去,您基本上有两种选择.SQL Server 合并复制或较新的 ADO.NET 同步服务.如果你选择前者,你需要非常小心你的数据库设计,以确保它可以很容易地在移动订阅者和发布者之间进行分区.您确实需要考虑冲突,并且拆分通常不会在规范化数据库设计中拆分的表是一种方法.您必须考虑设备离线一段时间并且发布者 DB(即主 DB)和/或订阅者更改相同数据的情况.当设备重新联机时会发生什么?即使您已经很好地划分了事物,这也可能意味着解决冲突.这是我被烧死的地方.但是 SQL 合并复制可以很好地工作并减少您必须编写的代码量.

If you go down the sync route with SQL compact like me you basically have two choices. SQL Server merge replication or the newer ADO.NET Synchronisation services. If you choose the former you need to be really careful with your DB design to ensure it can be easily partitioned between mobile subscribers and the publisher. You really need to think about conflicts, and splitting tables that wouldn't normally be split in a normalised DB design is one way of doing that. You have to consider situations where a device goes offline for some time and the publisher DB (i.e. main DB) and/or a subscriber alters the same data. What happens when the device comes back online? It might mean resolving conflicts even if you have partitioned things well. This is where I got burnt. But SQL Merge Replication can work well and reduces the amount of code you have to write.

推出您自己的 DAL.不要尝试直接从 UI 代码使用数据读取器等,也不要使用类型化数据集.可能有第三方 DAL 可以与 Windows Mobile 一起使用(即我知道 LLBLGEN 可以,可能值得一看)但不支持 Linq-to-SQL,无论如何您需要一些轻量级的东西.很有可能 DAL 不会太大,所以自己动手吧.

Roll your own DAL. Don't attempt to use datareaders etc. directly from UI code and don't use typed datasets either. There may be third party DALs that work with Windows Mobile (i.e. I know LLBLGEN does, might be worth a look) but Linq-to-SQL is not supported and anyway you need something lightweight. The chances are the DAL won't be too big so roll it yourself.

如果您使用 .net,您可能最终需要一些未实现的平台功能.我建议使用这个廉价的框架来为您提供您所缺少的(尤其是与连接和电源管理相关的) - http://www.opennetcf.com/Products/SmartDeviceFramework/tabid/65/Default.aspx

If you are using .net you'll probably end up wanting some unimplemented platform features. I recommend using this inexpensive framework to give you what your missing (especially as related to connectivity and power management) - http://www.opennetcf.com/Products/SmartDeviceFramework/tabid/65/Default.aspx

Windows Mobile 设备在不使用时会部分关闭以节省电量.如果您正在进行轮询类型设计,则需要每 x 分钟唤醒一次它们.普通的 .net 计时器类不会这样做.您需要使用可从 OpenNetCF(上图)使用的平台功能.计时器类称为 LargeIntervalTimer,位于 OpenNetCF.WindowsCE 程序集/命名空间中(我认为).

Windows Mobile devices partially switch off to save power when not in use. If you are doing a polling type design you'll need to wake them up every x mins. A normal .net timer class won't do this. You'll need to use a platform feature which can be used from OpenNetCF (above). The timer class is called LargeIntervalTimer and is in the OpenNetCF.WindowsCE assembly/namespace (I think).

祝你好运!

这篇关于Windows Mobile 开发 - 从哪里开始?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆