table of Contents
1. What is the Chinese meaning of Smart Devicesmart Device is "smart device", which refers to the mobile, embedded or human machine-interactive electronic product using the mobile phone, Pocket PC, etc. Pocket PC (hereinafter referred to as PPC) I will be very familiar, now there is a fairly user group. The products such as Casio, Kangbai, etc. have already entered the Chinese market, and domestic companies such as Lenovo also actively launched similar products, competing for this future, which is very potential. What is amazing and unexpected is that on the recommended PPC page of the Microsoft website, I found a PPC launched by Lenovo. As shown in the figure below: This PPC model is Tianzhu XP100, the launch is earlier, The configuration has been behind. We sincerely hope that domestic manufacturers can get more far from the road of PPC. Here you must clear a point, PPC is not a PDA. The full name of the PDA is the Personal Digital Assistant (Personal Digital Assistant). Products, generally 2,000 yuan under the market, are all categories of PDA. PDA is very weak than PPC, the screen is monochrome (of course, some high-end products are colored), only simple features such as phone books, schedules, games, etc. But the most important point is that general PDA uses the embedded management system developed by the developer (not dare to call the operating system). Due to the uniform standards and interfaces, this management system has poor scalability and has no compatibility. Therefore, each PDA is used, the interface, and the function are different. If you have never heard of the PDA of different brands, you can share the data, and no one can write the game, the software can put it in a variety of PDAs. Run. However, the PPC is different. PPC uniform uses the Windows CE operating system, from the above Lenovo PPC introduction page, you can find that PPC also uses CPU, the frequency, memory, and display screens to measure performance, so different manufacturers, different models of PPC can be clear. It is a bit of ordinary computers. In addition, the Windows CE operating system contains IE, Pocket Word, Pocket Excel, MSN Messenger and other applications, you can chat with IE, MSN Messenger and friends, Media Player look at video files, listen to MP3, just like using ordinary computers Of course, you can also use Pocket Word, Excel to process the Word, Excel file on the desktop. Most importantly, programmers can develop their own software, games, can run on various PPCs. In this way, the world of PPC is more exciting, like what e-books, translation software, game modifiers, development tools, and more. In short, you can think of the PPC to simplify the ordinary computer, put Windows CE to simplify Windows, have a similar approach to the PPC on the ordinary computer. Smart Phone is currently relatively small in China, just in Europe and the United States. Simply, Smart Phone is installed on the mobile phone, with a phone with some PPC features. I remember that the previous Motorola has launched a mobile phone similar to the PDA, the one is quite large, and the green oil screen. Smart Phone is like this, enriches the function of your phone. I have recently launched something called Pocket PC Phone Edition. It is simply plus the PPC's functionality, which is Pocket PC Phone Edition = Pocket PC Smart Phone. The following is a comparison of these three products: 2. What is said to the Windows CE, it seems to advertise the PPC or Smart Phone, but we are mainly talking about the development of these two types.
Some friends may say, I haven't seen this PPC, smart phone has never seen, how to develop? I don't have to worry about it. I believe in this article. I believe that as long as you have a computer, it will be .NET programming, you can develop it for PPC or Smart Phone, and even other Smart Device. First, let's talk about Windows CE. You may have discovered that the various devices talked above have integrated the Windows CE operating system. Windows CE is the foundation of our development. So what is Windows CE? Windows CE is an open, scalable, 32-bit operating system, which is dedicated to installing enterprise equipment such as digital camera, telephone and home entertainment equipment, such as digital camera, telephone and home entertainment equipment, such as digital camera, telephone and home entertainment equipment, such as digital camera, telephone and home entertainment equipment installed from industrial controller, communication hub, vending terminal, etc. Personal consumer goods. Windows CE provides developers with a development environment similar to Windows, which has the following built-in features similar to Windows: Microsoft Win32 Application Programming Interface (API), ActiveX Controls, Message Queue (MSMQ), Component Object Model (Component Object) Model, COM), Dynamic Template Library, ATL), and MFC. The ActiveSync feature is integrated in Windows CE, and users can connect embedded devices and ordinary desktop PCs through a serial interface, an infrared interface, or a network cable. In addition, Windows CE also provides built-in multimedia features (including DirectX), communication functions (TCP / IP, SNMP, TAPI, etc.). So you can see that Windows CE is Microsoft specializes in an operating system used by embedded or mobile electronic devices. The last program we developed to Windows CE can be used by various embedded devices. Of course, the code is selected before compiling, but the code is not changed, and the compiler will automatically compile it into the executable file on the target platform. 3. What is the .NET Compact Framework Microsoft In order to implement the .NET strategy, it has launched .NET Framework 1.0 for a Windows platform a year ago, I think everyone is already familiar. In April 2003, Microsoft launched Windows Server 2003 and Visual Studio .NET 2003. The Windows Server 2003 is more integrated .NET Framework 1.1, and VS.NET 2003 has also added a lot of fresh development templates. Among them, a maximum new feature in VS.NET 2003 is integrated .NET Compact Framework 1.0, we can confirm whether or not .NET Compact is installed by browsing the files in the Program Files / Microsoft Visual Studio .NET / 2003 / CompactFrameworkSDK directory. Framework. So what is .NET Compact Framework? The Chinese name of the .NET Compact Framework is .NET Framework Lite. Simply, if the Windows CE operating system is an embedded or mobile electronic device Windows, then .NET Compact Framework is the .NET Framework on these devices. In fact .NET Compact Framework is a subset and supplement to embedded or mobile electronic devices for embedded or mobile electronic devices .NET Framework. .NET Compact Framework has two main components: public language runtime and .NET Compact Framework class libraries. The public language runtime public language runtime provides an execution environment for administrative .NET Compact Framework code.
The form of code management can be memory management, thread management, security management, code verification and compilation, and other system services. It is designed to enhance performance at runtime. It uses real-time (JIT)-compiled methods to allow managed code to run in this machine language running the application. This way, you can create applications for multiple platforms without having to worry about recompiling or regenerating executables for each platform. Even if your mobile app is written in Visual Basic .NET or C # .net, you can still integrate functionality and subroutines stored outside the dynamic link library (DLL, including Windows CE API). The data type provided by .NET Compact Framework and the structure of the structure allow you to easily integrate the Windows CE API's functionality into your application. The .NET Compact Framework class library .NET Compact Framework class library is a collection of reusable classes closely integrated with the public language running library. Your app will take advantage of these libraries to derive the required features. Just like other object-oriented class libraries, .NET Compact Framework type can be used to complete many common programming tasks, including interface design, using XML, database access, thread management, and file input / output, etc. The .NET Compact Framework implements a subset of the System.Windows.Forms and System.Drawing classes, enabling you to create a Windows CE-based user interface for the device application. The Form Designer in Visual Studio will manage most of these classes for you. Windows Forms that can be implemented under the .NET Compact Framework include: Form support, most controls in .NET Framework, and integrated third-party controls, bitmaps, and menus. The controls included in the .NET Compact Framework are listed in the table below. Control Description Button Simple Command Button Checkbox Common Check Box ComboBox Contains Multiple Projects Downlinks ContextMenu Implementing Context Related Menu DataGrid You can Bind to DomainUpdown You can browse the project list by scroll bar HscrollBar horizontal scroll bar imagelist Storage Image Container INPUTPANEL Control Soft Keyboard Enter Panel (SIP) Label for Display Text ListBox provides item list ListView provides four data views: large icons, small icons, lists, lists, MAINMENU, MenmericUpdown The digital input field containing the scroll bar openfiledialog Access the open file dialog on this unit to save the container of other controls PictureBox Display Image ProgressBar visual task progress indicator Radiobutton FAQ SaveFileDialog Access the save file on this machine Dialog STATUSBAR TabControl for Display Text TabControl provides an options for the application TEXTBOX Standard text input field Timer Basic Timer Components Toolbar Implementing the Toolbar Toolbar TRACKBAR TRACKBAR TREEVIEW TREEVIEW TREEVIEW Display data vscrollbar vertical scroll bar
Since the .NET Compact Framework is a subset of the .NET Framework full version, it is also a subset of the full version of the feature. For the size and performance consideration, .NET Compact Framework does not include some control properties, methods, and events. But if you need, you can do this unusable functionality if you need to complete a small amount of encoding. This is because .NET Compact Framework allows users to create their own controls based on the underlying control class. This way you can create your own active controls by adding your own properties, methods, and events. Of course, the .NET Compact Framework class library also implements a subset of other namespaces such as System.Data, System.xml, System.Web, System.drawing, System.Threading, System.Net, System.io, System. Net.IRDA, etc. Due to the limited space, it is not introduced here. Interested friends can get relevant information by reviewing MSDN. 4. Write a simple helloworld here, we demonstrate how to write a Pocket Compact Framework program by writing a simple HelloWorld program, and put it on the Pocket PC 2002 emulator. First create a new project (file-> new-> new project), select a development language (here C # as an example), select Smart Device Application in Templates, then fill in Name, click OK. Check the default value in the pop-up dialog box, click OK. Then, we drag a label and a button to the form, remove the character character in Label1, and impact SAY of Button1's Text property. As shown in the figure below: Single, double-click Button1 on the form, and enter the following code:
Private void button1_click (object sender, system.eventargs e) {label1.text = "Hello WordL!";
Then we select Debug-> Start on the menu, or press F5 directly. At this time, the following screen appears:
This is to let us choose to debug on that device. If the first is to debug in the Self-strip of VS.NET 2003, if the second one will be debugged on a physical PPC. If you choose the second, you need to ensure that the physical PPC has been connected to the PC, and the relevant parameters have been set in the Tools-> Options-> Device Tools-> Options menu of VS.NET 2003. If there is no .NET Compact Framework on the debug device, when debugging, .NET Compact Framework will be automatically deployed on the target device. Here, we choose to use the simulator to debug. At this time, VS.NET 2003 will automatically start the simulator and deploy the .NET Compact Framework and the program you want to in the simulator. The status of the VS.NET will appear in the following state:
Try to establish a connection with the simulator to complete the establishment connection
Deploy .NET Compact Framework to the target device (this step will be skilled if it is .NET Compact Framework on the target device)
Deploy .NET Compact Framework to complete this time the simulator will automatically install .NET Compact Framework, appears as follows:
After this installation, you will also install some other debugging. Finally, we will deploy the program we have written to the PPC. When Ready occurs when the status bar appears, the program is fully deployed, and the following screen appears. When we click the SAY button, hello world! After the program debugging is completed, when you click on the fork in the right of the PPC, it is found that VS.NET 2003 does not exit the debug state. This is because the PPC is to be withdrawn from the memory in order to optimize the program running. It is temporarily "minimized". We can view the running programs to view the settings-> system-> memory-> system-> memory-> system-> memory-> system-> memory-> system-> memory-> running program, when we are in STOP here, and VS after we are here. .NET 2003 also returned to the editing environment.
Of course, you can also stop debugging in VS.NET 2003 in VS.NET 2003, and will automatically exit the programs that are debugging in the PPC. After closing the debug program, the debugged program does not delete from the simulator, but in the / My Device / Program Files / Project Name directory. Everyone can use the menu -> Programs-> File Explorer to access and run these programs again. Finally, when you don't want to use the PPC, you can click on the "Fork" closing program outside the simulator itself, the following tips will appear.
If you have selected "Save Emulator State", the PPC is currently status, the settings that have been deployed and change will be saved. The startup PPC will not have to take a long self-test, and the debugging is not needed. Net Compact Framework, can save us time. If "Turn Off Emulator" is selected, the current state is all lost, and the PPC is started back and then started like the first use. 5.Pocket PC 2002 Simulator Using Empirical Simulator Operation Conditions For the simulator to establish a connection with the physical operating system, your computer must have an independent IP (127.0.0.1 is not counted). You can use IPConfig to see if there is a separate IP. If there is no relationship, we can install a virtual network card (loopback network adapter). Install the loopback adapter under Windows 2000, under Windows 2000, the process of installing the Microsoft loopback network adapter is as follows:
1. In the Control Panel, click Add / Remove Hardware. 2. On the "Welcome" page of the Add / Remove Hardware Wizard, click Next. 3. Click Add / Exclude Device Fault, and then click Next. When the system scans the plug and play device, the installation process will be paused. 4. On the Select One Hardware Device page, click Add New Device, and then click Next. 5. On the "Find New Hardware" page, click No, I want to select hardware from the list, and then click Next. 6. On the Hardware Type page, click Network Card, and then click Next. When generating a list of network adapters, there will be a short delay. 7. On the Select Net Card page, first click Microsoft in the Manufacturer list box, and then click Microsoft Loopback Adapter in the Network Cards list box. Click the "Next" button. 8. On the Start Hardware Installation page, click Next. That is, the loopback adapter is started.
Configure a loopback adapter in Windows 2000, like any network adapter, the installation loop back adapter is just half of the process, and you also need to configure a new adapter. Perform the following steps to configure the loopback adapter:
1. On the Start menu, click Settings, point to Network and Dial-up Connections, and then double-click local connection. The Local Connection Status dialog is displayed. 2. Click Properties. The Local Connection Properties window will appear. Note: Make sure that the process is properly connected. The "Connection Time Use" fields in this dialog should display "Microsoft Loopback Adapter". 3. Select Internet Protocol (TCP / IP) "and click Properties. The Internet Protocol window will appear. 4. Configure the IP address properties. 5. Click OK to close the Internet Protocol window. 6. Click OK to close the Local Connection Properties window. 7. Click Close to close the Local Connection Status window. Replacing the skin may open the simulator interface and I don't have much, because I dropped the redundant skin of the original simulator. You can use the Help-> Emulator for Windows CE Help to see the help of the skin in the PPC menu. PPC's skin is in this catalog: / Program Files / Microsoft Visual Studio .NET 2003 / CompactFraMewsdk / ConnectionManager / Bin / Images / PocketPC / 2002/1033
The process is limited to only one PPC simulator on one operating system. This is what you can't run two PPC simulators simultaneously in a computer, so don't use the PPC simulator when you switch users and remote login desktops.
With physical operating system swap files Sometimes we need to exchange some other files with physical operating systems, but the simulators in Visual Studio .NET bring us back to the closed simulator environment. What is more trouble is that Visual Studio .NET is different from Embedded Visual Tools, which does not include the simulator file management tool. This requires you to think of some creative solutions. There are three ways to exchange files in the simulator environment. One way is to create a file through an application running on the simulator. This method will not be described again here. You can create text, XML, or database files using standard .NET programming technology. The other two methods are to add files to the project and copy files from the shares, requiring further explanation here. 1. The easiest way to add files to the project to move the file to the simulator to include them as part of the project. One advantage of using this method is that when the forced reset is performed on the simulator (the TURN OFF simulator is reopened, all the content in the PPC simulator will be restored to the initial look), just re-deploy the project Recover file content. The process of using this method is as follows:
1. Open the project in Visual Studio .NET. 2. On the Project menu, click Add EXISTING ITEM ... (add existing items ...). 3. In the Add Existing Item dialog box, select the file you want to copy into the simulator. 4. Click Open. This file is added to the project. 5. In the Solution Explorer window, select the added file. 6. In the Properties window, verify that the build property is set to Content. Items configured to Content will be copied as a single file to the target device. Items configured as Embedded Resource are part of the application executable. 7. Establish a project. The file will be copied to the device with the application.
2. Provide greater flexibility from the second approach to sharing replication files, and hardly require additional work. This method uses the Pocket PC operating system built-in network file sharing function, which is then provided by the emulator included in the Visual Studio .NET. This method is divided into two parts: set sharing on the development computer, then access sharing through the simulator's File Explorer (File Explorer). Settings sharing requires three configurations. First, a computer must be configured to enable sharing. Second, you must configure the folder to share. Finally, change the device name of the simulator. Enable sharing on the development machine running Windows 2000 1. On the Start menu, click Settings, point to Network and Dial-up Connections, and double-click Local Connection. 2. In the Local Connection Status window, click Properties. 3. In the Local Connection Properties window, enable the "File and Printer Sharing of Microsoft Networks". 4. Click OK to close the Local Connection Properties window. 5. Click Close to close the Local Connection Status window.
At this point, you have completed the configuration of the development computer, you can share it. The next step is to share the folder where the file to be copied into the simulator is located. Share folder under Windows 2000:
1. Start the File Explorer (File Explorer). 2. In File Explorer (File Explorer), right-click on the folder to share and click Properties. 3. In the Properties window, click the Sharing tab. 4. On the Sharing (Shared) tab, select the shared folder and provide the shared name. 5. Click OK to close the Properties window.
Change the device name in the PPC simulator: Select the menu in the simulator -> settings-> system-> About-> device id-> device name, change Device Name. What doesn't matter, it is not a default setting. Now you have completed the configuration, you can copy the file. First, you need to place all files to be copied into the simulator into the shared folder. Then move the file to the simulator:
1. Start the simulator. 2. Start File Explorer from the simulator. 3. On the File Explorer menu, click Open. 4. The OPEN dialog will appear on the screen. Follow the // MyComputer / MyShare format to specify the name of the development computer and the shared name you created. 5. Click OK.
Depending on the security settings on the development computer, the computer may prompt you to enter your username and password before allowing access to sharing. At this point, you can copy files from the development computer and the sharing on the simulator.
When copying, put the mouse on the name of the file you need to copy, a red circle will appear in a while, and the rest is the same as WINDOWS. However, it is necessary to pay attention, Chinese does not support Chinese, so Chinese directory names and file names will become square.
Simulator Memory Capacity Limit Open Menu -> Settings-> System-> Memory can view the simulator's virtual memory. The virtual memory capacity of the simulator is a space for the stored files as the simulated memory.
When the Storage is full, you can no longer copy files to the PPC. When Program is full, you cannot run the program. We can assign a balance setting by adjusting the middle of the slide. You can also modify the virtual memory size of the simulator through the Tools-> Options-> Device Tools-> devices-> configure tools-> devices-> configure tools-> devices-> configure tools-> devices-> configure-> system-> memory size. However, pay attention to the modification of the settings to restart the PPC simulator to take effect.
Use the PPC Simulator to select the menu in the simulator -> settings-> connetions-> connections-> Connections, change to the following configuration.
IP addresses you can access your website in IE.
It is a pity that the simulator is English, so I can't see Chinese characters. And since there is no DNS, you can only access it through IP address. Transfer from http://www.cnblogs.com/lovewangshu/archive/2004/10/21/54934.html