JayWinMoDev Philippines
Jayson's Windows Mobile Development Philippines
Saturday, August 27, 2011
Friday, February 12, 2010
Ubuntu OS Running on Xperia X1
I'd like to thanks Fatsal from XDA Dev for his amazing effort!
http://forum.xda-developers.com/showthread.php?t=631437
Here are the videos!
Part 1
Part 2
Part 3
Sunday, January 31, 2010
Running Google Android on top of Windows Mobile
Now it’s possible to run Google Android on top of Windows Mobile! But you have to keep in mind on issue about “Device Compatibility” This Google Android if you noticed, is running on my Xperia X1. I’ll post a link where you can find a copy of Google Android for your device. So How’s this possible? Thanks to fatsal in XDA for making this possible for X1’ers. Check fatsal thread in XDA here Here’s a video preview. But am not sure why Wi-Fi is not working. |
As I promised. The links for your device.
Friday, January 15, 2010
JWMD Picture Browser Control
I made a simple picture browser control because of some reason that Microsoft.WindowsMobile.Forms.SelectPictureDialog did not include filenames at the bottom of the icon on the lists.
So again.. here’s the control
- Here’s the interface after loading the pictures | - after clicking the browse button just after the path box. NETCFFolderDialog control appears |
- interface while loading. |
ok. that’s pretty much it..
code snippet is very simple
JWMDPictureBrowserControl.PictureBrowser pb = new JWMDPictureBrowserControl.PictureBrowser();
pb.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
pb.Filter = ".png;.jpg;.bmp";
pb.ShowDialog();
MessageBox.Show("Selected file: " + pb.FileName);
DOWNLOAD HERE Type: DLL Fle Size: 11kb | January 23, 2010 - UPDATE: Trapped Errors .. Initial Release - January 16, 2010 |
Sunday, January 10, 2010
Anagram (Word Finder) Mobile
This is a ported version of my Anagram Desktop version found here. Using Regular Expression, RE, or RegEx. Though not purely RegEx way .. it has some help of Hashtable and StringBuilder for counting characters (which is MY WAY of counting characters) and appending the words found. Anyway, at the left .. is the screenshot of the application (click to view larger version). If you noticed, I used “regular expression” as my word.. You can use this app on your scrabble game! look at the total result. 1,905 words found in 1 minute and 16 seconds and I have total of 192,719 English words in textfile. Am not sure if that’s fast enough .. am using Xperia X1 device. Here’s the specs of this device. Desktop version is much faster. Look here Download it here
How To Use 1. After downloading AnagramMobile.rar and extracting the .exe file in your device. Download english.txt or tagalog.txt. 2. Run the application and tap Open and select english.txt or tagalog.txt file in Open Window. 3. Wait for a few seconds or a minute to load the word list. 4. Enter word, a sentence, or a jumbled letters in “Enter word or sentence here” box 5. and click Find. 6. and wait for the results. |
XDA Dev Thread Here
Link 1
Code Snippet for Finder Class 3.
Fast string concatenation using StringBuilder.
Duplicates problem solved using Hashtable.
Methods
OpenWordDatabaseTextFile(string filename)
Find(string word, string separator, int min)
CountCharacters(string str)
DoRegEx(string pattern, bool UseAllRegexOptionFlag)
string[] Split(string s, string delimeter)
Properties
string TimeDuration
int TotalFound
int TotalWordsFoundInDatabase
// Finder Class version 3
// Author: Jayson Ragasa, December 22, 2009
// Copyright© 2009 Jayson Ragasa, Baguio City, Philippines
namespace Anagram
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
public class Finder
{
string _time_duration = string.Empty;
int _ttl_found = 0;
int _ttl_words_in_database = 0;
string new_line_separated_words = string.Empty;
public Finder() { }
public void OpenWordDatabaseTextFile(string filename)
{
using (System.IO.StreamReader reader = new System.IO.StreamReader(filename))
{
new_line_separated_words = reader.ReadToEnd();
}
//_ttl_words_in_database = new_line_separated_words.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Length;
_ttl_words_in_database = Split(new_line_separated_words, "\r\n").Length;
}
public string Find(string word, string separator, int min)
{
string ret = string.Empty;
StringBuilder list = new StringBuilder();
string regex = "^[" + word + " ]+\\r\\n";
DateTime startTime = DateTime.Now;
Hashtable words = new Hashtable();
IDictionaryEnumerator ide;
#region start
{
Regex r = DoRegEx(regex, false);
if (r.IsMatch(new_line_separated_words))
{
Hashtable ht_x;
Hashtable ht_y;
bool notValid = false;
MatchCollection mc = r.Matches(new_line_separated_words);
foreach (Match m in mc)
{
string w = m.Value.Trim();
if (w.Length >= min)
{
ht_x = CountCharacters(m.Value.Trim());
ht_y = CountCharacters(word.Trim());
notValid = false;
ide = ht_x.GetEnumerator();
while (ide.MoveNext())
{
if (Convert.ToInt32(ht_x[ide.Key]) > Convert.ToInt32(ht_y[ide.Key]))
{
notValid = true;
}
}
if (notValid) { continue; }
string thisWord = m.Value.Replace("\r\n", string.Empty);
thisWord = thisWord.Trim();
// don't add the word if the word already exists
// in hashtable
if (!words.ContainsKey(thisWord))
{
words.Add(thisWord, thisWord);
}
}
}
ht_x = null; ht_y = null;
}
}
#endregion
#region build result
{
ide = words.GetEnumerator();
while (ide.MoveNext())
{
list.AppendFormat("{0}" + separator, ide.Value);
}
}
#endregion
DateTime endTime = DateTime.Now;
TimeSpan _duration = endTime - startTime;
ret = list.ToString();
if (ret != string.Empty) ret = ret.Substring(0, ret.Length - separator.Length);
this._time_duration = _duration.ToString();
this._ttl_found = words.Count;
return ret;
}
// Count instance of a character in a string
protected Hashtable CountCharacters(string str)
{
Hashtable ht = new Hashtable();
char[] a_chars = str.ToCharArray();
foreach (char c in a_chars)
{
if (ht.ContainsKey(c))
{
ht[c] = (Convert.ToInt32(ht[c]) + 1).ToString();
}
else
{
ht.Add(c, 1);
}
}
return ht;
}
protected Regex DoRegEx(string pattern, bool UseAllRegexOptionFlag)
{
string regex = pattern;
RegexOptions options;
if (UseAllRegexOptionFlag)
{
options = (((System.Text.RegularExpressions.RegexOptions.IgnorePatternWhitespace | System.Text.RegularExpressions.RegexOptions.Singleline) | System.Text.RegularExpressions.RegexOptions.Multiline) | System.Text.RegularExpressions.RegexOptions.IgnoreCase);
}
else
{
options = ((RegexOptions.IgnorePatternWhitespace | RegexOptions.Multiline) | RegexOptions.IgnoreCase);
}
return new Regex(regex, options);
}
protected string[] Split(string s, string delimeter)
{
if (s == null)
throw new ArgumentNullException("stringToBeSplitted is null.");
if (delimeter == null)
throw new ArgumentNullException("delimeter is null.");
int dsum = 0;
int ssum = 0;
int dl = delimeter.Length;
int sl = s.Length;
if (dl == 0 || sl == 0 || sl < dl)
return new string[] { s };
char[] cd = delimeter.ToCharArray();
char[] cs = s.ToCharArray();
List<string> retlist = new List<string>();
for (int i = 0; i < dl; i++)
{
dsum += cd[i];
ssum += cs[i];
}
int start = 0;
for (int i = start; i < sl - dl; i++)
{
if (i >= start && dsum == ssum && s.Substring(i, dl) == delimeter)
{
retlist.Add(s.Substring(start, i - start));
start = i + dl;
}
ssum += cs[i + dl] - cs[i];
}
if (dsum == ssum && s.Substring(sl - dl, dl) == delimeter)
{
retlist.Add(s.Substring(start, sl - dl - start));
retlist.Add("");
}
else
{
retlist.Add(s.Substring(start, sl - start));
}
return retlist.ToArray();
}
public string TimeDuration
{
get { return _time_duration; }
}
public int TotalFound
{
get { return _ttl_found; }
}
public int TotalWordsFoundInDatabase
{
get { return this._ttl_words_in_database; }
}
}
}
Tuesday, October 6, 2009
JWMD ExceptionBox
I have made my own ExceptionBox (window) for my applications in case something went wrong. I hate the default exception window in Windows Mobile ..
Anyway, here are some screenshots
Supports InnerException | ||
Exception Icons |
Code Snippet
try
{
int x = 0;
int y = 1;
int z = y / x;
}
catch (Exception ex)
{
using (ExceptionBox.Window frm = new ExceptionBox.Window("Error Occured", ExceptionBox.ExceptionIcons.Exception, ex.Message, ex))
{
frm.ShowDialog();
}
}
Download the binaries here | |
Initial Release October 7, 2009 |
Saturday, October 3, 2009
JWMD Icon Changer v2.6b for Windows Mobile 6.5
JWMD Icon Changer is a Start Menu customization tool designed for Windows Mobile 6.5
System Requirements:
Custom Controls Used: |
Here’s a short demo
Changing the Icons
Saving and Loading Theme
And some screen shots.
Here’s the download file
Update Information | Download Here |
January 23, 2010 - Version 2.6b October 7, 2009 October 6, 2009 | Click the green box XDA-Dev Thread Here Link 1 |
Have fun!