×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    135

    how to get latitude and longitude from cellid in symbian c ++

    Hi all,





    void CNeworkInformation::CallMap(TUint acellid,TUint aareacode,const TDes& countrycode,const TDes& networkid,const TDes& shortname)
    {


    RBuf8 uri8;

    uri8.CleanupClosePushL();

    uri8.Create(1000);


    RBuf8 uri;

    uri.CleanupClosePushL();

    uri.Create(1000);



    uri8.Copy(_L8("http://www.google.com/glm/mmap"));


    uri.AppendNum(BinaryStringToInt(countrycode));

    uri.AppendNum(BinaryStringToInt(networkid));


    TBuf<20> cellid;

    cellid.AppendNum(acellid);

    uri.AppendNum(BinaryStringToInt(cellid));


    TBuf<20> areacode;

    areacode.AppendNum(aareacode);

    uri.AppendNum(BinaryStringToInt(areacode));


    TBuf<20> shortcid;

    shortcid.AppendNum(0);

    uri.AppendNum(BinaryStringToInt(shortcid));


    iClientEngine->IssueHTTPPostL(uri8,KAccept,uri);

    }

    i have written this code for getting llong and lat uging cellid,mcc,mnc,shortname

    but iam getting error 501 and 505

    same thing worked with windows mobile and android and i want to do for symbain c++

    i am using content type _LIT8(KAccept, "application/binary"); for this b'coz android and windows mobile usind dataInputstream

    plz help me

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: how to get latitude and longitude from cellid in symbian c ++

    I would ask that from the service providers support, those appear to me to be normal HTTP errors.

  3. #3
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    135

    Re: how to get latitude and longitude from cellid in symbian c ++

    i know that is http error and reason behind it may be

    HTTP Error 501 Not implemented

    Introduction

    The Web server (running the Web site) does not understand or does not support the HTTP method it finds in the HTTP data stream sent to it by the client (e.g. a Web browser or our CheckUpDown robot). The methods defined by the HTTP protocol are as follows:

    * OPTIONS: Find out the communication options available for a particular URL resource. Allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without a specific action involving transfer of data.
    * GET: Retrieve the information identified by the URL resource e.g. GET a particular Web page or image. The most common method by far.
    * HEAD: Identical to GET except that the server returns header information only, not the actual information identified by the URL resource. Useful to obtain metainformation about the entity implied by the request without transferring the entity-body itself. Often used to test hypertext links for validity, accessibility, and recent modification.
    * POST: Submit data to the Web server such as 1) post a message to a bulletin board, newsgroup or mailing list, 2) provide input data - typically from a CGI form - to a data-handling process, 3) add a record directly to a database.
    * PUT: Set (place/replace) the data for a particular URL to the new data submitted by the client. For example, upload a new Web page to a server.
    * DELETE: Remove the data associated with the URL resource. For example, delete a Web page.
    * TRACE: Run a remote, application-layer loop-back of the request message. Effectively a 'ping' which tests what data the Web server is receiving from the client.
    * CONNECT: Reserved for use with tunnelling (e.g. SSL) via a proxy server. This method is defined only for HTTP version 1.1, not the earlier version 1.0.

    If the method in the request HTTP data stream is not one of the above, then a 501 error will result. Or the method may be valid but not actually supported by the Web server. This typically only happens for newer methods such as CONNECT when received by older Web servers.

    501 errors in the HTTP cycle

    Any client (e.g. your Web browser or our CheckUpDown robot) goes through the following cycle when it communicates with the Web server:

    * Obtain an IP address from the IP name of the site (the site URL without the leading 'http://'). This lookup (conversion of IP name to IP address) is provided by domain name servers (DNSs).
    * Open an IP socket connection to that IP address.
    * Write an HTTP data stream through that socket.
    * Receive an HTTP data stream back from the Web server in response. This data stream contains status codes whose values are determined by the HTTP protocol. Parse this data stream for status codes and other useful information.

    This error occurs in the final step above when the client receives an HTTP status code that it recognises as '501'.

    but i am concern with coding point of view it is not working for me as symbian c++ and same code work for .net platform

    thanks for reply

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: how to get latitude and longitude from cellid in symbian c ++

    How is the Url ssuppose to look like ?, I'm wondering on why you are using BinaryStringToInt and what it is actually doing ?

  5. #5
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    135

    Re: how to get latitude and longitude from cellid in symbian c ++

    thanks for reply

    TUint32 CNeworkInformation::BinaryStringToInt(const TDesC& data )
    {

    TLex lex(data);
    TUint32 iResult;
    TInt Err = lex.Val(iResult, EBinary);

    return iResult;
    }

    to send data in binary format and content type application/binary

    also i tried one more to get lat and long from address and i got succes

    _LIT(KGoogleMapKey,"ABQIAAAA7mTDJNgGP953Yt-jOVCpaRSSyDKWhj1AwFHP2_2SAaYvELj_yhTyAVWHzDWGNg0x2EqtccgujgzKwA");

    uri8.Copy(_L8("http://maps.google.com/maps/geo?q=nibm%20kodhwa,%20pune,%20India&output=csv&key="));

    uri8.Append(KGoogleMapKey);

    iClientEngine->IssueHTTPGetL(uri8);

    CleanupStack::PopAndDestroy(&uri8);

    using this request i am getting long and lat from address using geocoding google api

    as per my knowledge i want to do like this link http://www.devx.com/wireless/Article/40524/195

    thanks in advance

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: how to get latitude and longitude from cellid in symbian c ++

    It is very hard to imagine that you have those values in 'binary' format. That BinaryStringToInt method converts binary numbers in a string to decimal integers.
    "1101" -> 13, "10000000" -> 128, etc.
    Do you really expect this functionality?

  7. #7
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,021

    Re: how to get latitude and longitude from cellid in symbian c ++

    this link might help to retrieve lat/long from google using the network info.:

    http://stackoverflow.com/questions/2...-on-blackberry

Similar Threads

  1. api for getting latitude longitude symbian c++
    By amit.mangal in forum Symbian
    Replies: 16
    Last Post: 2009-09-26, 10:07
  2. Reading latitude and longitude
    By sk.panda in forum Symbian
    Replies: 7
    Last Post: 2009-08-26, 06:26
  3. getting latitude and longitude
    By arun09 in forum Symbian
    Replies: 1
    Last Post: 2009-06-13, 13:39

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×