MyMobiler now supports Android
Well, few weeks ago, I told one of my clients to download "MyMobiler" as he wants to remote control his Windows Mobile Devices. I was surprised that it supports Android now... Thank you very much, "MyMobiler" team... [...]
by Elvis Hsu No comments Read More
Update Windows Mobile Application via your Http Server
Um, I haven't touch this Blog for a while... So... just a case study. Usually, I use FTP to find available files to update my mobile application. However,I have a client who doesn't want to install FTP but they have web server. Therefore, I use the traditional way to update the application, "Make a http query"... It is pretty simple to use HttpWebRequest and HttpWebResponse to validate the version. If the server returns a file link, then I download it and install it. You can make a HttpWebRequest (http://yourwebsite/?version=1.0.2.0) to find available update. If server [...]
by Elvis Hsu No comments Read More
Vibration on Windows Mobile
I remember a while ago that I needed to enable the vibration for a client's application. So I googled a bit and found the similar codes like below... And today, I found some people are looking for this solution on MSDN... So I decided to post it in C# and hope it will give some people a heads up... /// /// This function plays the specified vibration. /// /// Must be 0 /// Must be NULL /// A Boolean value that indicates whether the song /// should be repeated. If this parameter is equal to TRUE, it will refer to [...]
by Elvis Hsu No comments Read More
Pooh~~~ I haven't organised the blog page for ages... Well, not many clicks~~~ Anyway, I tried to check emails at home with Ubuntu and found out the Evolution could not connect to our Exchange 2007 server. I found out it works well when I am in the office or VPN connection is on. Um... I think that will be my new task to find out what causes this... Or... If any one reads this post, I would appreciated some comments or suggestions for this issue. [...]
by Elvis Hsu No comments Read More
PageSize plugin for Paging Toolbar for ExtJs 4
Hey... here is another one for everybody... As the standard paging toolbar of ExtJs 4 does not have function to change the page size of the data store, so I make a simple plugin for the paging toolbar. I believe there are many examples if you Google it, but just another sample to share though... /** * Ext.ux.grid.PageSize */ Ext.define('Ext.ux.grid.PageSize', { extend : 'Ext.form.field.ComboBox', alias : 'plugin.pagesize', beforeText : 'Show', afterText : 'rows/page', mode : 'local', displayField: 'text', valueField : 'value', [...]
by Elvis Hsu 8 comments Read More
Dynamic GridPanel for ExtJs 4
Recently, I was trying to update our internal system from ExtJs 3 to version 4. Well, I think many V3 plugins are needed to be updated. So I was a bit busy on that... Anyway, I am going to share a bit of code which is the dynamic grid for ExtJs 4. As the sample from Erhan Abay is for ExtJs 3, so I made a few changes for ExtJs 4. /** * Ext.ux.grid.DynamicGridPanel */ Ext.define('Ext.ux.grid.DynamicGridPanel', { extend: 'Ext.grid.GridPanel', alias: 'widget.dynamicgrid', /** * initialising the components */ initComponent: function(){ /** [...]
by Elvis Hsu 55 comments Read More
Tricky VPN settings on Ubuntu 11.04
Today, I was trying to connect to our VPN with Ubuntu 11.04 and found out that was not working. Well, after a bit searches on Google, I found out there are some points of VPN settings that I needed to change. Username should be domain\username. Do not fill out domain in the VPN configuration. Under the advanced option make sure you tick "Use Point-to-Point encryption (MPPE)" option. (see above screenshot) [...]
by Elvis Hsu 3 comments Read More
Microphone of Travelmate 8371 in Ubuntu... Pain...
I was trying to setup my laptop with Ubuntu 10.10. Well, so far, most of applications and devices are working as expected. However, the microphone with Gmail Chat is pretty much a pain. First of all, I found this link and installed the pavucontrol and changed the settings to Microphone 2. Well, it works with Skype but not with Gmail Chat. The Gmail Chat driver auto adjusts volume so it all went back to the default settings again... WTF... Anyway... keep fighting on it at the moment... Has anyone had this problem and resolved it? [...]
by Elvis Hsu No comments Read More
Sync device Date/Time with http web server
Well, this is long way back when I was a rookie to develop Windows Mobile applications with C#. I believe there are some people want to sync the device date/time with their web server as the device date/time somehow doesn't tick correctly after certain days. So first of all, you should have a look the SetSystemTime function as you need a SYSTEMTIME structure to pass the value to SetSystemTime function. We start to P/Invoke the SetSystemTime method. [DllImport("coredll.dll", SetLastError = true)] private static extern bool SetSystemTime(ref SYSTEMTIME time); Create the SYSTEMTIME [...]
by Elvis Hsu No comments Read More
Check the application has installed on Windows Mobile Device
When I deploy the application to customers, I like to wrap all cabs in one as it would be much easier. For example, .NETCF and SQLCE. If the device is new, the .NETCF or SQLCE needs to be installed prior running my application. Thanks for CeSetupDriver and here. They helped me a lot to deploy the application with the way I want. However, I don't want to prompt user every time that the .NETCF or SQLCE has already installed. So I come up with a checking method to validate that the application has already installed and skip to next cab installation. All you need to do is passing [...]
by Elvis Hsu No comments Read More
Darken or lighten the colour with C#
It was a while ago to play the colours in .NETCF. The case was drawing darker or lighter colour when user clicks my custom design buttons. Well, I believe it would be much easier to change the colour by its original colour. So I came up with two methods to extend the existing System.Drawing.Color object. These two methods can be found similar over the Internet. So, I have to thank all the developers in the Internet... public static Color GetColorDarker(this Color color, double factor) { // The factor value value cannot be greater than 1 or smaller than 0. // Otherwise [...]
by Elvis Hsu No comments Read More
JDK not found on Installing Android SDK
Today, I was trying to install the Android SDK to my laptop and got "JDK not found on Installing Android SDK"... Well, I was a bit confused as I have installed the latest JDK. So, I decided to google it. Most of results are for 64bit OS but I use 32bit Windows 7. Well, then I pressed "Back" button and then pressed "Next" again in the initialization page. Ha... It allows me to install it then... I believe the installer caches the previous data if you haven't installed the JDK. Well, good to know that is easy to fix this installation issue... [...]
by Elvis Hsu No comments Read More
Validate input URL string
I just tried to write a function to validate URL address. Well, as usual, I've done some researches on Google and not many efficient and satisfy solutions. However, I've got a solution which is using Regex in C# to validate a URL and it seems a acceptable method to test the URL input. public static bool IsValidUrl(this string url) { string strRegex = "^(https?://)" + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" // user@ + @"(([0-9]{1,3}\.){3}[0-9]{1,3}" // IP- 10.0.0.1 + "|" // allows either IP or domain + @"([0-9a-z_!~*'()-]+\.)*" [...]
by Elvis Hsu No comments Read More
Wrap long string in C#
Today I was think how to optimize the drawing string method on my library... so far I worked out this... However I still couldn't workout how to really wrap long string within the sentence... Any help? public static string[] WrapString(this Graphics gx, Font font, string text, float maxWidth, bool wrap) { // find if actual max text width is smaller than max width or maxWidth is smaller than zero or wrap is set to false if (gx.MeasureString(text, font).Width < maxWidth || maxWidth <= 0 || !wrap) { return text.Split(new char[] { '\n' }); } int [...]
by Elvis Hsu No comments Read More

CryptoDonatex