PC Review


Reply
Thread Tools Rate Thread

Compact Framework and Phone API Questions. Help!

 
 
Sirfalas
Guest
Posts: n/a
 
      18th Jun 2005
Hi. I have a question which I already asked about earlier but I still
don't understand.

I have VS.NET 2003 and want to develop for smartphone applications
using vb.net. Now, all i need is the Smartphone 2003 SDK Right? Well, i
installed it. I could make a simple application and deploy it with no
problems.

Now, I want to create more complex applications and to do that, I need
to access the phone APIs. How do i do that? When I was looking over the
net, they told me to use P/Invoke.

So i read up over on a couple of MSDN Articles and I get code like
this:

----
<DllImport("coredll.dll")>
Protected Shared Function RegisterHotKey

<DllImport("coredll.dll")>
Protected Shared Function UnregisterFunc1

<DllImport("coredll.dll")>
Protected Shared Function GetAsyncKeyState
----

But how would this function even work? I mean, i can't even find
coredll.dll in my computer so how would it work? I can't find any of
the phone api DLL files on my computer? How am i supposed to make it
run? From what i understand, it seems like i need the .net compact
framework sdk or something. Now where do i get it? Please help.

 
Reply With Quote
 
 
 
 
Sirfalas
Guest
Posts: n/a
 
      18th Jun 2005
btw, i have already seen OpenNETCF thing. I just want to know if there
is any way to create applications that accesses phone apis without
using OpenNETCF.

 
Reply With Quote
 
Guest
Posts: n/a
 
      18th Jun 2005
Sure. Copy the OpenNETCF code and call it your own - I mean really, APIs
are APIs. There's no magic, and there's really no other way to do it. Why
would you want to waste your time re-doing what's already been done? Why
not spend your time working on your application?

-Chris


"Sirfalas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> btw, i have already seen OpenNETCF thing. I just want to know if there
> is any way to create applications that accesses phone apis without
> using OpenNETCF.
>



 
Reply With Quote
 
Sirfalas
Guest
Posts: n/a
 
      18th Jun 2005
hmmm, you have a good point but for some reason, i can't seem to get
opennetcf working.

you see, my application, would require me to retrieve the imei
programatically, create a gprs connection and send that info to a
server side application. I am sure i will be able to create a gprs
connection and send that information and stuff as i spend more time
programming.

But, i can't retrieve the imei. I did all the searches and im using the
getDeviceID function and it doesn't work. This is what i do

-----
Imports OpenNETCF.win32

Dim phoneCore as core
lblDeviceId = phoneCore.getDeviceId()
-----

In my emulator, it returns a fake imei, "000001-0000-0000-0000" and in
my phone, (O2 Xphone), it returns the same fake imei. I thought it was
something to do with me not having enough privileges on my cellphone or
something.

So i decided to go to
http://msdn.microsoft.com/library/de...e_security.asp
and look at how i can resolve this issue and after reading it, i
connected my phone to my pc via usb, created an activesync connection
and ran the command "rapiconfig /p sdktestcerts.xml " and it ran the
command successfully.

To test whether or not my phone had developer cert, i use the PHM
Registry Editor application to see if i can access all the 'locked'
registry keys and i could read them but not change them. So if my phone
supposedly has developer certificates, why would get DeviceID return me
the fake imei on my cellphone?

I read more and I saw some code regarding getlineinfo. This is the
reason i decided not to use OpenNETCF. What am i doing wrong?

 
Reply With Quote
 
Peter Foot [MVP]
Guest
Posts: n/a
 
      18th Jun 2005
The deviceid is not the IMEI number, although it should give you a unique ID
for the device. If your device is a Smartphone then the security settings on
your phone may cause the GetDeviceID method to fail since it requires your
application to be signed with a priviledged certificate - and the emulator
doesn't return a device id. We don't have any methods in the SDF for
retrieving the IMEI, but it is accessible through TAPI, and you can use Alex
Feinman's TAPI wrapper - the API method you'll need is lineGetGeneralInfo,
and this should be wrapped in Alex's library -
http://www.alexfeinman.com/download.asp?doc=tapi1.1.zip

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://www.peterfoot.net |
http://www.opennetcf.org


"Sirfalas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> hmmm, you have a good point but for some reason, i can't seem to get
> opennetcf working.
>
> you see, my application, would require me to retrieve the imei
> programatically, create a gprs connection and send that info to a
> server side application. I am sure i will be able to create a gprs
> connection and send that information and stuff as i spend more time
> programming.
>
> But, i can't retrieve the imei. I did all the searches and im using the
> getDeviceID function and it doesn't work. This is what i do
>
> -----
> Imports OpenNETCF.win32
>
> Dim phoneCore as core
> lblDeviceId = phoneCore.getDeviceId()
> -----
>
> In my emulator, it returns a fake imei, "000001-0000-0000-0000" and in
> my phone, (O2 Xphone), it returns the same fake imei. I thought it was
> something to do with me not having enough privileges on my cellphone or
> something.
>
> So i decided to go to
> http://msdn.microsoft.com/library/de...e_security.asp
> and look at how i can resolve this issue and after reading it, i
> connected my phone to my pc via usb, created an activesync connection
> and ran the command "rapiconfig /p sdktestcerts.xml " and it ran the
> command successfully.
>
> To test whether or not my phone had developer cert, i use the PHM
> Registry Editor application to see if i can access all the 'locked'
> registry keys and i could read them but not change them. So if my phone
> supposedly has developer certificates, why would get DeviceID return me
> the fake imei on my cellphone?
>
> I read more and I saw some code regarding getlineinfo. This is the
> reason i decided not to use OpenNETCF. What am i doing wrong?
>



 
Reply With Quote
 
Sirfalas
Guest
Posts: n/a
 
      18th Jun 2005
oh. is that so? Thanks Peter Foot and Ctacke. you guys have been most
helpful. I always thought DeviceID returns the IMEI. I would need the
IMEI regardless even if the deviceID is unique.

Thanks. will check out the TAPI wrapper and reply.

 
Reply With Quote
 
Sirfalas
Guest
Posts: n/a
 
      18th Jun 2005
is there a working example of this? Preferably in VB.NET. I tried to
run the examples on my O2 and it doesn't work. The program doesn't even
run.

I think i might just have to let the user enter the imei manually and i
have to get on to the other parts of my project. Like creating the GPRS
connection and stuff.

 
Reply With Quote
 
Peter Foot [MVP]
Guest
Posts: n/a
 
      20th Jun 2005
Heres a little app I put together (VB.NET) to get info from the device
including IMEI, it uses Alex's wrapper:-
http://www.peterfoot.net/RetrieveIMEIThroughTAPI.aspx

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://www.peterfoot.net |
http://www.opennetcf.org

"Sirfalas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> is there a working example of this? Preferably in VB.NET. I tried to
> run the examples on my O2 and it doesn't work. The program doesn't even
> run.
>
> I think i might just have to let the user enter the imei manually and i
> have to get on to the other parts of my project. Like creating the GPRS
> connection and stuff.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compact Framework Phone Function KA Kueh Microsoft Dot NET Compact Framework 2 31st Dec 2008 04:48 AM
Re: Compact Framework Phone Function KA Kueh Microsoft Dot NET Compact Framework 2 29th Dec 2008 02:42 AM
.net Compact Framework question on loading phone APIs Sirfalas Microsoft Dot NET Compact Framework 2 15th Jun 2005 01:08 AM
Compact Framework and SqlCe questions Steve B. Microsoft Dot NET Compact Framework 4 1st Mar 2005 07:57 AM
Novice Questions on .NET Compact Framework Peter Microsoft Dot NET Compact Framework 4 19th Sep 2003 08:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:05 AM.