Sunday, July 20, 2008

windows mobile get CellID

Programmatically getting the CellID from your Windows Mobile phone

http://dalelane.co.uk/blog/?p=241


he said..

I don’t know how the FindMe app is implemented, but after a little bit of playing tonight, it seems fairly easy to grab something similar to the “Cell” string they are using from the RIL_GetCellTowerInfo function in the Radio Interface Layer (RIL) API.
  1. Call RIL_Initialize to get a RIL handle
  2. Call RIL_GetCellTowerInfo to get the information about the cell tower the phone is connected to

    The “Cell” string that FindMe displays seems to be a combination of the dwCellID, dwLocationAreaCode and dwMobileCountryCode fields

  3. Call RIL_Deinitialize to release the RIL handle

and a code.. just try next week..

using System;
using System.Threading;
using System.Runtime.InteropServices;

namespace CellId
{
public class RIL
{
// string used to store the CellID string
private static string celltowerinfo = "";

/*
* Uses RIL to get CellID from the phone.
*/
public static string GetCellTowerInfo()
{
// initialise handles
IntPtr hRil = IntPtr.Zero;
IntPtr hRes = IntPtr.Zero;

// initialise result
celltowerinfo = "";

// initialise RIL
hRes = RIL_Initialize(1, // RIL port 1
new RILRESULTCALLBACK(rilResultCallback), // function to call with result
null, // function to call with notify
0, // classes of notification to enable
0, // RIL parameters
out hRil); // RIL handle returned

if (hRes != IntPtr.Zero)
{
return "Failed to initialize RIL";
}

// initialised successfully

// use RIL to get cell tower info with the RIL handle just created
hRes = RIL_GetCellTowerInfo(hRil);

// wait for cell tower info to be returned
waithandle.WaitOne();

// finished - release the RIL handle
RIL_Deinitialize(hRil);

// return the result from GetCellTowerInfo
return celltowerinfo;
}


// event used to notify user function that a response has
// been received from RIL
private static AutoResetEvent waithandle = new AutoResetEvent(false);


public static void rilResultCallback(uint dwCode,
IntPtr hrCmdID,
IntPtr lpData,
uint cbData,
uint dwParam)
{
// create empty structure to store cell tower info in
RILCELLTOWERINFO rilCellTowerInfo = new RILCELLTOWERINFO();

// copy result returned from RIL into structure
Marshal.PtrToStructure(lpData, rilCellTowerInfo);

// get the bits out of the RIL cell tower response that we want
celltowerinfo = rilCellTowerInfo.dwCellID + "-" +
rilCellTowerInfo.dwLocationAreaCode + "-" +
rilCellTowerInfo.dwMobileCountryCode;

// notify caller function that we have a result
waithandle.Set();
}



// -------------------------------------------------------------------
// RIL function definitions
// -------------------------------------------------------------------

/*
* Function definition converted from the definition
* RILRESULTCALLBACK from MSDN:
*
* http://msdn2.microsoft.com/en-us/library/aa920069.aspx
*/
public delegate void RILRESULTCALLBACK(uint dwCode,
IntPtr hrCmdID,
IntPtr lpData,
uint cbData,
uint dwParam);


/*
* Function definition converted from the definition
* RILNOTIFYCALLBACK from MSDN:
*
* http://msdn2.microsoft.com/en-us/library/aa922465.aspx
*/
public delegate void RILNOTIFYCALLBACK(uint dwCode,
IntPtr lpData,
uint cbData,
uint dwParam);

/*
* Class definition converted from the struct definition
* RILCELLTOWERINFO from MSDN:
*
* http://msdn2.microsoft.com/en-us/library/aa921533.aspx
*/
public class RILCELLTOWERINFO
{
public uint cbSize;
public uint dwParams;
public uint dwMobileCountryCode;
public uint dwMobileNetworkCode;
public uint dwLocationAreaCode;
public uint dwCellID;
public uint dwBaseStationID;
public uint dwBroadcastControlChannel;
public uint dwRxLevel;
public uint dwRxLevelFull;
public uint dwRxLevelSub;
public uint dwRxQuality;
public uint dwRxQualityFull;
public uint dwRxQualitySub;
public uint dwIdleTimeSlot;
public uint dwTimingAdvance;
public uint dwGPRSCellID;
public uint dwGPRSBaseStationID;
public uint dwNumBCCH;
}

// -------------------------------------------------------------------
// RIL DLL functions
// -------------------------------------------------------------------

/* Definition from: http://msdn2.microsoft.com/en-us/library/aa919106.aspx */
[DllImport("ril.dll")]
private static extern IntPtr RIL_Initialize(uint dwIndex,
RILRESULTCALLBACK pfnResult,
RILNOTIFYCALLBACK pfnNotify,
uint dwNotificationClasses,
uint dwParam,
out IntPtr lphRil);

/* Definition from: http://msdn2.microsoft.com/en-us/library/aa923065.aspx */
[DllImport("ril.dll")]
private static extern IntPtr RIL_GetCellTowerInfo(IntPtr hRil);

/* Definition from: http://msdn2.microsoft.com/en-us/library/aa919624.aspx */
[DllImport("ril.dll")]
private static extern IntPtr RIL_Deinitialize(IntPtr hRil);
}
}

Thursday, July 10, 2008

online meeting

Key word: online meeting, web conference

พอดีวันนี้หา tools เกี่ยวกับการ meeting บน internet เอามาเก็บไว้ซะหน่อย

http://thinkofit.com/webconf/realtime.htm

Web Conferencing Roundup: 9 Tools for Online Meetings
http://webworkerdaily.com/2007/11/12/web-conferencing-roundup/
(หวังว่า link จะไม่ตายถ้ากลับมาดูอีกที - เพราะว่ากว่าจะกลับมาอีกทีคงนาน)

Some of the features you might look for in an online meeting tool include:
Presentation, desktop, and application sharing
Chat — text, voice, and video
Whiteboarding and annotations
Two-way screen sharing so that attendees can become presenters
Shared mouse and keyboard control
Audioconferencing via VoIP or a dial-in number
Session recording
Multiplatform support for both hosting meetings and attending them
All browser-based solution — no download required Transparent pricing

มีตัวทั้งฟรีและไม่ฟรี

แต่ที่ผมสนใจคือตัวนี้ ...

"Adobe ConnectNow "

http://www.online-tech-tips.com/cool-websites/free-online-meeting-software/ พอดีอ่านนี่
https://www.acrobat.com/#/bw/BuzzwordBegin/

ทีแรกสับสนกะ Arcrobat Connect ก็ยังไม่ได้ลองแน่ะ แต่ตัวนั้นมันไม่ฟรี

ตัวนี้ Adobe Connect เพราะว่ามันทำตัวคล้าย social network ซะด้วย และให้บริการฟรี online (ก็ social network เป็นขุมพลังของฟรี และเป็นแหล่งขุดทองของธุรกิจใช่มั้ยหละ)

ไม่รู้ว่าเข้าใจผิดมั้ย เพราะยังไม่ได้ใช้ ภายนอกน่าจะเป็นการ sharing document .. แต่ในเวบที่เขียนแนะนำ เค้าว่ามัน meeting ได้.. ก็นะ จะเป็น conference แบบ text หรือ video นะ (แต่ถ้าเป็น text ก็อ่อนไปหน่อยอะ)

** เพิ่มหน่อยนะ
มีอีกตัวอะ

Mikogo = easy-to-use screen sharing tool and it's free !!
http://www.mikogo.com/Welcome.aspx

Screen Sharing
Change Presenters
Remote Control
Pause Transmission
Application Selection
File TransferMikogo is completely secure. We use industry-leading 256-AES end-to-end encryption.


มันต่อกับ Skype ด้วยเลยน่าสนใจ
แต่ที่สนใจจริงๆก็เพราะรูปยีราฟนี่แหละ เห็นแล้วชอบอะ...

ว่างๆจะลองใช้ของใหม่บ้าง .. ตอนนี้ก็นั่งกลุ้มเรื่องงาน กะการบ้านต่อปายย

Tuesday, July 08, 2008

Google Maps on mobile

http://code.google.com/apis/maps/faq.html
How do I deliver Maps applications on mobile devices?

The Google Maps API requires a complete JavaScript environment which is not broadly supported on existing mobile devices. We recommend using the Google Static Maps API to deliver customized maps to mobile phones:
http://code.google.com/apis/maps/documentation/staticmaps/
This delivers maps in GIF/JPG/PNG format, and supports a map type targeted at mobile devices.