Click here to Skip to main content
15,889,838 members
Articles / Mobile Apps / Windows Mobile

GPS Tracking with Windows Mobile 5.0+

Rate me:
Please Sign up or sign in to vote.
4.60/5 (21 votes)
15 Aug 2007CPOL8 min read 238.3K   5.9K   146  
Use a Windows Mobile Professional phone with a GPS receiver to create a simple SMS based location tracking program.
using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;

namespace J2i.Net.FindMe
{
    public class Utility
    {
        public static string ExtractPhoneNumber(String source)
        {
            StringBuilder retVal = new StringBuilder();
            for(int i=0;i<source.Length;++i)
                if(Char.IsDigit(source[i]))
                    retVal.Append(source[i]);
            if ((retVal.Length > 0) && (retVal[0] == '1'))
                retVal.Remove(0, 1);
            return retVal.ToString();
        }
        public static string UrlEncode(string source)
        {
            StringBuilder sb = new StringBuilder();
            ASCIIEncoding enc = new ASCIIEncoding();
            byte[] bSource = (new ASCIIEncoding()).GetBytes(source);

            for (int i = 0; i < bSource.Length; ++i)
            {
                char c = Convert.ToChar( bSource[i]);
                if (Char.IsLetterOrDigit(c))
                    sb.Append(c);
                else
                {
                    sb.Append("%");
                    sb.Append(bSource[i].ToString("X"));
                }
                
            }
            return sb.ToString();
        }
    }


}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
I attended Southern Polytechnic State University and earned a Bachelors of Science in Computer Science and later returned to earn a Masters of Science in Software Engineering. I've largely developed solutions that are based on a mix of Microsoft technologies with open source technologies mixed in. I've got an interest in astronomy and you'll see that interest overflow into some of my code project articles from time to time.



Twitter:@j2inet

Instagram: j2inet


Comments and Discussions