[android-developers] best way to go from GeoPoint to Location
I have a GeoPoint (point from MapView) object and Location (from LocationManager) object. I want to compute the distance between the two. Location has a distanceTo function. I cannot create a new Location object from lat, lon values. What is the recommended way for doing this? Matt -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] question about mapview data
I'm going through the tutorials about mapview. And it seems like there is a lot of lists going around and, honestly seems like overkill. Is the mapview example accurate in that I need to maintain my map data in 3 lists? 1) override ItemizedOverlayOverlayItem which contains list #1 of OverlayItem instances 2) ArrayListOverlay in my mapviewactivity implementation 3) and finally the mapOverlays = mapView.getOverlays(); I'm really confused about all of this. Seems like from a n00b view point all I need to do is add overlays to mapView.getOverlays() list Thnx Matt -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: question about mapview data
On Nov 18, 2:37 pm, Mark Murphy mmur...@commonsware.com wrote: tatman wrote: I'm going through the tutorials about mapview. And it seems like there is a lot of lists going around and, honestly seems like overkill. Is the mapview example accurate in that I need to maintain my map data in 3 lists? 1) override ItemizedOverlayOverlayItem which contains list #1 of OverlayItem instances 2) ArrayListOverlay in my mapviewactivity implementation 3) and finally the mapOverlays = mapView.getOverlays(); I'm really confused about all of this. Seems like from a n00b view point all I need to do is add overlays to mapView.getOverlays() list 1) represents the points you want on your ItemizedOverlay -- the push-pins, flags, dots, bowling balls, or whatever you are going to display for various geographic coordinates. If you do not have this, you have a pointless (literally) overlay. 2) is not necessary. 3) is where you tell Android, Yo, dawg! I gots you a new overlay, yo! In particular, do not confuse Overlay (representing a layer on a map) and an OverlayItem (representing a point to render in an ItemizedOverlay in a layer on a map). -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android App Developer Training:http://commonsware.com/training Thx that does help some. At what point would I have more than one instance of my type derived from ItemizedOverlay, and what point would I have more than one type derived from ItemizedOverlay? It seems like I would keep all of my OverlayItem items in one instance of my type derived from ItemizedOverlay... Matt -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: question about mapview data
On Nov 18, 3:02 pm, Mark Murphy mmur...@commonsware.com wrote: tatman wrote: At what point would I have more than one instance of my type derived from ItemizedOverlay Perhaps never. However, you may have more than one overlay (e.g., yours and MyLocationOverlay). and what point would I have more than one type derived from ItemizedOverlay? Perhaps never. But, you are not the only source of overlays (e.g., MyLocationOverlay). It seems like I would keep all of my OverlayItem items in one instance of my type derived from ItemizedOverlay... For most cases, that is probably true. On the other hand, overlays can be toggled on and off IIRC, so you might have different overlays for different types of data (e.g., restaurants vs. hotels vs. bowling alleys). -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Much appreciated. Thank you :) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] custom ArrayAdapter compile error
I'm trying to create my own ArrayAdapter. I'm missing something. I cannot get the code to compile. The documentation says I need to override getView. But the compiler isn't seeing getView as a method defined in the super class. What am I missing? import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.widget.ArrayAdapter; import android.widget.TextView; public class Stock { // etc } public class StockAdapter extends ArrayAdapterStock { // // public StockAdapter(Context context, int textViewResourceId, Stock[] objects) { super(context, textViewResourceId, objects); } @Override public View getView(int position, View convertView, ViewGroup parent) { } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: custom ArrayAdapter compile error
btw Im missing an import in the post: import android.view.ViewGroup; That fixes the override error. I now have different compile error. It says getSystemService is undefined. Any thoughts? On Nov 5, 4:17 pm, tatman matt.raf...@gmail.com wrote: I'm trying to create my own ArrayAdapter. I'm missing something. I cannot get the code to compile. The documentation says I need to override getView. But the compiler isn't seeing getView as a method defined in the super class. What am I missing? import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.widget.ArrayAdapter; import android.widget.TextView; public class Stock { // etc } public class StockAdapter extends ArrayAdapterStock { // // public StockAdapter(Context context, int textViewResourceId, Stock[] objects) { super(context, textViewResourceId, objects); } @Override public View getView(int position, View convertView, ViewGroup parent) { } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: custom ArrayAdapter compile error
and I now have that fixed too :) I added/changed this LayoutInflater vi = (LayoutInflater) getContext().getSystemService (Context.LAYOUT_INFLATER_SERVICE); On Nov 5, 4:28 pm, tatman matt.raf...@gmail.com wrote: btw Im missing an import in the post: import android.view.ViewGroup; That fixes the override error. I now have different compile error. It says getSystemService is undefined. Any thoughts? On Nov 5, 4:17 pm, tatman matt.raf...@gmail.com wrote: I'm trying to create my own ArrayAdapter. I'm missing something. I cannot get the code to compile. The documentation says I need to override getView. But the compiler isn't seeing getView as a method defined in the super class. What am I missing? import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.widget.ArrayAdapter; import android.widget.TextView; public class Stock { // etc } public class StockAdapter extends ArrayAdapterStock { // // public StockAdapter(Context context, int textViewResourceId, Stock[] objects) { super(context, textViewResourceId, objects); } @Override public View getView(int position, View convertView, ViewGroup parent) { } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] problem with TabHost
I cannot get a tabhost with xml resource to work. In the debugger I see the exception RuntimeException, Your content must have a TabHost whose id attribute is 'android.R.id.tabhost' I have set the id of my tabhost element to tabhost. I've also set it in pretty much every other control. I've looked at a number of samples nothing is standing out as to what I did wrong. Im at a loss. ?xml version=1.0 encoding=utf-8? TabHost xmlns:android=http://schemas.android.com/apk/res/android; android:id=@+id/tabhost android:layout_width=fill_parent android:layout_height=fill_parent LinearLayout android:id=@+id/tabLinearLayoutID android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent TabWidget android:id=@+id/tabs android:layout_width=fill_parent android:layout_height=wrap_content / FrameLayout android:id=@+id/tabFrameID android:layout_width=fill_parent android:layout_height=fill_parent TextView android:id=@+id/textView1Id android:layout_width=fill_parent android:layout_height=fill_parent android:text=tab 1 / TextView android:id=@+id/textView2Id android:layout_width=fill_parent android:layout_height=fill_parent android:text=tab 2 / TextView android:id=@+id/textView3Id android:layout_width=fill_parent android:layout_height=fill_parent android:text=tab 3 / /FrameLayout /LinearLayout /TabHost Any ideas ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: problem with TabHost
On Oct 29, 10:38 am, Kevin Bailey ke-andr...@retriever.dyndns.org wrote: ?xml version=1.0 encoding=utf-8? TabHost xmlns:android=http://schemas.android.com/apk/res/android; android:id=@+id/tabhost Don't know if it will help but my main.xml file says: android:id=@android:id/tabhost indeed! where I got that from IDK. But that did correct that exception. Thnx :) now on the next --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---