andbook!.pdf - Learning Android Get an anddev.org - Android-Shirt Back to index
anddev.org Header Logo
FAQ Search Top rated articles Browse Feeds anddev.org - Authors Contact Details Register Log in

Poor mans GPS - Cell(Tower)ID / Location Area Code -Lookup

Goto page Previous  1, 2, 3, 4
 
       anddev.org - Android Development Community | Android Tutorials | Index -> Map Tutorials
Author Message
phannguyen
Developer
Developer


Joined: 17 Jul 2008
Posts: 43

PostPosted: Fri Aug 01, 2008 7:51 am    Post subject: Reply with quote

thanks brijeshthakur for reply me,
I have opened logcat and run it with my app.
I got a error message from logcat like below picture.
so how can i solve this problem?are u over this problem?

thanks for help!



logcaterror.JPG
 Description:
 Filesize:  129.21 KB
 Viewed:  6382 Time(s)

logcaterror.JPG



_________________
PhanNguyen
Back to top
View user's profile Send private message Yahoo Messenger
brijeshthakur
Junior Developer
Junior Developer


Joined: 23 Jul 2008
Posts: 12
Location: Banglore,India

PostPosted: Fri Aug 01, 2008 1:30 pm    Post subject: Reply with quote

Hi phannguyen,

I am also getting the same error. actually the problem i guess is because of this app uses hidden api. so luck by chance it will run in US locations. but for others i m not sure.


so wait for the reply from plusminus.

till then..... Shocked

Regards,
Brijesh
Back to top
View user's profile Send private message
phannguyen
Developer
Developer


Joined: 17 Jul 2008
Posts: 43

PostPosted: Mon Aug 04, 2008 4:41 am    Post subject: Reply with quote

it's really disappoint.i cant run any app related to map. Crying or Very sad Crying or Very sad
please help us,plusminus!

_________________
PhanNguyen
Back to top
View user's profile Send private message Yahoo Messenger
paslatek
Once Poster
Once Poster


Joined: 13 Feb 2009
Posts: 1

PostPosted: Fri Feb 13, 2009 9:27 am    Post subject: Need help to use ggogle secret api Reply with quote

Hi

Could you provide a view of the tcp packet sent to google api to retrieve the datas.
I'm trying to use this api with a .Net call, so I need to compare the packet you send and mine, because I got a 501 error code Sad

I just need the hexadecimal packet of the request content.

Thks.
Back to top
View user's profile Send private message
Sar
Freshman
Freshman


Joined: 17 Mar 2009
Posts: 2

PostPosted: Thu Apr 02, 2009 2:31 am    Post subject: Reply with quote

ok i get a bunch of unresolved errors =/

basically for my api, everything under apache.commons is unresolved. seems i only have apache.common.logging;


additionally i dont have android.telephony.PhoneStateIntentReceiver. so i used PhoneStateListener instead. hope that suffices.

i changed import android.net.ContentURI to net.uri seeing page 2's advice. so thats that. but the http's got me reeling.

urmmm haha why is it missing? what pre-requisites do i require to use these codes?
Back to top
View user's profile Send private message
PI9
Junior Developer
Junior Developer


Joined: 06 Apr 2009
Posts: 11

PostPosted: Mon May 25, 2009 2:10 pm    Post subject: knowing wether there is a good reception Reply with quote

Hello everyone,
I'd like to make an app which draws a picture when there is a normal/good reception and another picture when there is no reception.
I'im trying wih ServiceState but there is a problem and my app "stops unexpectely"...

Java:
private ImageView reception;
ServiceState mservicestate = new ServiceState();
          int state = mservicestate.getState();
          if(state == android.telephony.ServiceState.STATE_OUT_OF_SERVICE)
               reception.setImageResource(R.drawable.reseau);
          else
               reception.setImageResource(R.drawable.pas_reseau);


Can you please hep me understand what's wrong in my program ?
Thanks in advance
Back to top
View user's profile Send private message
AniAnish
Once Poster
Once Poster


Joined: 08 Jun 2009
Posts: 1

PostPosted: Mon Jun 08, 2009 1:03 pm    Post subject: Good Tutorial Reply with quote

Good Tutorial Very Happy Thank you PlusMinus
Back to top
View user's profile Send private message
jlamance
Once Poster
Once Poster


Joined: 14 Jul 2009
Posts: 1

PostPosted: Tue Jul 14, 2009 2:08 pm    Post subject: Reply with quote

plusminus wrote:
quauhtlimtz wrote:
It is not clear for me why use this way to locate people if you have the GPS option that is even more accurate. What are the advantages about using this way to locate people???


Hello quauhtlimtz,

there is exactly NO advantage, except the fact that perhaps not all phones come with a GPS-chip Wink.

Regards,
olusminus


Great example! I'll take exception to using GPS all the time though.

There are a few advantages to having something other than (or in addition to) GPS to provide location. First GPS doesn't work everywhere. Suburban residential is about as harsh an environment as GPS can really work in, even with new high sensitivity receivers. Second, the GPS takes a fair amount of battery life (which is why you can turn it off). So if you're running an application that only needs rough location (1-5 km, for example), then the cell location may be the preferred method. An example would be trying to recover local weather where the additional accuracy of the GPS (if available) does not add to the app.
Back to top
View user's profile Send private message
lavans4u
Once Poster
Once Poster


Joined: 01 Jul 2009
Posts: 1

PostPosted: Wed Jul 15, 2009 5:10 pm    Post subject: Reply with quote

hi pluas minus and aother friends

i want that software for a try.....am not able to caode and compile it because am a beginner in it...
so anybody please upload that software for me.....

http://people.apache.org/~dims/android/LocateMe-3.0.zip

i tried this link....but i can download it.....

please help me.....please
Back to top
View user's profile Send private message
Hetal_Vora
Once Poster
Once Poster


Joined: 07 Aug 2009
Posts: 1

PostPosted: Mon Aug 10, 2009 9:39 am    Post subject: Reply with quote

Hi plusminus,

Good tutorial as always Smile . I had a question...
Is it possible to implement network triangulation to locate the device position in Android. Your tutorial uses only a single cell tower to pin-point the location of the device. Is it possible to contact other cell towers (since a device would be communicating to more than 1 tower at any time), retrieve their position, plot their circle of coverage and get the device position as the intersection point.

I am unable to locate any API methods which would give me information of all the cell towers the device communicates with.
Back to top
View user's profile Send private message
Ripityom
Freshman
Freshman


Joined: 07 Oct 2009
Posts: 4

PostPosted: Wed Oct 07, 2009 2:13 pm    Post subject: problem with org.apache.commons.httpclient Reply with quote

Hi plusminus!

I've got a problem while doing the tutorial.
Eclipse says that org.apache.commons.httpclient cannot be resolved.
I'm pretty new to android, I use 1.5 SDK and 1.5 firmware on the dev phone (well there's not mutch to do with it, i guess).

Any idea?

Thanx
Ripityom
Back to top
View user's profile Send private message
delta_foxtrot
Freshman
Freshman


Joined: 01 Nov 2009
Posts: 2

PostPosted: Sun Nov 01, 2009 8:52 am    Post subject: Re: problem with org.apache.commons.httpclient Reply with quote

Ripityom wrote:
Any idea?


The SDK has changed substantially:

Java:
   private void getGoogleCellID(int lac, int cid)
    {
     int shortcid = cid & 0xffff;

        try
        {
            String surl = "http://www.google.com/glm/mmap";
           
            HttpClient httpclient = new DefaultHttpClient();
            HttpPost httppost = new HttpPost(surl);
            httppost.setEntity(new MyCellIDRequestEntity(shortcid, lac));
            HttpResponse response = httpclient.execute(httppost);
            HttpEntity entity = response.getEntity();
            DataInputStream dis = new DataInputStream(entity.getContent());
             
             // Read some prior data
             dis.readShort();
             dis.readByte();
             // Read the error-code
             int errorCode = dis.readInt();
             if (errorCode == 0)
             {
                  double lat = (double) dis.readInt() / 1000000D;
                  double lng = (double) dis.readInt() / 1000000D;
                  int range = dis.readInt(); // in metres
                 
                  System.out.println("From google with love: lat="+lat+", lon="+lng+", range="+range);
             }
        } catch (Exception e) {}
    }


Java:
class MyCellIDRequestEntity implements HttpEntity
{
     protected int myCellID;
     protected int myLAC;

     public MyCellIDRequestEntity(int aCellID, int aLAC)
     {
          this.myCellID = aCellID;
          this.myLAC = aLAC;
     }

     public Header getContentType()
     {
      return new BasicHeader("Content-Type", "application/binary");
     }

     @Override
     public void consumeContent() throws IOException
     {
     }

     @Override
     public InputStream getContent() throws IOException, IllegalStateException
     {
          return null;
     }

     @Override
     public Header getContentEncoding()
     {
          return null;
     }

     @Override
     public boolean isChunked()
     {
          return false;
     }

     @Override
     public boolean isStreaming()
     {
          return false;
     }

    /** Pretend to be a French Sony_Ericsson-K750 that
     * wants to receive its lat/long-values =)
     * The data written is highly proprietary !!! */

     @Override
     public void writeTo(OutputStream outputStream) throws IOException
     {
        DataOutputStream os = new DataOutputStream(outputStream);
        os.writeShort(21);
        os.writeLong(0);
        os.writeUTF("fr");
        os.writeUTF("Sony_Ericsson-K750");
        os.writeUTF("1.3.1");
        os.writeUTF("Web");
        os.writeByte(27);

        os.writeInt(0); os.writeInt(0); os.writeInt(3);
        os.writeUTF("");
        os.writeInt(myCellID); // CELL-ID
        os.writeInt(myLAC); // LAC
        os.writeInt(0); os.writeInt(0);
        os.writeInt(0); os.writeInt(0);
        os.flush();
     }

     @Override
     public long getContentLength()
     {
          return -1;
     }

     @Override
     public boolean isRepeatable()
     {
          return true;
     }
}
Back to top
View user's profile Send private message
estebanuri
Freshman
Freshman


Joined: 20 Nov 2009
Posts: 2

PostPosted: Fri Nov 20, 2009 8:46 am    Post subject: Reply with quote

Does anyone know how to get ALL IDs Cell Tower in range of the device?

If we could have all the Cell Ids, we could calculate the position much more accurately, for example if we had several antennas we could average their latitudes and longitudes. The problem is that at a time we can get a single antenna.

Will there be any way to get them all?
Back to top
View user's profile Send private message
delta_foxtrot
Freshman
Freshman


Joined: 01 Nov 2009
Posts: 2

PostPosted: Fri Nov 20, 2009 5:09 pm    Post subject: Reply with quote

estebanuri wrote:
Does anyone know how to get ALL IDs Cell Tower in range of the device?

If we could have all the Cell Ids, we could calculate the position much more accurately, for example if we had several antennas we could average their latitudes and longitudes. The problem is that at a time we can get a single antenna.

Will there be any way to get them all?


Yes you can get the neighbouring Cell IDs, and even the signal strength.
Back to top
View user's profile Send private message
estebanuri
Freshman
Freshman


Joined: 20 Nov 2009
Posts: 2

PostPosted: Fri Nov 20, 2009 5:42 pm    Post subject: Reply with quote

That's right, I didn't see the right class API.

http://developer.android.com/reference/android/telephony/TelephonyManager.html

public List<NeighboringCellInfo> getNeighboringCellInfo ()

Since: API Level 3
Returns the neighboring cell information of the device.
Returns
List of NeighboringCellInfo or null if info unavailable.
Requires Permission: (@link android.Manifest.permission#ACCESS_COARSE_UPDATES}

Thank you delta_foxtrot!

PS: It is remarkable that implements it, other platforms such as Blackberry does not include it in their API.
Back to top
View user's profile Send private message
Display posts from previous:   
       anddev.org - Android Development Community | Android Tutorials | Index -> Map Tutorials All times are GMT + 1 Hour
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


© 2007, Android Development Community
All rights reserved.
Powered by phpBB.