[android-developers] obtain rectangle on touch
Hello, I don't know much about Android and I would like to know if you people could help. I draw a board using this: private Rect selRect = new Rect(); for (int x = 0; x 20; x++) { if( x%2!=0 ) paint.setColor(Color.CYAN); else paint.setColor(Color.GREEN); for ( int y = 0; y 20; y++) { if ((x%2==0 y%2==0) || (x%2!=0 y%2 !=0)) paint.setColor(Color.GREEN); else paint.setColor(Color.CYAN); selRect = new Rect(x*squareSize, y*squareSize, (x +1)*squareSize, (y+1)*squareSize); canvas.drawRect(selRect, paint); } } so I wanted that using the event onTouch wherever I touch it selects (paints it in a diferent color) that square that I touched. so far I only reached the event.getX() and event.getY() but I don't know how those can be usefull to get the whole square that was touched. Thanks in advance, any help would be much appreciated. -- 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: Map point reload
Thanks a lot this onRetainNonConfigurationInstance worked for me. Not on the planned way like google apis but worked as a flag to know when it was flipped. thanks Ibendlin I tried that aswell. On 23 jul, 02:08, gjs garyjamessi...@gmail.com wrote: Hi, For the GPS issue, to prevent it from starting stopping on orientation change in your Activity, you can implement LocationManager in a Service then pass the Location objects back to the Activity. It is a fairly convoluted affair to setup but it does work. A simpler option - you might? also be able to maintain a reference to the Location Manager object (or some other class that acts as a container encapsulates the LocationManager) through onRetainNonConfigurationInstance() which is specifically provided for handling orientation other changes for the Activity. I've done the former but no the latter. Regards On Jul 23, 1:29 am, JCC banr...@gmail.com wrote: Ok thanks, I fixed the data problem but still with the flip issue that it calls the GPS again. =( any suggestion would be much appreciated. -- 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: Map point reload
Ok thanks, I fixed the data problem but still with the flip issue that it calls the GPS again. =( any suggestion would be much appreciated. -- 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] Map point reload
Hello, I'm currently working with a map and getting the location of the user and drawing a point on the map, but everytime I flip the device the application triggers the GPS again (I can see the GPS icon on the notification bar) and obtains a new reading. Is there an easy way to prevent this? I don't know much about android =/ also is there a way to check if the user has any network provider or gps turned on? thanks in advance. -- 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: Map point reload
I found the way how to know if the provider is on but how to know if its available? for example: I have the flight mode on so the mobile network is not available but the wifi on... therefore when I use something like: boolean active=locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); always return true because the wifi widget is enabled but there is no data availability... so is there a way to check if data is available? -- 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: Map point reload
Hello, I found how to know if the provider is on but it returns true always even when there is no data availability.. I use flight mode so there is no mobile data (3G) but keep the wifi widget on.. so using something like: boolean active=locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); will always return true because the widget is on. so is there a way to check if there is data availability? -- 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: Android and Google Maps
Did you added the Internet and GPS permission on the manifest? something like: uses-permission android:name=android.permission.INTERNET / uses-permission android:name=android.permission.ACCESS_FINE_LOCATION/ On 18 jul, 23:57, kypriakos demet...@ece.neu.edu wrote: Hi, I tried the link below - in fact it is fairly similar to the Professional Android book example ;) The app starts fine and it does display a map grid but no map. I am using the google map api key assigned to my account for Android access to the maps. Any idea as to why this map shows up blank? Thanks again On Jul 16, 10:50 am, kypriakos demet...@ece.neu.edu wrote: Good link - thanks. Have you tried building such Android projects using maven? On Jul 16, 2:19 am, nageswara rao rajana nagu.raj...@gmail.com wrote: try this link http://marakana.com/forums/android/examples/311.html -- 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: Relative layout java
The method addRule(int, int) in the type RelativeLayout.LayoutParams is not applicable for the arguments (int, boolean) so cant put true... On 12 jul, 05:37, Mike j.m.roya...@gmail.com wrote: imParams.addRule(CENTER_VERTICAL,true); imParams.addRule(ALIGN_PARENT_RIGHT, true); -- 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: Relative layout java
anyone? =( I really need help with this. -- 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: Relative layout java
but adding the rules isnt like defining the position of items? because on the second one for example I got to say that it should be below the first textview by saying ageParams.addRule(RelativeLayout.BELOW,viewNombre.getId()); -- 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: Relative layout java
owie... thanks for trying. I will try since the sex image is obtained is variable and I dont know how to send the variable image to the XML =S -- 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: Relative layout java
owie... thanks for trying. I will try since the sex image obtained is variable and I dont know how to send the variable image to the XML =S -- 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: Relative layout java
owie... thanks for trying. I will try since the sex image obtained is variable and I dont know how to send the variable image to the XML =S -- 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] Relative layout java
Hello, I created a relative layout by code in java wich basically is a list on wich each row has 3 elements.. name, age and sex but then i want that age be displayed below name and the image of the gender be displayed on the right of the screen (not imediatly right of the name). the problem is that when I coded that, it just overlaps everything and I got no idea what I'm doing wrong =S any ideas? here is the code: public class PersonasAdapterView extends RelativeLayout { private final static int idNombreView = 0; private static final int idEdadView = 1; private static final int idImgView =2; private TextView viewNombre; private TextView viewAge; private ImageView sexImg; public PersonasAdapterView(Context context, Personas per) { super(context); //layout for name in textview RelativeLayout.LayoutParams nameParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); nameParams.setMargins(10, 1, 1, 1); TextView viewNombre = new TextView(context); viewNombre.setText(per.getName()); viewNombre.setId(idNombreView); viewNombre.setTextSize(19f); viewNombre.setTextColor(Color.BLACK); addView(viewNombre,nameParams); //layout for age in textview RelativeLayout.LayoutParams ageParams= new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); ageParams.setMargins(1, 1, 1, 1); ageParams.addRule(RelativeLayout.BELOW,viewNombre.getId()); TextView viewEdad = new TextView(context); viewEdad.setText(String.valueOf(per.getAge())); viewEdad.setId(idEdadView); viewEdad.setTextSize(14f); viewEdad.setTextColor(Color.BLACK); addView(viewEdad,ageParams); //layout for img RelativeLayout.LayoutParams imParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT); imParams.addRule(CENTER_VERTICAL,ALIGN_PARENT_RIGHT); ImageView imSex = new ImageView(context); imSex.setImageResource(per.getSexImg()); imSex.setId(idImgView); addView(imSex,imParams); } } -- 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: Youtube Logo
@TreKing: Thanks for clarifying this :) On 30 jun, 10:00, TreKing treking...@gmail.com wrote: On Thu, Jun 30, 2011 at 9:43 AM, JCC banr...@gmail.com wrote: @TreKing may I know why this has nothing to do with this list? http://groups.google.com/group/android-developers/about Discuss developing Android applications using the SDK: troubleshooting apps, advice on implementation, strategies for improving your app's speed and user experience. *This group is for development-related topics only*, not for job opportunity announcements, advertisement, debates about devices, etc. You're asking about branding rights to the YouTube logo. I thought it was a group where to discuss things between android developers. There is a Android Discuss group for non-SDK discussions about Android - but even there I don't think your question applies. Just because you're doing something in an Android App does not make it about Android. Try some YouTube groups or forums. --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- 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: Youtube Logo
I actually searched and youtube offers the possibility to use it as press as its mentioned on: http://www.youtube.com/t/press_room_image_files and also on here it mentions something but its about Youtube API: http://code.google.com/apis/youtube/branding.html but im not using Youtube API, i just want to know if i can use the logo for my button inside my app so when i click it it sends me to a topic related in my app: like lets say: my app has cooking and painting categories.. so adding a subcategory on those i want to put a youtube button that it sends me to the youtube app in android with the search cooking for example. and if it doesnt have the youtube app, it launches the explorer with youtube. so .. yeah.. the question is.. Am I allowed to use the logo inside my app? and @TreKing may I know why this has nothing to do with this list? I thought it was a group where to discuss things between android developers. -- 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: Youtube Logo
Fine, then mind giving me a link to a place where I could ask for this? On 30 jun, 09:48, Justin Anderson magouyaw...@gmail.com wrote: * may I know why this has nothing to do with this list? I thought it was a group where to discuss things between android developers.* Because this has to do with YouTube, not Android. Thanks, Justin Anderson MagouyaWare Developerhttp://sites.google.com/site/magouyaware On Thu, Jun 30, 2011 at 8:43 AM, JCC banr...@gmail.com wrote: may I know why this has nothing to do with this list? I thought it was a group where to discuss things between android developers. -- 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] Youtube Logo
Hello,, I wanted to know if I can use the YouTube logo as part of my app, since there will be a section for videos. I wanted to know if I can use the YouTube logo for the YouTube button or I need to ask for permission for it? Any answer will be much appreciated. -- 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] Android SDK Error
I'm trying to get the android SDK running on my computer so I can start working on some apps but when I open the android sdk and avd manager and try to download a package, I get the following error: XML verification failed for http://dl-ssl.google.com/android/repository/repository.xml. Error: The markup declarations contained or pointed to by the document type declaration must be well-formed. Failed to fetch URL http://dl-ssl.google.com/android/repository/repository.xml, reason: Unknown Failed to parse XML document -- 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