Showing posts with label Pocket PC. Show all posts
Showing posts with label Pocket PC. Show all posts

Monday, December 28, 2009

Disabling Date-Time Changes

Do you know that you can programmatically stop the user changing the date and time of a Pocket PC device?

This is useful if your applications need to take time accurately for some reason from the device.

The following code will disable the user from accessing the date time changing settings using his Windows Mobile powered device.





  1. private void btnDisableClock_Click(object sender, EventArgs e)
  2. {
  3.     RegistryKey hklm = Registry.LocalMachine;
  4.     hklm = hklm.OpenSubKey(@"\Software\Microsoft\Clock\", true);
  5.     System.Byte[] offValue = new byte[1];
  6.     offValue[0] = 0x30;
  7.     hklm.SetValue("AppState", offValue);
  8.     lblTitle.Text = "Change Clock Status - Disabled";
  9. }




 

If you want to re-enable the setting, to make the user able to change the data and time use the below code.





  1. private void btnEnableClock_Click(object sender, EventArgs e)
  2. {
  3.     RegistryKey hklm = Registry.LocalMachine;
  4.     hklm = hklm.OpenSubKey(@"\Software\Microsoft\Clock\", true);
  5.     System.Byte[] offValue = new byte[1];
  6.     offValue[0] = 0x11;
  7.     hklm.SetValue("AppState", offValue);
  8.     lblTitle.Text = "Change Clock Status - Enabled";
  9. }




Friday, December 28, 2007

Microsoft Office Mobile 6.1

Microsoft has released Office Mobile 6.1. This is an upgrade to earlier versions of Office Mobile. This version will enable opening Office 2007 files in mobiles (Open XML formatted files).
Additionally it will have the following features,

• Enhanced viewing experience for charts in Excel Mobile.
• Ability to view SmartArt in PowerPoint Mobile.
• Ability to view and extract files from compressed (.zip) folders.
as Microsoft has quoted.

Download it from Microsoft using the following link.
http://www.microsoft.com/downloads/details.aspx?familyid=4b106c1f-51e2-42f0-ba32-69bb7e9a3814&displaylang=en&tm

Thursday, August 09, 2007

Making a normal Column, an Identity column in SQL Server CE

In SQL CE making a normal column an identity column is not possible. This is because the process involved in the making of identity columns. If you would like to know more about the Identity creation behaviour please read my earlier article.

http://arjunachith.blogspot.com/2007/08/making-normal-column-identity-column-in.html

In SQL CE the process mentioned in the article is not possible because that SQL CE does not support enabling and disabling IDENTITY INSERT.

If you did try it out, should have noted that even SQL CE table editor is not supporting this.

So if you really want to change a column in to an identity column (which already having unique values) then what you can do is, create a new table and copy the data your self. But the problem is that you will not get the old values in the identity column because there is no way to copy them without turning the IDENTITY INSERT off. So identity column data will be new from 1 to n, But all other information will be there in the table with the identity column in place. If you even wants to keep the old identity values you can keep that old identity column and create a new column for the Identity column.

Thursday, August 02, 2007

Retrieving MAC Address in Compact Framework

Recently I have seen that getting the MAC address of a Pocket PC network card using the .Net Compact Framework requires calling to the API 'iphlpapi.dll'. This is because the Windows Management Instrumentation (WMI) classes are not in Compact Framework. Otherwise you should have used WMI to get the MAC address.
But believe me that the process involved in Compact Framework to get the MAC address is complex. So as a suggestion I would say to use the OpenNETCF class libraries. You have to use OpenNETCF.Net and OpenNETCF to successfully get the MAC address. If you want to know what is happening underneath you also can download the OpenNETCF source code too.

OpenNETCF web site is http://www.opennetcf.com/, visit them and see.

The code for getting the MAC address of the first adapter using OpenNETCF would be,

' Creating a variable to hold all the retrieved adapters.
Dim adpcol As OpenNETCF.Net.AdapterCollection = OpenNETCF.Net.Networking.GetAdapters
If adpcol.Count = 1 Then
' adpcol.Item(0).MacAddress will be returning in Byte stream, you have to use Bit Converter to convert the stream to string.
GetDeviceMAC = BitConverter.ToString(adpcol.Item(0).MacAddress)
Else
GetDeviceMAC = "No Adapters Fetched"
End If

(You have to refer OpenNETCF.Net and OpenNETCF to make this code run.)
Yahoo! Go 2.0


Have you tried Yahoo Go 2.0? It has many new additions than the earlier version of Yahoo Go. In supported areas you can even get the traffic reports and maps.

Also note that Yahoo Go 1 service will be stopped on 27th of August 2007.

Try it out at http://mobile.yahoo.com/go.

I am sure that you will like the new version with many new features.

Thursday, July 12, 2007

Analyzing Device Application Performance


Recently I tried analyzing my applications' performance running on a Pocket PC. This can be achieved using .Net Compact Framework (.Net CF) Remote Performance Monitor (RPM). .Net CF RPM provides facility to monitor applications which run on devices that are connected to the computer using Active Sync or by general network.

To monitor your device application performance you have to have at least .Net CF SP1 since .Net CF RPM will come with .Net CF Service Pack 1. If you have not yet installed .Net CF SPs then download the SP2 from Microsoft using the following link.
http://www.microsoft.com/downloads/details.aspx?FamilyID=aea55f2f-07b5-4a8c-8a44-b4e1b196d5c0&DisplayLang=en


RPM consists of 3 main files.
1. NetCFRPM.exe - This is the application file which will run on your computer. This will show performance related data of the device application. This file can be found at C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\bin if you installed the Service Packs to the default location.

2. netcflaunch.exe - This will give you the connection parameters to the device. The details provided will be in handy if the device is not connected to the computer using Active Sync.

3. netcfrtl.dll - This dll facilitates the connection between the computer and the device.

You have to copy both above files to the device Windows folder (\Windows).


If you need more information on how to use .Net CF RPM visit Steven Pratschner's .Net CF weblog articles.
http://blogs.msdn.com/stevenpr/archive/2006/04/17/577636.aspx
http://blogs.msdn.com/stevenpr/archive/2007/03/08/finding-managed-memory-leaks-using-the-net-cf-remote-performance-monitor.aspx

Saturday, March 17, 2007

ROM Upgrade on HP iPAQ rw6828

I flashed the ROM of my Pocket PC to version 1.01.03 from 1.00.03. I highly recommend you to upgrade your PPC ROM to the new version since this upgrade will solve many problems that this device is having with the earlier ROM. In the upgrade process I got in to problems initially but at the end I managed to succeed. So I thought of putting a post so that others can do it in one shot unlike me.

You can download the ROM upgrade from
http://h18007.www1.hp.com/support/files/handheldiPAQ/us/download/23981.html
the main software and driver page at HP is
http://h18007.www1.hp.com/support/files/handheldiPAQ/us/locate/1129_6331.html?jumpid=reg_R1002_USEN#0.

As the first thing what you needs to do is backup the data in you PPC because upgrading ROM will erase all the data. The easiest way to save your personal data is to create a ActiveSync membership and sync all the data to a Personal Computer. Then when you complete the upgrade you can sync back and restore the data.

Next make sure that you have ActiveSync 2.0, If you have newer version of ActiveSync I recommend you to uninstal that and install ActiveSync 2.0. You can get it from http://www.microsoft.com/downloads/details.aspx?familyid=7269173A-28BF-4CAC-A682-58D3233EFB4C&displaylang=en.

You should make sure that your computer will not go to standby or hibernate modes and also that your connection from PPC to the computer will be intact while the ROM upgrade is happening. Power failure or cable detach could cost you your PPC.

Remember to remove any SD cards, secondary batteries, SIM cards that you have in your PPC. Also note that it is good practice to charge your PPC above 75% before starting the upgrade.

Next double click on the file you downloaded from HP. Make sure you extract it to the default location provided (C:\iPAQ\SP34074).
Automatically it will start the upgrade process. Follow it as you follow a normal wizard.

If you are lucky the process will continue to 100% and the PPC will reset and will start as usual.

Then create a new partnership with ActiveSync and synchronize the data back to your PPC.

The upgrade process is installing things as follows,
0% - 90% - Pocket PC 2005 and related components
90% - 93% - New Boot Loader
94% - 95% - WAP Component
95% - 100% - WAN Component

If your update process stops at 90% and give a Windows error don't panic. What happens here is that the updater fails while closing the Pocket PC 2005 and opening Boot Loader.
If his happens make sure that you are running ActiveSync 4.2 then disconnect the PPC from the cable and remove the battery for about one minute. At the same time shutdown your computer and restart. Then reconnect the battery. The PPC will then come to a white screen with HP logo on it. now connect the USB cable again.

Go to the place where unzipped the files (C:\iPAQ\SP34074). Double click on hpRUU.exe to manually start the updater again. As you are in trouble already do not start any other applications while the updater is doing its work. If you have followed exactly what I have mentioned this time it should upgrade the ROM successfully. If not what you can do is try another two three times and if this fails you have to send your PPC to a HP service center to upgrade the ROM for you. Or else if you like to continue with the old ROM version you can install the older ROM which can be downloaded from http://h18007.www1.hp.com/support/files/handheldiPAQ/us/download/23966.html.

All the best for your upgrade.

Thursday, February 08, 2007

Visual Studio 2005 not adding reference dlls to the deployment project

Recently I did face a problem when I created the setup for my Pocket PC application. My application had several projects and each project is supposed to add a dll to the setup. The problem was when I build the project it didn't add the reference dlls to the setup but only added the main application.

Later I found the solution for this which was to remove the main project output from the deployment project then go to debug mode and add the main project back again to the deployment project. The when the project is rebuilt all the dlls will be included properly.

Monday, October 02, 2006

Playing Media Files in .Net Compact Framework 2.0

I have seen many people asking how to play media files in device applications. Here I am playing media files using Windows Media Player.



This is the ProcessHandler class which imports Coredll Dll and uses it's CreateProcess to create a seperate process with the required application.


This is the main form which has a button to start the Player, then it will ask the user to browse for a media file to play.


The ProcessHandler.CreateProcess function can be used to start any application which is installed in the device by simply replacing the 'WMPlayer' by the required application qualified name (IExplorer).