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

Tutorials that use the MapActivity. Many using GPS functionality.

Postby E.Jyothsna » Tue Apr 08, 2008 8:51 am

i saw ur tutorial.Its very nice.Here we have to give the cell id and LAC.My question is how to findout cell id and LAC sothat it will find out location in map?can u plz reply me
E.Jyothsna
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu Feb 28, 2008 12:25 pm
Location: chennai

Top

Why map application doesn't working "behind the proxy&

Postby Senthil » Mon May 19, 2008 5:38 pm

Hi plusminus,
Am working behind the proxy, not getting map tiles in android map application.what would be the reason?
if you come to know please let it me know.

Thanks & Regards,
Senthil Arjunan
Senthil Arjunan
Senthil
Freshman
Freshman
 
Posts: 5
Joined: Fri Apr 18, 2008 5:54 pm
Location: Kanpur

Re: Why map application doesn't working "behind the pr

Postby plusminus » Mon May 19, 2008 6:57 pm

Senthil wrote:Hi plusminus,
Am working behind the proxy, not getting map tiles in android map application.what would be the reason?
if you come to know please let it me know.

Thanks & Regards,
Senthil Arjunan


The reason is being behind the proxy.
As I'm not in the same position (no proxy), its really hard to help here.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby oktapris » Sat Jun 07, 2008 9:32 am

rock_win wrote:Hi

can someone please explain the different values written in writeRequest Method:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public void writeRequest(OutputStream outputStream) throws IOException {
  2.           DataOutputStream os = new DataOutputStream(outputStream);
  3.           os.writeShort(21);
  4.           os.writeLong(0);
  5.           os.writeUTF("fr");//country code
  6.           os.writeUTF("Sony_Ericsson-K750");//phone make
  7.           os.writeUTF("1.3.1");//software version
  8.           os.writeUTF("Web");//type
  9.           os.writeByte(27);
  10.  
  11.           os.writeInt(0); os.writeInt(0); os.writeInt(3);
  12.           os.writeUTF("");
  13.           os.writeInt(myCellID); // CELL-ID
  14.           os.writeInt(myLAC); // LAC
  15.           os.writeInt(0); os.writeInt(0);
  16.           os.writeInt(0); os.writeInt(0);
  17.           os.flush();
  18.      }
  19.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


Just trying this piece of code (only HTTP protocol part) to verify this "hidden" API.
I'm using value got from CellTrack application in my phone, and substitute above parameters.
It's working in my country (ID).
The two parameters after LAC is MNC and MCC according to this site: http://maps.alphadex.de/datafiles/fct0e ... 3ccc1a.txt .
It's locating my position with quite acceptable accuracy (I don't know how accurate it is, seems showing 1km radius of my position if it's checked using Google Map).
--
okta
oktapris
Once Poster
Once Poster
 
Posts: 1
Joined: Sat Jun 07, 2008 9:12 am
Location: Jakarta, Indonesia

Postby roleme » Fri Jul 18, 2008 3:26 pm

how can resolve my geolocation if i have such information
My Location (mcc, mnc, lac, cell) is: (255, 2, 1799, 307)
roleme
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Jul 18, 2008 3:20 pm
Location: Ukraine

Postby plusminus » Sat Jul 19, 2008 9:22 am

roleme wrote:how can resolve my geolocation if i have such information
My Location (mcc, mnc, lac, cell) is: (255, 2, 1799, 307)


The method above does not work :?:
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Postby phannguyen » Tue Jul 22, 2008 10:43 am

hi plusminus,
i use full your source code. when i run this app, a error message occur like below pic.

what wrong here?
please help me!
thanks a lot.
Attachments
android_err.JPG
Error Message
android_err.JPG (39.07 KiB) Viewed 9911 times
PhanNguyen
phannguyen
Experienced Developer
Experienced Developer
 
Posts: 56
Joined: Thu Jul 17, 2008 7:37 am

is there any issue with proxy.

Postby brijeshthakur » Wed Jul 23, 2008 1:57 pm

Hi.
I am getting an error while running the application with different values i.e Cell-Id & LAC.
error says :-
ERROR/LocateMe(748): org.apache.commons.httpclient.NoHttpResponseException: The server http://www.google.com failed to respond
ERROR/LocateMe(748): org.apache.commons.httpclient.NoHttpResponseException: The server http://www.google.com failed to respond
ERROR/LocateMe(748): at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1835)
ERROR/LocateMe(748): at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590)
ERROR/LocateMe(748): at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995)
ERROR/LocateMe(748): at com.mindtree.gps.CellIDToLatLong.tryToLoate(CellIDToLatLong.java:178)
ERROR/LocateMe(748): at com.mindtree.gps.CellIDToLatLong$1$1.run(CellIDToLatLong.java:83)

I am behind proxy.Is there any issue with that???

Thanks in advance
brijeshthakur
Junior Developer
Junior Developer
 
Posts: 12
Joined: Wed Jul 23, 2008 12:36 pm
Location: Banglore,India

A-gps

Postby stilwalli » Tue Jul 29, 2008 12:01 pm

Is this example for A-GPS.

Is A-GPS related to this example in anyway. I want to know if there is any special API for A-GPS?
stilwalli
Developer
Developer
 
Posts: 35
Joined: Mon Jul 21, 2008 8:13 am

Postby phannguyen » Wed Jul 30, 2008 5:26 am

hi plusminus,
please help me explaining why findViewById() function return null:

cellidtolatlong.java
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  public void onCreate(Bundle icicle) {
  3.  
  4.           super.onCreate(icicle);
  5.  
  6.           this.setContentView(R.layout.main);
  7.  
  8.          ................
  9.  
  10.          this.myCmdUpdate = (Button) findViewById(R.id.cmd_update);//why it return null?
  11.  
  12.          this.myCmdUpdate.setOnClickListener(this.cmdUpdateListener);
  13.  
  14.          .................
  15.  
  16.  
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


main.xml
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  5.  
  6.              android:orientation="vertical"
  7.  
  8.              android:layout_width="fill_parent"
  9.  
  10.              android:layout_height="fill_parent"
  11.  
  12.        >
  13.  
  14.      <!-- Input-Stuff -->
  15.  
  16.      <TextView
  17.  
  18.          android:layout_width="wrap_content"
  19.  
  20.          android:layout_height="wrap_content"
  21.  
  22.          android:text="CELL-ID"
  23.  
  24.          />
  25.  
  26.      <EditText id="@+id/edit_cellid"
  27.  
  28.          android:layout_width="fill_parent"
  29.  
  30.          android:layout_height="wrap_content"
  31.  
  32.          android:singleLine="true"
  33.  
  34.          />
  35.  
  36.      <!-- The Buttons next to each other -->
  37.  
  38.      <TextView
  39.  
  40.          android:layout_width="wrap_content"
  41.  
  42.          android:layout_height="wrap_content"
  43.  
  44.          android:text="LAC"
  45.  
  46.          />
  47.  
  48.      <EditText id="@+id/edit_lac"
  49.  
  50.          android:layout_width="fill_parent"
  51.  
  52.          android:layout_height="wrap_content"
  53.  
  54.          android:singleLine="true"
  55.  
  56.          />
  57.  
  58.                  
  59.  
  60.      <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  61.  
  62.               android:orientation="horizontal"
  63.  
  64.               android:layout_width="fill_parent"
  65.  
  66.               android:layout_height="wrap_content"
  67.  
  68.            >
  69.  
  70.         <Button id="@+id/cmd_update"
  71.  
  72.               android:layout_width="wrap_content"
  73.  
  74.               android:layout_height="fill_parent"
  75.  
  76.               android:text="Update"
  77.  
  78.               />
  79.  
  80.         <Button id="@+id/cmd_locateme"
  81.  
  82.               android:layout_width="wrap_content"
  83.  
  84.               android:layout_height="fill_parent"
  85.  
  86.               android:text="Locate Me!">
  87.  
  88.             <requestFocus/>
  89.  
  90.         </Button>
  91.  
  92.     </LinearLayout>
  93.  
  94. </LinearLayout>
  95.  
  96.  
Parsed in 0.006 seconds, using GeSHi 1.0.8.4


R.java
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. package org.anddev.android.cellidtolatlong;
  3.  
  4.  
  5.  
  6. public final class R {
  7.  
  8.     public static final class attr {
  9.  
  10.     }
  11.  
  12.     public static final class drawable {
  13.  
  14.         public static final int icon=0x7f020000;
  15.  
  16.     }
  17.  
  18.     public static final class id {
  19.  
  20.         public static final int cmd_locateme=0x7f050003;
  21.  
  22.         public static final int cmd_update=0x7f050002;
  23.  
  24.         public static final int edit_cellid=0x7f050000;
  25.  
  26.         public static final int edit_lac=0x7f050001;
  27.  
  28.     }
  29.  
  30.     public static final class layout {
  31.  
  32.         public static final int main=0x7f030000;
  33.  
  34.     }
  35.  
  36.     public static final class string {
  37.  
  38.         public static final int app_name=0x7f040000;
  39.  
  40.     }
  41.  
  42. }
  43.  
  44.  
Parsed in 0.038 seconds, using GeSHi 1.0.8.4


thanks and best regards,
PhanNguyen
phannguyen
Experienced Developer
Experienced Developer
 
Posts: 56
Joined: Thu Jul 17, 2008 7:37 am

Postby brijeshthakur » Wed Jul 30, 2008 12:44 pm

Hi phannguyen,

if you are working on android-sdk_m5-rc15 then change it to.


<Button id="@+id/cmd_update"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="Update"
/>


<Button android:id="@+id/cmd_update"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="Update"
/>

and also replace id with android:id everywhere in main.xml

May be it will resolve your issue.

Regards,
Brijesh
brijeshthakur
Junior Developer
Junior Developer
 
Posts: 12
Joined: Wed Jul 23, 2008 12:36 pm
Location: Banglore,India

Postby phannguyen » Thu Jul 31, 2008 8:51 am

Thanks brijeshthakur, now it's ok.

But my app is not work.I use (cellid,lac) is (52,12547) like plusminus's example.
I wait for a long time but it's not load map.
so what i must do more in order to it's load map?

please show me!
thanks a lot.
PhanNguyen
phannguyen
Experienced Developer
Experienced Developer
 
Posts: 56
Joined: Thu Jul 17, 2008 7:37 am

Postby brijeshthakur » Thu Jul 31, 2008 1:10 pm

Hi phannguyen,

I also cant able to run this application.In my case it is showing the operation time-out error. I am behind proxy.and this application uses hidden api.

Check the error in LogCat.
May be that is the problem.

sorry for this time :(

Regards,
Brijesh
brijeshthakur
Junior Developer
Junior Developer
 
Posts: 12
Joined: Wed Jul 23, 2008 12:36 pm
Location: Banglore,India

Postby phannguyen » Fri Aug 01, 2008 4:48 am

brijeshthakur write:
Hi phannguyen,

I also cant able to run this application.In my case it is showing the operation time-out error. I am behind proxy.and this application uses hidden api.

Check the error in LogCat.
May be that is the problem.

sorry for this time

Regards,
Brijesh


hi brijeshthakur,
my network is ok and browse work well. So what's cause make this app not work?
Can u talk clearly more about "Check the error in LogCat".

thanks and best regards.
PhanNguyen
phannguyen
Experienced Developer
Experienced Developer
 
Posts: 56
Joined: Thu Jul 17, 2008 7:37 am

Postby brijeshthakur » Fri Aug 01, 2008 5:49 am

Hi phannguyen,

LogCat is just like console.Its a console for Android.

If you are using eclipse.Click on Window Menu--->Show View-->Others-->Android--->LogCat.

After running the application.Check the Log Cat.It will show the the Application's Error.

The Problem is not in network.If you run this application with Direct Internet Connection may be it will run fine.But if you are Behind proxy it causes error.

Check the LogCat & post the error. You can get more details of LogCat from Android website.


Regards,
Brijesh
brijeshthakur
Junior Developer
Junior Developer
 
Posts: 12
Joined: Wed Jul 23, 2008 12:36 pm
Location: Banglore,India

Top
PreviousNext

Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests