Tuesday, June 19, 2007

Getting phone number , IMEI and handle incoming calling

Peace upon you
Why I wrote this post? because many friends asked me about these following question to use them at GPand also I faced the same problems when I worked at BlueCom project(aimed to extends the original Bluetooth range from 10 meters to virtually unlimited range throw in system access points). I decided to send a message to receiver using mobile number so my first step access contact list using PIM API'S then display it(Contact list) to user when user choose specific person by his name the message will send to him but in vicinity there are many peoples opened BlueTooth, are able to receive any message so we encrypted the message and send with the packet the receiver phone number, any one in my vicinity(Scatternet) will receive it but the message will not displayed to him because it' was not relate to him As when he receive it we check the phone number of this person with the phone number attached to message if not the program will not notify him that he recive message.

let's see the common questions
Q1: How to get my own phone number ?
To get phone number using J2ME IS NOT POSSIBLE but there is tender solution:DJUST ASK USER ABOUT IT. yeah it's simple solution that we used in BlueCom but I think it's impractical, there is great solution for it using C++see this link http://wiki.forum.nokia.com/index.php/How_to_get_my_own_phone_number

Q2: how I can retrieve incoming call with j2me?
I think the incoming call handling differs from whether it is a MIDP1.0 phone or MIDP2.0 phone. As far as I know this is not possible in J2ME nowadays, but it's going to be changed shortly by the MTA - JSR 253: Mobile Telephony API.
Check the links below:
http://developers.sun.com/learning/j...ty/TS-7634.pdf & http://www.jcp.org/en/jsr/detail?id=253

To retrive icomming call use C++ at symbian OS
[code]
RMobileCall m_currentCall;
m_currentCall.OpenExistingCall(iLine, iIncomingCallName);
RMobileCall::TMobileCallInfoV1 callInfo;
RMobileCall::TMobileCallInfoV1Pckg callInfoPckg(callInfo);
m_currentCall.GetMobileCallInfo(callInfoPckg);
TBuf<50> aCallNumber;
aCallNumber.Copy(callInfo.iRemoteParty.iRemoteNumber.iTelNumber);
[/code]


Q3: how to get IMEI (International Mobile Equipment Identity)?
All mobile phones have their own unique IMEI number (can be shown by dialing *#06# on phone). use this method to get IMEI System.getProperty(parameter).;
This parameter depends on phone vendors In Siemens parameter will be com.siemens.IMEI In Nokia parameter is com.nokia.mid.imei , In Nokia, you must sign midlet to get IMEI Code( it's another story I will talk about it in more details)

hopefully this will help you:)
Salam

No comments: