Andri Yadi

A geeky technopreneur, trying to do something big with his startup

May 2008 - Posts

  • Send SMS to Outlook Contact - A VSTO Outlook Add-in

    Imagine you can send an SMS message to a mobile phone number of an Outlook contact directly from your Outlook. Despite there are some Outlook Add-ins those allow to do that, why don't build by your own. All you need are VSTO and GSM modem, either dedicated GSM modem or a mobile phone that can be connected via COM (using USB, Bluetooth, or Infrared).

    Here are some capture how our add-in will look like.

    Toolbar

    Custom toolbar to connect to GSM modem and display SMS form

    GSM Modem Form

    When you click GSM Modem button, GSM Modem form will be displayed. Fill the textfields and click connect, "Phone is connected" dialog will be shown if connection is successful.

    SMS Form

    Clicking Send SMS button will display SMS Form. Number will be filled automatically from Contact's mobile phone.

    Ribbon

    By double clicking to a contact in contact list, contact detail will be displayed. I add two controls to ribbon to connect to GSM modem. If connection has been made previously, it will not connect again. There is also a form region to send SMS directly from Contact detail.

    GSM Communication

    For GSM communication, I don't make it from the scratch. Instead, I use GSM Communication Library available at: http://www.scampers.org/steve/sms. Some basic knowledge about GSM Comm:

    1. Make a connection to GSM modem device

    public GsmCommMain GsmComm {set; get;}
     
    public void Connect(int comPort, int baudRate, int timeout)
    {
        try
        {
            GsmComm = new GsmCommMain(comPort, baudRate, timeout);
            GsmComm.PhoneConnected += new EventHandler(GsmComm_PhoneConnected);
            GsmComm.PhoneDisconnected += new EventHandler(GsmComm_PhoneDisconnected);
     
            GsmComm.Open();
        }
        catch (System.Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }
    void GsmComm_PhoneDisconnected(object sender, EventArgs e)
    {
        MessageBox.Show("Phone is disconnected");
    }
     
    void GsmComm_PhoneConnected(object sender, EventArgs e)
    {
        MessageBox.Show("Phone is connected");
    }

    2. Disconnect

    public void Disconnect()
    {
        if (GsmComm != null && GsmComm.IsOpen())
        {
            GsmComm.PhoneConnected -= new EventHandler(GsmComm_PhoneConnected);
            GsmComm.PhoneDisconnected -= new EventHandler(GsmComm_PhoneDisconnected);
     
            GsmComm.Close();
        }
    }

    3. Send Short Message

    public void SendSms(String phoneNo, String msg)
    {
        if ((GsmComm == null) || (!GsmComm.IsOpen()))
        {
            MessageBox.Show("Phone is not connected");
            return;
        }
     
        try
        {
            SmsSubmitPdu pdu = new SmsSubmitPdu(msg, phoneNo, String.Empty);
            GsmComm.SendMessage(pdu);
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }
    }

    The rest code are used for building Outlook Add-in, add custom toolbar, add custom ribbon, form region, and other Windows Forms. Complete code can be downloaded at: http://dycode.com/files/folders/codesamples/entry125.aspx

    I make a screencast to show you how to build this add-in step by step.

    http://images.soapbox.msn.com/flash/soapbox1_1.swf?c=v&v=c2985270-5ec6-412b-bf3b-32485adf428a <p><a href="http://images.soapbox.msn.com/flash/soapbox1_1.swf?c=v&v=c2985270-5ec6-412b-bf3b-32485adf428a" target="_blank">http://images.soapbox.msn.com/flash/soapbox1_1.swf?c=v&v=c2985270-5ec6-412b-bf3b-32485adf428a</a></p>

    View original media here: http://video.msn.com/video.aspx?vid=c2985270-5ec6-412b-bf3b-32485adf428a

    You can download good quality video by following this link: http://cid-0cbe0e395b6f9491.skydrive.live.com/self.aspx/Public/SendSMSOutlookAddIn.zip 

    That's it for now. Enjoy.

    Share this post: | | | |
  • 100 Years Indonesia National Awakening

    Sungguh ironis, 4 hari setelah peringatan 100 tahun Kebangkitan Nasional Indonesia, harga BBM ikut bangkit (baca: naik - red). Apakah Indonesia sudah benar-benar bangkit dalam 100 tahun terakhir ini? Sebuah pertanyaan besar.

    Terlepas dari carut marutnya kondisi multi dimensional di Indonesia, ada secerca harapan di area teknologi, khususnya teknologi informasi. Simaklah artikel bertajuk "Kebangkitan, LAHIR dan TUMBUH dalam GELANGGANG", yang dimuat di majalah Teknopreneur, Edisi 18|Mei 2008, yang bercerita tentang bagaimana geliat kebangkitan bidang teknologi di tengah kisah buram di negeri tercinta kita. Berikut hasil scan artikel tersebut (mudah2an publikasi hasil scan berikut tidak menyalahi aturan. Jika iya, tolong segera beritahukan agar segera bisa dihilangkan). Surprisingly, DyCode ikut diceritakan dalam artikel ini. Selamat membaca...

    Page 1

    Page 1

    Page 2

    Page 2

    Page 3

    Page 3. As you can see...DyCode and me are told in this article.

    Page 4

    Page 4

    Dan, di halaman 4 dimuat juga foto saya yang ganteng itu :P (foto ber-border merah). Itu bukan hasil editing dengan image manipulation software. You can buy the magazine if you don't trust me :)

    Cukup membanggakan, bisa disejajarkan dengan foto pak Habibie. Mudah2an saya dan perusahaan saya bisa berkontribusi dalam membangkitkan Indonesia di dalam negeri dan dunia internasional dari sisi IT, dengan tetap bersemangat Indonesia.

    Bangkitlah Indonesiaku!!!

    Share this post: | | | |
  • "Poisoning" PHP Developers at MSDN Day | PHP on Windows

    On Thursday, May 15, 2008, I talk about Interoperability between .NET and PHP through XML/SOAP Web Services at MSDN Day | PHP on Windows. During my session, I do a little "poisoning" to PHP developers by showing to them how easy creating web services and proxy classes to access web services in .NET using Visual Studio. And it's quite successfull, a participant finally asks Visual Studio price since he is interested on Visual Studio features. I think I should be a Visual Studio marketer :)

    But honestly, it's all about tool. I think the simplification of Web Services-related stuffs can also be done in PHP world if PHP IDE support those kind of stuffs. I don't know whether the famous PHP IDE, Zend Studio, support them. Please somebody from Zend Indonesia explain about Web Services-related stuffs. Honestly, I do wanna know to enrich my knowledge :)

    For this MSDN Day, I have to install PHP runtime, PHP editor, and dig to well-buried PHP manual after I've left PHP for more than two years. For PHP editor, I still can't find a comprehensive and free PHP editor. Too bad I can't build one :) Since I love Visual Studio and I want to be able to create PHP script within VS environment, I finally find a plugin for VS to create PHP project. That plugin is called Vs.Php from Jcx.Software. The 30 days-trial version is available for download. Since I think I still have no intention to go back to PHP after 30 days later, I just install that trial version plugin, and sure I will uninstall it several days after the event :)

    During this talk, I talk about:

    • Integration options between PHP and .NET
    • Web Services integration option
    • Calling ASP.NET Web Services using Microsoft AJAX Library from PHP or non .NET code

    The presentation slide can be downloaded at: http://dycode.com/files/folders/msdnday/entry123.aspx

    I do some live codings to show how easy to develop interop between PHP and .NET through XML/SOAP Web Services. For example, in #1 demo I create an ASP.NET Web Services, and then create the consumer of that web service in PHP script. For that purpose, I use a library called NuSOAP to develop PHP SOAP Web Service client.

    ASP.NET Web Service code. This is deployed at URL: http://localhost/MiscWebServices/WebService.asmx

    <%@ WebService Language="C#" Class="WebService" %>
     
    using System;
    using System.Web;
    using System.Web.Services;
    using System.Web.Services.Protocols;
     
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    [System.Web.Script.Services.ScriptService]
    public class WebService : System.Web.Services.WebService
    {
        [WebMethod]
        public string GetServerTime()
        {
            return DateTime.Now.ToString();
        }
     
        [WebMethod(Description = "Get Server Time with supplied format")]
        public string GetFormattedServerTime(String format)
        {
            return DateTime.Now.ToString(format);
        }
    }

    And the PHP code as the client:

    <?php
    //Refer to NuSOAP lib
    require_once('../../nusoap-0.7.3/lib/nusoap.php');
     
    //Create WS client
    $client = new nusoap_client("http://localhost/MiscWebServices/WebService.asmx?WSDL", 'false');
     
    //Check if there is error
    $err = $client->getError();
    if ($err) {
        echo ('<h2>Constructor error</h2><pre>'.$err.'</pre>');
    }
     
    //Create param
    $param = array();
     
    //Call WS
    $result = $client->call('GetServerTime', $param);
     
    //Check error
    if ($client->fault) {
        echo '<h2>Fault</h2><pre>';
        print_r($result);
        echo '</pre>';
    } else {
        echo '<h2>Result</h2><pre>';
        echo ($result['GetServerTimeResult']);
        echo '</pre>';
    }
    ?>

    What if the accessed web method need parameter(s)? Well, you can just supply the $param array with needed parameter(s).

     

    I'm so glad to be involved in this MSDN Day. Hopefully, my talk can be a starting point to integrate your PHP to .NET or Windows platform.

    That's it. Enjoy. Have a nice weekend.

    Share this post: | | | |
    Posted May 17 2008, 02:36 PM by andriyadi with no comments
    Filed under:
  • VSTO & MOSS with Visual Studio 2008

    As part of Developer Workshop for Financial Services, on May 8, 2008, I delivered a training about VSTO and MOSS with Visual Studio 2008. The training was held at Solusi Training Center (Sarana Solusindo Informatika), sponsored by Microsoft Indonesia.

    Since MOSS cannot be installed on my Windows Vista machine, I install MOSS on Windows Server 2008 running on Virtual PC. So, entire coding is done in VPC. Most of training time I use for demo and hands on lab, so not many slide I presented. As demo and training scenario, I choose:

    • Binding Word content control to SharePoint content type
    • Creating simple SharePoint workflow using VSTO 3.0
    • Accessing MOSS Search web service

    That's it.

    Share this post: | | | |
  • WSS 3.0 Installation Screencast

    Just want to show you how easy WSS 3.0 installation on Windows Server 2008, I've made a screencast as follow. Currently, it has no audio explaining installation process, but I will add it later. I think you can grab the explaination just by seeing the video.

    FYI, not like Windows Server 2003, Windows Server 2008 doesn't bundle and install Windows Sharepoint Services by default. You have to download and install it separately.

    Sorry for crappy video quality. I encode it using Expression Encoder and the quality is good in my PC. But after I upload it to Silverlight Streaming Services and view it, it doesn't look good. Please find the attachment to download better video.

    The installation use SharePoint3.0WithSP1.exe installer. If you attent the last MSDN Day about Sharepoint, I'm sure you get the DVD contains that file. If you don't, you can download it at http://www.microsoft.com/downloads/details.aspx?familyid=EF93E453-75F1-45DF-8C6F-4565E8549C2A&displaylang=en

    What are system requirements to install WSS 3.0 you ask? Here they are: (taken from Technet)

    • Operating System: Windows Server 2003 SP1 or Windows Server 2003 x64 or Windows Small Business Server 2003; .NET Framework 3.0; Internet Information Services (IIS) 6.0 or later with common files, Simple Mail Transfer Protocol (SMTP) service, World Wide Web service
    • Hardware for Single-Box Installation: Server with a processor speed of at least 2.5 GHz; RAM capacity of 1 GB minimum, 2 GB recommended; disk space up to 2 GB for installation minimum, 5 GB or more minimum for data.

    That's it. For Single-Box Installation, you don't even need SQL Server, since WSS will install SQL Express as content and configuration database. Actually, I don't have computer with 2.5 GHz processor speed, but I have it installed successfully :)

    That's it. Have a nice try. Please give you comments.

    Share this post: | | | |
  • WSS 3.0 Demo

    For you who haven't know what Windows Sharepoint Services (WSS) is all about and the newest features of WSS 3.0, you have to see this demo at: http://www.microsoft.com/sharepoint/demo.mspx

    FYI, most of demonstrated features are available for free, except Office Sharepoint Server 2007 and Office Sharepoint Designer 2007, as long as you have Windows Server 2003/2008 & SQL Server 2000/2005 (those are should be bought). As this site says, WSS 3.0 is available as a separate download  that is available to customers at no additional charge.

    I'm not trying to sell something here, Microsoft doesn't pay me to do that :) I just wanna share with you about WSS 3.0 from developer & entrepreneur perspective. From developer perspective, WSS 3.0 is a comprehensive web application platform that can be extensively customized to develop LOB web application. From entrepreneur perspective, you can sell the solutions based on WSS, such as deployment, customization. etc. Not like Community Server (sorry CS lover, actually I'm also CS lover :P) that its license should be bought by the end user (beside the Windows Server), there is no money to spend to implement WSS within end user's environment. The only things should be bought are Windows Server 2003/2008 and SQL Server 2000/2005 (correct me if I'm wrong :P), while SQL Server 2005 can be replaced by SQL Server Express 2005 (I haven't try to use SQL Server Express, but I will & let you know how it will come).

    That's it. Have a great day.

    Share this post: | | | |