Adding a distance to a GeoPoint

by Eric Crump » Thu, 28 Jan 2010 08:57:52 GMT


Sponsored Links
 I need to draw a circle on my map.  I have the GeoPoint and I have the
radius of the circle in meters.  How do I add a distance to a GeoPoint
and get a GeoPoint as a result?

--



Adding a distance to a GeoPoint

by Kevin Duffey » Thu, 28 Jan 2010 09:18:46 GMT


 I am interested in this too. The numbers are fractional, so I am wondering
how you actually figure out the distance say, a 1/2 inch is on the screen
relative to the zoom level. Is there an api call that takes into account the
zoom level and can give a way to draw a specific distance.. such as a foot,
mile, etc?





>


Sponsored Links


Adding a distance to a GeoPoint

by Eric Crump » Thu, 28 Jan 2010 11:46:54 GMT


 Got it to work with this:

radius = (int)projection.metersToEquatorPixels(item.getRadiusInMeters
());

Still have some rounding issues to work out though

--



Other Threads

1. Replace ADBD on emulator

I am trying to debug some adbd stuff for an app I'm writing but I need
more debug output. I've compiled adbd from AOSP source but cannot find
out how to overwrite it on the emulator. I've copied it to /sdcard and
tried copying it but when I restart the emulator, it reverts. It seems
the emulator can't properly close when I remount the rootfs with rw
permission and I'm not sure why.

I looked into building yaffs2 into my kernel but the documentation is
outdated and I'm not sure how to do it.

I'm on Ubuntu 10.10.

Thanks

-- 

2. ListViews inside TableLayout...

Hi All,

I have a TableLayout with one TableRow.
The first column/cell is a ListView. The second cell/column is a
TableLayout again which consists of 2 ListViews.

When i inflate the xml layout, everything looks fine and i have set of
adapters for each of the 3 ListViews.

I have added dummy elements into these lists via adapters and am able
to scroll up and down the list.

But the onItemClick is not getting triggered.

The following is my layout file -

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/linearLayout1"
        android:orientation="vertical">

        <RelativeLayout android:id="@+id/top_header"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content">
                <Button
                        android:text="Edit"
                        android:id="@+id/button1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content">
                </Button>
                <TextView
                        android:text="dummy1"
                        android:textStyle="bold"
                        android:id="@+id/textView3"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_toRightOf="@+id/button1"
                        android:layout_centerVertical="true"
                        android:paddingLeft="25dip"
                        android:textSize="18dip">
                </TextView>
                <Button
                        android:id="@+id/button2"
                        android:layout_alignParentTop="true"
                        android:layout_height="wrap_content"
                        android:layout_width="wrap_content"
                        android:text="Cancel"
                        android:layout_alignParentRight="true">
                </Button>
                <TextView
                        android:layout_alignParentTop="true"
                        android:text="dummy2"
                        android:textStyle="bold"
                        android:layout_height="wrap_content"
                        android:layout_width="wrap_content"
                        android:id="@+id/textView4"
                        android:layout_toLeftOf="@+id/button2"
                        android:layout_centerVertical="true"
                        android:paddingRight="25dip"
                        android:textSize="18dip">
                </TextView>
        </RelativeLayout>

        <TableLayout android:id="@+id/tableLayout1"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:shrinkColumns="1">

            <TableRow android:id="@+id/tableRow1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:divider="@android:color/black"
                android:dividerPadding="2dip">
                <ListView
                        android:id="@+id/listView1"
                        android:layout_height="wrap_content"
                        android:layout_width="0dip"
                        android:layout_weight="1"
                        android:clickable="true"
                        android:focusable="true"
                        >
                </ListView>
                <TableLayout android:id="@+id/tableLayout2"
                        android:layout_width="0dip"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:shrinkColumns="1">
                    <TextView
                        android:text="dummy3"
                        android:id="@+id/textView1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textStyle="bold"
                        android:padding="8dip"
                        android:textSize="18dip"
                        android:background="#ff238E23">
                    </TextView>
                    <ListView
                        android:id="@+id/listView2"
                        android:layout_height="0dip"
                        android:layout_weight="1"
                                android:drawSelectorOnTop="false"
                                android:divider="@android:color/white"
                                android:dividerHeight="2dip"
                        android:layout_width="match_parent"
                                android:clickable="true"
                                android:focusable="true"
                        >
                    </ListView>
                    <TextView
                        android:text="dummy4"
                        android:textSize="18dip"
                        android:textStyle="bold"
                        android:id="@+id/textView2"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:background="#ff0000ff"
                        android:padding="8dip">
                    </TextView>
                    <ListView
                        android:id="@+id/listView3"
                        android:layout_height="0dip"
                        android:layout_weight="1"
                                android:drawSelectorOnTop="false"
                                android:divider="@android:color/white"
                                android:dividerHeight="2dip"
                        android:layout_width="match_parent"
                                android:clickable="true"
                                android:focusable="true"
                        >
                    </ListView>
                </TableLayout>
            </TableRow>

        </TableLayout>

</LinearLayout>


And in the java file, i do

        ListView lv = (ListView) findViewById(R.id.listView1);
        lv.setAdapter(new EfficientAdapterLeft(this));
        lv.setOnItemClickListener(new OnItemClickListener()
{
                        @Override
                        public void onItemClick(AdapterView<?> arg0, View view, 
int arg2,
long arg3) {
                                Log.v("blah","arg2 " + arg2);
                                Log.v("blah","arg3 " + arg3);
                        }
                });

I do similar things for the remaining two lists R.id.listView2 and
R.id.listView4. They instantiate different adapters but nothing
drastically different.

I don't see the logs getting printed. Why am i unable to click on the
items and get the onClickItem listener get triggered? Even doing this
        lv.setFocusable(true);
        lv.setClickable(true);
does not help.

Any idea what's happening?

Thanks.

-- 

3. PreferenceActivity.Header -- is there a better way

4. Start Dialer with delay

5. ask - harga defy

6. FU Tsel flash berubah?

7. Still having issues.