Sending HTTP Header in C++ - Windows Mobile Development and Hacking General

Hello,
I'm developing an application for Window Mobile 2003 that will upload GPS positional data to a server which can then be displayed to an end user.
I've managed to establish a connection to the internet using the connection manager Api. I now need to send a HTTP POST header to my server in order to upload the information, could anyone give me any guidance on the best way of doing this? I've tried the HTTPRequest.... functions but the function fails, is there an alternative to this method?
Thakn you in advance

Related

Starting up GPRS connection

How can I programatically initiate a GPRS connection on an XDA (using EVB)?. I have a program which works when the connection is up (started using explorer) but fails when down. Would I do it using the TAPI?
Martin
I think you should have a look at the Connection Manager API.
I don't have any EVB sample code for you, but take a look at the PocketPC 2002 SDK sample CMHELPER usualy found at this path if you have eVC and the SDK installed:
C:\Windows CE Tools\wce300\Pocket PC 2002\samples\mfc\CMHELPER
BTW, you can download the SDK from www.pocketpc.com ...
here is the solution
I also was lookinf for this solution forever and never found it so i wrote the software myself. Here is the dll that you need to connect to the internet through evb it connects to the default connection no problems.
http://xdaconnect.wastedbrains.com
have fun,
Dan Mayer
Not knowing anything about C++, is there a simple way to open a GPRS connection with just eVB?
danmanmayer, can you send me the sources?
Or maybe somebody knows URL where can I found info about it?
Thanks in advance
SapphireRAS does all this and more.
Connects/Disconnects via GPRS using eVB or VB.Net
Create and manages connections, locations etc.
See www.sapphire-solutions.co.uk

ConnMgrEstablishConnection Linking Error

I would appretiate if any one has any input on this subject.
I'm developing an application that will run on an Orange M1000 runnign Windows Mobile 2003, i'm using EVC++ 4.0 as my development environment.
The application needs to upload GPS data via the GPRS connection to a webserver. I'm under the impression the best approach to accomplishing this is by use of the Connection Api. However whenever i try compiling examples that use the connection api functions i.e.
ConnMgrEstablishConnection or ConnMgrEstablishConnectionSync I am always met with a linker error which states it is an unresolved external.
I've taken the code directly from the MSDN example with the inclusion of all the header files they suggest, but i still get these errors during linking, does anyone have any idea what-so-ever what may be causing this?
Thank you in advance
Resolved: I had to link cellcore.lib to the project

Writing a local proxy server WM6

Hi all,
I've written a proxy server in C# for my HTC Wizard running WM6 with the .NET Compact Framework. Its configured to route My Work Network through a proxy address 127.0.0.1 on port 8888. My proxy program runs a TcpListener on this port and IEMobile browser requests are sent to my proxy which goes to the web, gets each required file and returns them to the browser.
It works fine for files of the type htm, html, gif, png, jpg - but whenever a page uses css or js, it will not load the pages. Any clues as to why??
The program is simply an intermediate agent that reads and writes bytes from the browser and the remote point. Does anybody know why these different types of files never load correctly??
Please, any help or debug ideas is appreciated.
Thanks,
Nick
etnaelk said:
Hi all,
I've written a proxy server in C# for my HTC Wizard running WM6 with the .NET Compact Framework. Its configured to route My Work Network through a proxy address 127.0.0.1 on port 8888. My proxy program runs a TcpListener on this port and IEMobile browser requests are sent to my proxy which goes to the web, gets each required file and returns them to the browser.
It works fine for files of the type htm, html, gif, png, jpg - but whenever a page uses css or js, it will not load the pages. Any clues as to why??
The program is simply an intermediate agent that reads and writes bytes from the browser and the remote point. Does anybody know why these different types of files never load correctly??
Please, any help or debug ideas is appreciated.
Thanks,
Nick
Click to expand...
Click to collapse
wow, nice.
i could really really use your source code for something im working on.
care to share?
don't worry, it's not anything im planning to publish soon, just a personal project.
and if i ever will, it will be with your full concent and you will be credited.
[email protected]
thank you!
Everybody who want to share their internet connection on the phone via wifi to their local network via a proxy on the phone raise their hands.
woohoo! me me me! xD
actually, it is the proxy itself that i need for other functionality. thats why i need the source code...
me too, the proxy not the source code
etnaelk said:
Hi all,
I've written a proxy server in C# for my HTC Wizard running WM6 with the .NET Compact Framework. Its configured to route My Work Network through a proxy address 127.0.0.1 on port 8888. My proxy program runs a TcpListener on this port and IEMobile browser requests are sent to my proxy which goes to the web, gets each required file and returns them to the browser.
It works fine for files of the type htm, html, gif, png, jpg - but whenever a page uses css or js, it will not load the pages. Any clues as to why??
The program is simply an intermediate agent that reads and writes bytes from the browser and the remote point. Does anybody know why these different types of files never load correctly??
Please, any help or debug ideas is appreciated.
Thanks,
Nick
Click to expand...
Click to collapse
You alos need to do some header parsing. If you don't want to do much work, your best bet is just converting my Java language HTTP proxy to C# - it has no problems with any special files (and also supports HTTP Post). See http://www.pocketpcmag.com/blogs/index.php?blog=3&p=453&more=1&c=1&tb=1&pb=1 for the source & more info.
Thanks, Menneisyys.
I'll give it a look and hope it solves my problems. I definitely haven't done any header parsing so lets hope...
On an aside, I was wondering if anybody has any resources on the Connection Manager API for mobile device networking? I am looking for some sample code in C++ which it is native or better yet if anybody has ever ported it to C#. Or if anybody knows how to port a .h file to C#.
Any help is appreciated.
Thanks,
Nick

Advice on the choice of querying a remote DB

Hello everyone,
I come to you for some advice about an application I'm developing for Android 1.6 and higher.
Specifically, this application must be able to query a remote MySQL database and display the retrieved data. It need also be able to UPDATE data on this databse and that is where things get complicated ...
For selection queries, I wrote a small PHP script on the remote server that retrieves the desired data in the database and encodes them in JSON. From my Android application, I have no problem to retrieve, process and display them.
Now I wonder about the solution (if there is one ...) to run UPDATE from my application on the remote database. For now, I see only two solutions:
- Develop a webService on the server with an update method. Several problems with that: it seems webServices on Android are not easy (not native, have to go through external libs). Moreover, as it's UPDATE query, I want to make sure nobody else can use this webService.
- Alternatively, write a PHP script that makes the UPDATE and call it via HTTP. Same problem as webService: I want to secure this call to be sure that only I can use this script. These scripts can be integrated into an application already present on my server and which is secured by login / password. So, if it is possible to manage PHP sessions from Android, it's won! but Ican't find anything about it ...
What do you think? Ideas?
Thx!

Expert opinion on HTTP header

Hi guys,
I'm working on an app at the moment but I can't get it to work.
I am trying to load a webpage by its IP address, usually this will not work because the server doesn't know what site you want to access in the case of a shared hosting etc. So I am injecting the "host domain.com" header into the request. However the page will still not load.
Anyone got an idea of how I can do this. I know I can use the host file but I'm trying to achieve it without admin privileges. on the pc.
Using wireshark the only difference I found in the packet were GET string in the HTTP header so not sure if I'm missing something..
There is no way to help you if you don't provide any sort of source code or dump of the packages you're sending.

Categories

Resources