Re: [android-developers] Re: On using themes?!
You need to define an attribute for your value: attr name=myColor format=color / Then make a custom theme that supplies a value for it: style name=MyTheme parent=android:Theme item name=com.my.package:myColor#ff808080/item /style And now you can reference that value from other XML: shape xmlns:android=http://schemas.android.com/apk/res/android; android:shape=rectangle gradient android:startColor=?com.my.package:myColor android:endColor=#66FF android:angle=270 / /shape Note that com.my.package is your manifest's package name. Also I just wrote this by hand so I won't guarantee it is completely right. :} On Mon, May 10, 2010 at 11:02 AM, Mariano Kamp mariano.k...@gmail.comwrote: Hmmh, also no answer to this question on themes. Maybe the answer cannot be given with two lines? So let me explain what I would expect step by step and you stop me were I deviate from the Golden Path? I'll try yes/no questions. In the simplest terms I would expect that in every place I can specify a color in RGB (#) I could also specify a symbolic name instead. This should work like @color/xyz, but with one more level of indirection that lets me switch between themes, like dark and light. Is that possible? I would expect those themes to be applicable to (a) widgets, (b) drawables (see the mentioned example) and (c) when I need to style something myself like HTML. Are (a) - (c) possible? Furthermore I would expect that I could define style keys myself, but I got the impression that only keys from the android namespace can be used? That lead me to believe that you can't define abstract colors, but only styles for specific attributes used in the widgets' implementations. And again, if there is any meaningful documentation I would be happy to read it. Just send me the link or name of the book. On Sat, May 8, 2010 at 3:26 PM, Mariano Kamp mariano.k...@gmail.comwrote: Hi, I have trouble (examplehttp://groups.google.com/group/android-developers/browse_thread/thread/5b4ce3e49a1b63d2/) wrapping my head around styles/themes. Can somebody help me or point me to actual documentation? Let's say I have a drawable that I want to use as the background of a layout: shape xmlns:android=http://schemas.android.com/apk/res/android; android:shape=rectangle gradient android:startColor=#9F9FA4 android:endColor=#66FF android:angle=270 / /shape Now I want to have a dark and a light theme. Depending on the chosen theme I want to have a different value for startColor and endColor. How do I do that? I am aware of extending themes, but what do I put into the items? How do I reference those new values then? Cheers, Mariano -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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] Multiple Notifications - PendingNotifications with different data?
Let's say I have a background service that performs several tasks. As it completes task A, it posts notification A with a certain intent and some extra data that indicates viewing result of A. As it completes task B, it posts notification B with a certain intent and some extra data that indicates viewing result of B. As it completes task C, it posts notification C with a certain intent and some extra data that indicates viewing result of C. At the end, the notification area has three notifications. Each one has the same intent, except for one of the extra data fields. I would expect that each one would load my activity with different extra data. They don't. When onNewIntent is called, each has the extra data field set to C. I have rooted out any possible aliasing and checked the data as it is placed into a notification. It seems to allow only one set of data per package. Is what I am attempting not possible? Has anyone accomplished what I am attempting? For example, have you had a service download several large files, and then had notifications that would open each of those files? This is some of the relevant code: // post a finished notification. Notification finished = new Notification(R.drawable.notifier, tickerText, System.currentTimeMillis()); Intent intent = new Intent(); intent.setClass(DownloadService.this, MyActivity.class); intent.setAction(MyActivity.OPEN_LOCATION); // adding parameters to extras .. intent.putExtra(packageName.layer, layer); ... // The PendingIntent to launch our activity if the user selects this // notification PendingIntent contentIntent = PendingIntent.getActivity(DownloadService.this, 0, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT | Intent.FILL_IN_DATA); String contentTitle = getString(R.string.n_download_completed); String contentText = getString(R.string.n_download_results, layer); finished.setLatestEventInfo(DownloadService.this, contentTitle, contentText, contentIntent); mNotificationManager.notify(finishedid++, finished); Nathan -- 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: WCF complex types with android
I developed small JSON datamarshaller suitable for android (really small, only 2 classes ): http://github.com/ko5tik/jsonserializer it is capable to read / write complex object trees. I use it on device to serialize my application data, and to transfer highscores back and forth to server ( here is my rest service returning JSON: http://www.pribluda.de/lines-highscore/Highscore/pull?since=0 ) You will haveto compile it yourself tough (with maven), but I intend to cut and deploy fresh release soon. regards, On 10 Mai, 17:26, Lamia Hannoun lamia.hann...@gmail.com wrote: Thanks for ur quick answer but can u give me more information(tutorial) or some example code !!! Thx 2010/5/10 Jose Gomez j...@josecgomez.com If you can return JSON then you should be ok THanks Sincerely Jose C Gomez http://www.josecgomez.com On Mon, May 10, 2010 at 9:38 AM, Lamia Hannoun lamia.hann...@gmail.comwrote: Hi to all! I made the connection between my service WCF and my app android. But i'm wondering if u have ideas about using complex types (classes created on the server side). should i implement the serialization process? or should i juts create the classes on my client side(android) Plz can u help me -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: On activity (re)usage en creation
Any thoughts on how bad the current behaviour is? Not sure what you mean - but if you haven't touched anything else, the current behavior is the default behavior, which should suffice for most apps. My point was, you're basically doing the equivalent of browsing a site. But for each click (as you go from an entry to its comments, to an entry), you start a new activity. Now i can imagine that for a browser you'd have an activity per tab, but not per page (as you have one superclass here, being page). This feels more efficient It is in this case easiest to make a separate activity for each type of page, but this means that while 'browsing' you're making a new activity for each click and that feels a bit redundant, expensive or.. well, something like that? I was wondering if it would be wise to make an effort to keep both pages in the same activity. -- 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: How can I know if OpenGl has drawn something?
Hmm.. I'm sorry but this has reached the limit of what I know off- hand. I'd have to get into debugging your code to be able to help more. I have a feeling one of two things is wrong: 1) Your projection matrix is not matching what glOrthof is doing (fix by using glLoadMatrix there) 2) Something is happening to your modelview matrix later that I can't see from your code snippet and remappedRotationMatrix no longer matches it. Sorry I can't help more. All I know is that if your Camera space is wrong from what you think it should be, you will face nothing but problems trying to do visibility tests or picking. I do 3D visibility testing of objects by creating frustum bounds and testing against object bounding boxes - this is all in world space. I actually don't need unproject to figure out what you touched because for me, it's just a matter of making a segment from the near plane to the far at the percentage distance from the sides in the viewport to your touch point used on the near/far planes. If you debug my suggestions 1 and 2 and come up with nothing, perhaps there is an alternative way to check without still checking for drawn pixels (which makes me shudder.) On May 10, 8:15 pm, Alfonso alfonsocris...@gmail.com wrote: Robert, first of all thanks for your time and kindness. The problem for me is not drawing my scene. In fact, the scene is done. I'm going to try being more explicit: First of all, I set the projection matrix with: near_height = 1; zNear = 1; zFar = 100; window_height = height; window_width = width; gl.glViewport(0, 0, width, height); //Reset The Current Viewport gl.glMatrixMode(GL10.GL_PROJECTION); //Select The Projection Matrix gl.glLoadIdentity(); //Reset The Projection Matrix ratio = (float) width / height; Matrix.orthoM(orthoProjectionMatrix, 0, -near_height * ratio, near_height * ratio, -near_height, near_height, zNear, zFar); //I get the Projection Matrix here gl.glOrthof(-near_height * ratio, near_height * ratio, -near_height, near_height, zNear, zFar); Later, I get the rotation matrix and remap it with the lines: SensorManager.getRotationMatrix(rotationMatrix, null, mAccelerometerValues, mMagneticValues); SensorManager.remapCoordinateSystem(rotationMatrix, SensorManager.AXIS_Y, SensorManager.AXIS_MINUS_X, remappedRotationMatrix); gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glLoadIdentity(); //Reset The Current Modelview Matrix gl.glLoadMatrixf(remappedRotationMatrix, 0); Then, I draw all wich I want. Don't worry about the ray, it is well done. I followed this page instructions http://www.opengl.org/ resources/faq/technical/selection.htm. I use glPushMatrix and glPopMatrix, but as you can think it is not necessary. I have the modelview untouched in remappedRotationMatrix. My problem: Once I have finished drawing objects, I want to know if there is some of them painted in the screen when I point an exact place with the phone. I'm OK to choose an only one object if it is so easier. With the next instruction: GLU.gluProject(pos3DdelPuntoInteres[0], pos3DdelPuntoInteres[1], pos3DdelPuntoInteres[2], remappedRotationMatrix, 0, orthoProjectionMatrix, 0,new int[] {0,0,window_width,window_height}, 0, prueba, 0); I should get the screen coords of the pos3DdelPuntoInteres vector in the prueba one. But if I see it with a Log, I can't deduce any connection between this values and the screen. In the poing signed by pos3DdelPuntoInteres there is an icon, if I move the phone so place the icon in the upper left corner, then the first coord of prueba is 0, but no one else. In fact, it is impossible get an 0,0 position in prueba. Alternatively, I've found that if I multiply the modelview by pos3DdelPuntoInteres, one of the components of prueba takes values from 1 to -1 if the icon is displayed on the screen and out of this range if not. The problem is that this value only refers to the x axis of the screen and not to the y one. The others two values of prueba seems to refer the angle of the yaw. Knows someone about a way of calculate the position of the y axis like with de x ones using the modelview matrix, so I can control if the object is on the screen? Thanks. The problem On 10 mayo, 22:13, Robert Green rbgrn@gmail.com wrote: If you're doing this to set up and draw your scene: gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); GLU.gluPerspective(gl, FOV, viewAspectRatio, zNear, zFar); // **get or recreate this matrix for the unproject projection gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glLoadIdentity(); GLU.gluLookAt(gl, pos.x, pos.y, pos.z, lookAt.x, lookAt.y, lookAt.z, upVec.x, upVec.y, upVec.z); // **get or recreate this matrix for the unproject modelview // for each object gl.glPushMatrix(); //
[android-developers] Re: How to create uses-library
Hi Karteek, As Mr. Mark Murphy has suggested create a new project for your reusable set of code. Export the same as Jar and include where ever you need them. Regards, Vinay On May 11, 10:53 am, Dianne Hackborn hack...@android.com wrote: On Mon, May 10, 2010 at 10:29 PM, karteek kartee...@gmail.com wrote: Sorry I said Java files means it is also using android packages. As you said uses-library is for only sdk add-ons. Can't we generate add ons to include in my applications No, this is only for things built in to the system image. Third party shared libraries are not supported. My overall idea is to make use some repeated functionality as an library. If i want to generate jar file i need to write it as pure Java application but here it is also using some android api's. what is the way to achieve this. You don't need to write it as pure Java. You can have whatever Java code you want in a .jar and include it as a static library. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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] Changing the battery icon position
Hi everyone, I want to take my activity the entire screen of the device and I could do that by making appropriate changes in the android manifest file(Theme.NoTitleBar.Fullscreen). But, now I just want battery status icon on my screen alongwith other components of my activity. Is that possible?? If yes, then how?? I tried to use battery manager but, it does not expose such interfaces. I guess its mainly useful for checking and using battery life status and firing intents appropriately. Kindly help. TIA. Regards, Ankita -- 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
Re: [android-developers] Multiple Notifications - PendingNotifications with different data?
Nathan wrote: Let's say I have a background service that performs several tasks. As it completes task A, it posts notification A with a certain intent and some extra data that indicates viewing result of A. As it completes task B, it posts notification B with a certain intent and some extra data that indicates viewing result of B. As it completes task C, it posts notification C with a certain intent and some extra data that indicates viewing result of C. At the end, the notification area has three notifications. Each one has the same intent, except for one of the extra data fields. I would expect that each one would load my activity with different extra data. They don't. When onNewIntent is called, each has the extra data field set to C. I have rooted out any possible aliasing and checked the data as it is placed into a notification. It seems to allow only one set of data per package. Is what I am attempting not possible? Has anyone accomplished what I am attempting? For example, have you had a service download several large files, and then had notifications that would open each of those files? This is some of the relevant code: // post a finished notification. Notification finished = new Notification(R.drawable.notifier, tickerText, System.currentTimeMillis()); Intent intent = new Intent(); intent.setClass(DownloadService.this, MyActivity.class); intent.setAction(MyActivity.OPEN_LOCATION); // adding parameters to extras .. intent.putExtra(packageName.layer, layer); ... // The PendingIntent to launch our activity if the user selects this // notification PendingIntent contentIntent = PendingIntent.getActivity(DownloadService.this, 0, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT | Intent.FILL_IN_DATA); use PendingIntent.getActivity with unique requestCode pskink -- 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
Re: [android-developers] Re: WCF complex types with android
ReST+JSON works best In other case, use need to have the classes in the client side as a separate Jar with a separate java project meant for the service consumption -- 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
Re: [android-developers] Re: On using themes?!
Hi Dianne. Thanks very much, almost there. I understand the procedure, it would do what I want, but I run into an exception: D/NewsRobDefaultExceptionHandler( 1839): Caused by: java.lang.UnsupportedOperationException: Can't convert to color: type=0x2 D/NewsRobDefaultExceptionHandler( 1839): at android.content.res.TypedArray.getColor(TypedArray.java:273) D/NewsRobDefaultExceptionHandler( 1839): at android.graphics.drawable.GradientDrawable.inflate(GradientDrawable.java:647) D/NewsRobDefaultExceptionHandler( 1839): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:788) D/NewsRobDefaultExceptionHandler( 1839): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:729) D/NewsRobDefaultExceptionHandler( 1839): at android.content.res.Resources.loadDrawable(Resources.java:1690) This happens when using it the way we described here in a drawable xml. However to better understand the error I used it on other attributes and when using it on the background attribute of a View it works. Maybe this approach is incompatible with drawables that are expressed in xml? Btw. Is there any way to get the actual #rgb string for a color from a theme? Cheers, Mariano On Tue, May 11, 2010 at 8:02 AM, Dianne Hackborn hack...@android.comwrote: You need to define an attribute for your value: attr name=myColor format=color / Then make a custom theme that supplies a value for it: style name=MyTheme parent=android:Theme item name=com.my.package:myColor#ff808080/item /style And now you can reference that value from other XML: shape xmlns:android=http://schemas.android.com/apk/res/android android:shape=rectangle gradient android:startColor=?com.my.package:myColor android:endColor=#66FF android:angle=270 / /shape Note that com.my.package is your manifest's package name. Also I just wrote this by hand so I won't guarantee it is completely right. :} On Mon, May 10, 2010 at 11:02 AM, Mariano Kamp mariano.k...@gmail.comwrote: Hmmh, also no answer to this question on themes. Maybe the answer cannot be given with two lines? So let me explain what I would expect step by step and you stop me were I deviate from the Golden Path? I'll try yes/no questions. In the simplest terms I would expect that in every place I can specify a color in RGB (#) I could also specify a symbolic name instead. This should work like @color/xyz, but with one more level of indirection that lets me switch between themes, like dark and light. Is that possible? I would expect those themes to be applicable to (a) widgets, (b) drawables (see the mentioned example) and (c) when I need to style something myself like HTML. Are (a) - (c) possible? Furthermore I would expect that I could define style keys myself, but I got the impression that only keys from the android namespace can be used? That lead me to believe that you can't define abstract colors, but only styles for specific attributes used in the widgets' implementations. And again, if there is any meaningful documentation I would be happy to read it. Just send me the link or name of the book. On Sat, May 8, 2010 at 3:26 PM, Mariano Kamp mariano.k...@gmail.comwrote: Hi, I have trouble (examplehttp://groups.google.com/group/android-developers/browse_thread/thread/5b4ce3e49a1b63d2/) wrapping my head around styles/themes. Can somebody help me or point me to actual documentation? Let's say I have a drawable that I want to use as the background of a layout: shape xmlns:android=http://schemas.android.com/apk/res/android; android:shape=rectangle gradient android:startColor=#9F9FA4 android:endColor=#66FF android:angle=270 / /shape Now I want to have a dark and a light theme. Depending on the chosen theme I want to have a different value for startColor and endColor. How do I do that? I am aware of extending themes, but what do I put into the items? How do I reference those new values then? Cheers, Mariano -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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
[android-developers] Re: Namespaces and custom widgets
Another example of someone trying to do this was in this thread: http://groups.google.com/group/android-developers/browse_thread/thread/d36983a8159f303b/ Everybody just says use getIdentifier(), but nobody says what arguments you might pass it in order to return a styleable. -- 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] WPA-EAP support in Android
Hi All Does Android support Wifi WPA-EAP security mode?. Currently they are filtering secured and hidden networks. wifilayer.java /* * Ignore enterprise-secured, or hidden networks. * Hidden networks show up with empty SSID. */ if (AccessPointState.isAdhoc(scanResult) || AccessPointState.isEnterprise(scanResult) || TextUtils.isEmpty(scanResult.SSID)) { continue; } Please let me know, why this. to support what I need to do? Thanks Gururaja b O -- 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] Make the Video size play in full screen (stretch to fit width and height)
Hello Everyone, I have this question regarding on how to create a player in my application to play a video in fullscreen(stretch to fit width and height). I have this in my code already and setting the layout width and height in the ui xml file to fill parent but still does not stretch to fit the width. protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub Log.v( TAG , onCreate); super.onCreate(savedInstanceState); this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.player); Bundle extra = this.getIntent().getExtras(); this.mVideo = extra.getBundle(VIDEO); VideoView vidView = (VideoView)this.findViewById(R.id.vidView); vidView.setVideoPath(this.mVideo.getString(URL)); vidView.setOnPreparedListener(this); MediaController ctrl = new MediaController(this); ctrl.setMediaPlayer(vidView); vidView.setMediaController(ctrl); vidView.requestFocus(); } Thanks, -Brian -- 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] Service stops works after 30 minutes when Android is turned off (trickles every 30 minutes for 5 minutes)
Dear forum, I wrote a service which continuously reports data to a remote server via HTTP. As a service should do it keeps working even when the Android is turned off (by a short press on the power button) and is not powered externally. This works fine on a Motorola Milestone (Android 2.1) until the battery holds but not on neither HTC Tattoo nor HTC Magic (both Android 1.6). On the 1.6 devices the service stops working after about 30 minutes for 30 minutes. Then it seems to work for 5 minutes again and stops again for 30 minutes and so on. I seems that there is some (undocumented?) power management acting which prevents to keep the Android running continuously when softly turned off. When I press a button and turn off again the service is working immediately for 30 minutes and the trickles starts again as described above. My questions are: 1) Is this behavior documented? 3) Is this special for Android 1.6 or just for HTC devices 4) How to turn off this feature? Thanks spachner -- 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: Wired crash with ActivityUnitTestCase and dimens.xml
No comments? What I did not mentioned is that there is another file called styles.xml which combines the values together: resources style name=Theme parent=android:Theme item name=theHeight@dimen/my_height/item /style /resources I'm not really sure if it is a misunderstanding style and themes. The InstrumentationTestCases works fine. Thanks in advance. T-Droid On 10 Mai, 15:48, T-Droid dev.r...@googlemail.com wrote: Hi @all, I wrote a test case with ActivityUnitTestCase which was working fine. Now I added a dimensions file (dimens.xml) and using the values with a style.xml. Here some parts from the dimens.xml: resources eat-comment/ dimen name=my_height15dp/dimen resources Here the attrs.xml: resources declare-styleable name=Theme attr name=theHeight format=dimension / /declare-styleable /resources And here the style.xml: resources style name=myStyle item name=android:layout_height@dimen/my_height/item item name=android:paddingLeft?theHeight/item /style /resources The style.xml is in the android manifest. On the G1 and the emulator the code works fine. In the test case I'm getting a crash. 05-10 15:03:48.658: INFO/TestRunner(748): java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x2 From the call stack I can see that this line causes the crash: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.my_layout); } Any idea? T-Droid -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 installing your own developed app
Hi all! I m trying to understand the different ways you can install your app on your device. It's clear for me that we have to use the .apk file and the command adb install packagename. One of my question is which is the difference between an unsigned app and a signed one? Other doubt is related with eclipse commands. When you run your app into a real device, are you installing it?and when you are debugging?i would like to clear these concepts: 1.- run your app with eclipse plugin is the same that execute the command adb install package name 2.- Which the difference between debug and run an app if the result is the same: install it on your device I have been developing an app and i have used the command run the app into a real device many times to see the results and i have had no problem but now i finished the app i want the .apk file and install it through the command adb but i get the next error: C:\adb install C:\myapp\ConexionWebcam.apk 775 KB/s (12400 bytes in 0.015s) scandir: Permission denied cannot create /sys/module/yaffs/parameters/yaffs_auto_checkpoint: permission den ied Can't dispatch DDM chunk 46454154: no handler defined Can't dispatch DDM chunk 4d505251: no handler defined pkg: /data/local/tmp/ConexionWebcam.apk Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES] Please help me because i have no idea what the meaning of this errors. Thank you in advanced Néstor -- 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] Nexus one gps issue
Hi, I am working app for nexus one which uses gps. I have placed turning on code of gps in onStart() of Activity and and turning off code in onStop(). As per logs On/Off works fine specially turning off. But then gps icon stays forever on notification bar. Is there any bug/ issue with Nexus One GPS? or am I doing anything wrong? Tunrning on/ off code is as follows onStart(){ ... String[] providers = { LocationManager.GPS_PROVIDER, LocationManager.NETWORK_PROVIDER }; int noOfProviders = providers.length; for (int i = 0; i noOfProviders; i++) { final String currentProvider = providers[i]; if (locManager.isProviderEnabled(currentProvider)) { locManager.requestLocationUpdates(currentProvider, 100L, 0.0f, _instance); } } ... } onStop(){ ... if (locManager != null) { locManager.removeUpdates(_instance); } ... } and the logs for turning off gps are.. LocationManager( 369): removeUpdates: listener = com.xxx.xxx@4495e330 D/NetworkLocationProvider( 76): removeListener(): com.xxx.xxx D/GpsLocationProvider( 76): stopNavigating D/libgps ( 76): qct_gps_stop Thanks in advance Namrata -- 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] Nexus one gps issue
Hi, I am working app for nexus one which uses gps. I have placed turning on code of gps in onStart() of Activity and and turning off code in onStop(). As per logs On/Off works fine specially turning off. But then gps icon stays forever on notification bar. Is there any bug/ issue with Nexus One GPS? or am I doing anything wrong? Tunrning on/ off code is as follows onStart(){ ... String[] providers = { LocationManager.GPS_PROVIDER, LocationManager.NETWORK_PROVIDER }; int noOfProviders = providers.length; for (int i = 0; i noOfProviders; i++) { final String currentProvider = providers[i]; if (locManager.isProviderEnabled(currentProvider)) { locManager.requestLocationUpdates(currentProvider, 100L, 0.0f, _instance); } } ... } onStop(){ ... if (locManager != null) { locManager.removeUpdates(_instance); } ... } and the logs for turning off gps are.. LocationManager( 369): removeUpdates: listener = com.xxx.xxx@4495e330 D/NetworkLocationProvider( 76): removeListener(): com.xxx.xxx D/GpsLocationProvider( 76): stopNavigating D/libgps ( 76): qct_gps_stop Thanks in advance Namrata -- 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] ServiceConnectionLeaked Error
My app meet a ServiceConnectionLeaked Error: E ActivityThread: android.app.ServiceConnectionLeaked: Activity com.my has leaked ServiceConnection com.m...@463dc0a0 that was originally bound here My app are two part, UI and service, Like music playback, the service will always running, until user press UI Stop button. If user press back button, make the UI destory, the service should still run. So, I check the Service status, if the service state is not STOPPED, now playback, then do not unbindService (prevent service be stopped.) but I receive this ServiceConnectionLeaked. public void onDestroy() { if (mMyManager.getStatus() == MyService.STATE_STOPPED) { if (null != mMyConnection) { unbindService(mMyConnection); this.stopService(mMyServiceIntent); mMyConnection = null; } } else { Log.d(TAG, Service is run do nothing.); } super.onDestroy(); } What the rigth solution? Thanks Ming. -- 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
Re: [android-developers] Re: [Help] how to draw multiple lines in Edittext?
On Mon, May 10, 2010 at 9:59 PM, social hub shubem...@gmail.com wrote: What exactly is your problem here . getting line count 18 when u filled textbox with 18 lines? not a problem but a tricky solution. y, in this solution , i fill 18 empty lines so getLinecount will return me 18 On Sat, May 8, 2010 at 12:53 AM, Vincent Tsao caojunvinc...@gmail.comwrote: @Soical Hub: thanks for your help, your suggestion inspired me a lot i finally find this way to get padding: *getCompoundPaddingTop()*, and it works fine now what' more, i find another tricky way to meet my requirement: *Step 1: fill in the EditText with 18 'empty' line rows* StringBuilder sb = new StringBuilder(); for (int i = 0; i 18; i++) { sb.append(\n); } * this.setText(sb.toString());* *Step 2: draw those 18 lines * * * @Override protected void onDraw(Canvas canvas) { canvas.drawColor(paperColor); * int count = getLineCount(); // that's the tricky part, now count will return 18* Rect r = mRect; for (int i = 0; i count; i++) { int baseline = getLineBounds(i, r); // Draw ruled lines canvas.drawLine(r.left, baseline + 1, r.right, baseline + 1, linePaint); canvas.save(); } super.onDraw(canvas); canvas.restore();** * *} but i don't like this tricky way personally :) -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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] [Help] Activity pause timeout for HistoryRecord -- Any idea how does this happen ?
i'm start a new Activity B from Activity A, and find launch Activiy B is very slow, cost over 3000 Milliseconds, and when i click back to Activity A, then i found this log below: *05-11 15:19:30.201: WARN/ActivityManager(79): Activity pause timeout for HistoryRecord{43aaedc8 com.example.android/.ActivityB}* Activity B only contains a ListView with CursorAdapter, Any idea how does this happen? this performance is unacceptable -- 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: timeout for HistoryRecord
hi, Anzi, any progress here? i have the same problem -- 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] Sharing gps stuff between several activity
I found myself using the same code for accessing to gps / cell location stuff from a couple of activities of my application. What I was wondering now is, which is the best way to avoid code duplication? Should I use a superclass for the activities which implements that kind of stuff? Use an helper class? How do you deal with this kind of problems? Many thanks in advance, Federico -- 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] getting R.String Value using different class
Im not quite sure of what it is that im doing wrong, but im sure its a simple mistake. essentially im having a problem with the following String Hello; Hello = getString(R.string.Hello); R.String.Hello does have a value if i look at it in my expressions window but if i use the getString Function, i end up with An exception occurred: java.lang.NullPointerException I have to assume its because im trying to access this value from a completely different class, because in the base class that im using, getString works fine.. -- 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] Multi instance of app launch from status bar notification.
When My app started, show a notification. then pull down the status bar, click this notification, the app UI showed. But when I press back button, the my-app disappeard, and the other my-app show on top window, press back button again, get the home screen. It's seem like two my-app in window stack. *but my expect is one app instance.** * If current is home screen, pull down status bar, click notification, repeate several times, just on back button to get home screen. If launch My app from main menu icon, pull down status bar, click notification, repeate several times, need multi-back button to get home screen. private void showStartNotify() { Notification notification = new Notification( R.drawable.stat_started, getString(R.string.service_started), System.currentTimeMillis()); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(this, My.class), 0); notification.setLatestEventInfo(this, getString(R.string.service_name), getString(R.string.service_started), contentIntent); notification.flags |= Notification.FLAG_ONGOING_EVENT; mNotifyManager.notify(1, notification); } -- 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] someone please help me with these issues.
1. I am using a Broadcast Receiver which acquires a static WakeLock, then immediately starts an activity which starts a media player instance inside its onCreate, at the last line of OnCreate i have released the static wakelock which i had acquired in the BroadCastReceiver. Everything seems to work fine, except for the fact that the screen does wakeup but is locked and has to be manually unlocked before the user can see my activity, though the media player starts playing normally before itself. I have set lockStatic=mgr.newWakeLock(PowerManager.FULL_WAKE_LOCK| PowerManager.ACQUIRE_CAUSES_WAKEUP, LOCK_NAME_STATIC); still the screen has to be manually unlocked before the user can see the activity. Any workaround? 2. I have used an EditText inside a tablelayout, tablerow and have set the android:height and width to wrap_content, but still when i type on the softkeypad it exceeds the bounds of the EditText Box and overflows the screen too. have tried various properties on the EditText but none of them seems to work. 3. I have an Activity a ListView Activity which populates the List from a db. When the user clicks on an item in a list, i take him to a new Activity from where he can also delete the item he selected. The problem is that the Parent Activity's ListView is not refreshed and continues showing redundant content, when i have finished the child activity. I have tried making the cursor as static and calling cursor.requery() from my child activity before i finish it, but it doesnt seem to fix the issue. 4. I have used an Activity say activityA which sets up alarm using AlarmManager.set to a Receiver say RecA. If i want to cancel this alarm later from an Activity say ActivityB how do i do so? Somone please respond to the above issues soon. I have been trying a few workaounds since past few days, but am not able to fix these issues. 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
Re: [android-developers] Re: How to disable home and other buttons so as to persist an app?
Hi, Thanks Mr Romain Guy, for the information. @Mike dg : The requirement is that one app has to be loaded at startup which displays a browser with a specified URL. And one of the requirement is that whatever buttons the user presses or clicks, the browser shouldn't exit. The browser with the specified URL should be the only app that the user has access to. Since the 'Home' button on being pressed, exists the application, the above requirement can't be implemented. Ashok Jeevan +91 9895401278 On Thu, May 6, 2010 at 8:00 PM, Mike dg vinb...@gmail.com wrote: What are you trying to do? You could see that tons of things could go wrong with an app that runs on boot and doesn't allow you to get away. -Mike dg On May 6, 3:07 am, Ashok Jeevan ashokjee...@gmail.com wrote: Hi guys, I am building an app which uses a WebView. This app runs at startup. Is there a way to maintain the app running(persists) even if the user presses the 'Home' or 'Back' button? In other words,pressing the 'Home', 'Back' or the other buttons shouldn't close the activity. Ashok Jeevan +91 9895401278 -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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: Device Seeding Program for Top Android Market Developers
Fed-ex came, and delivered. For some reason they had been trying to deliver the phone to 21, 5B instead of 215B on the same road, resulting in a two week delay I finally got it, though, and am filled with joy! Thank you Google overlords! :D On May 9, 1:15 am, TreKing treking...@gmail.com wrote: On Thu, May 6, 2010 at 2:28 AM, Lorents iva...@gmail.com wrote: @TreKing - Wow, this thread is really bugging you... Ha! The thread itself is not the problem - it's the flood of me too comments that were artificially inflating my RSS feed. I just can't help commenting on the absurdity of it all - or responding to comments directed at me =P BTW, I have had my phone a few days now and its awesome. Everyone else happy with theirs? (lol) Jerk. =P - TreKing - Chicago transit tracking app for Android-powered deviceshttp://sites.google.com/site/rezmobileapps/treking -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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
Re: [android-developers] Problem installing your own developed app
A signed and an unsigned version of your app are seen as different applications by the device. You have to uninstall one before you can install the other. Jim On 11 May 2010 09:18, nep0x nespap...@yahoo.es wrote: Hi all! I m trying to understand the different ways you can install your app on your device. It's clear for me that we have to use the .apk file and the command adb install packagename. One of my question is which is the difference between an unsigned app and a signed one? Other doubt is related with eclipse commands. When you run your app into a real device, are you installing it?and when you are debugging?i would like to clear these concepts: 1.- run your app with eclipse plugin is the same that execute the command adb install package name 2.- Which the difference between debug and run an app if the result is the same: install it on your device I have been developing an app and i have used the command run the app into a real device many times to see the results and i have had no problem but now i finished the app i want the .apk file and install it through the command adb but i get the next error: C:\adb install C:\myapp\ConexionWebcam.apk 775 KB/s (12400 bytes in 0.015s) scandir: Permission denied cannot create /sys/module/yaffs/parameters/yaffs_auto_checkpoint: permission den ied Can't dispatch DDM chunk 46454154: no handler defined Can't dispatch DDM chunk 4d505251: no handler defined pkg: /data/local/tmp/ConexionWebcam.apk Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES] Please help me because i have no idea what the meaning of this errors. Thank you in advanced Néstor -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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] NullPointer Exception When Clicking on Map with OverlayItems
Hi, I am displaying google map and over that some Overlay items are there. In onTap(), I am displaying dialog. Its showing map and the overlayItem on top of the map. But if I click anywhere in Map, its showing NullPointer exception. Any Idea why this occurs Nithin -- 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] Multi Touch - Does anyone know how it works
Ok So I've gone through several tutorials on the web. I understand how the pointerCount works , I can get two points, etc, etc. My problem is I am trying to implement a game control, i.e. dpad and some buttons. The buttons are actually TextView objects with images. I Implement OnTouchListener Interface. my onTouch Method gets called when it should. The problem is if I have finger #1 on button a then press finger #2 on button b my OnTouch() method is called with the view of button a, not button b. Fine then I will just get the bounds of the buttons and see if they intersect with the points clicked. No luck, It seems as though the points that come in the MotionEvent are not relative to 0,0 , but to some other coordinate system. I would have thought all points were relative to upper left of screen. Here is my code. protected void onFinishInflate() { dpadView = findViewById(R.id.dpad); dpadView.setOnTouchListener(this); aButton = (TextView)findViewById(R.id.a_button); aButton.setOnTouchListener(this); bButton = (TextView)findViewById(R.id.b_button); bButton.setOnTouchListener(this); } public boolean onTouch(View v, MotionEvent event) { // Dump touch event to log // V.getId() is always equal to what the 1st finger is pressed on! Log.d(Controller,id: +v.getId()); dumpEvent(event); if(buttonHit(event,v)) { } return true; // indicate event was handled } private boolean buttonHit(MotionEvent event, View view) { for(int i=0;ievent.getPointerCount();i++) { int pointerId = event.getPointerId(i); int pointerX = (int)event.getX(pointerId); int pointerY = (int)event.getY(pointerId); Rect rect = new Rect(); view.getGlobalVisibleRect(rect); //view.getGlobalVisibleRect(rect); view.setBackgroundColor(Color.BLACK); Log.d(Controller, pointer ( + pointerX + , + pointerY + ) ); Log.d(Controller, bounds [( + rect.left + , + rect.top + )-( + rect.right + , + rect.bottom + )]); if( rect.contains(pointerX, pointerY)) { view.setBackgroundColor(Color.CYAN); Log.d(Controller,Hit button); view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); return true; } } return false; } I saw some posts from Romain Guy on Stack Overflow that said you can just add on OnTouchListener to each Button but when I do so I do not get a second event. Has anyone done this? Is there an example somewhere? -- 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: Multi Touch - Does anyone know how it works
No you cant just add onTouch to each button. The way multitouch is designed it will only work inside one view. You will need to draw everything yourself - you cant use multitouch over multiple view objects. It only works inside one View. Create a big view covering the screen, draw the contents yourself, and you can then get multitouch positions accurately. I know it sucks, right? I complained about it originally too but they didnt agree with me... -niko On May 11, 6:31 am, momojo jason.kah...@gmail.com wrote: Ok So I've gone through several tutorials on the web. I understand how the pointerCount works , I can get two points, etc, etc. My problem is I am trying to implement a game control, i.e. dpad and some buttons. The buttons are actually TextView objects with images. I Implement OnTouchListener Interface. my onTouch Method gets called when it should. The problem is if I have finger #1 on button a then press finger #2 on button b my OnTouch() method is called with the view of button a, not button b. Fine then I will just get the bounds of the buttons and see if they intersect with the points clicked. No luck, It seems as though the points that come in the MotionEvent are not relative to 0,0 , but to some other coordinate system. I would have thought all points were relative to upper left of screen. Here is my code. protected void onFinishInflate() { dpadView = findViewById(R.id.dpad); dpadView.setOnTouchListener(this); aButton = (TextView)findViewById(R.id.a_button); aButton.setOnTouchListener(this); bButton = (TextView)findViewById(R.id.b_button); bButton.setOnTouchListener(this); } public boolean onTouch(View v, MotionEvent event) { // Dump touch event to log // V.getId() is always equal to what the 1st finger is pressed on! Log.d(Controller,id: +v.getId()); dumpEvent(event); if(buttonHit(event,v)) { } return true; // indicate event was handled } private boolean buttonHit(MotionEvent event, View view) { for(int i=0;ievent.getPointerCount();i++) { int pointerId = event.getPointerId(i); int pointerX = (int)event.getX(pointerId); int pointerY = (int)event.getY(pointerId); Rect rect = new Rect(); view.getGlobalVisibleRect(rect); //view.getGlobalVisibleRect(rect); view.setBackgroundColor(Color.BLACK); Log.d(Controller, pointer ( + pointerX + , + pointerY + ) ); Log.d(Controller, bounds [( + rect.left + , + rect.top + )-( + rect.right + , + rect.bottom + )]); if( rect.contains(pointerX, pointerY)) { view.setBackgroundColor(Color.CYAN); Log.d(Controller,Hit button); view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); return true; } } return false; } I saw some posts from Romain Guy on Stack Overflow that said you can just add on OnTouchListener to each Button but when I do so I do not get a second event. Has anyone done this? Is there an example somewhere? -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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
Re: [android-developers] Multiple Notifications - PendingNotifications with different data?
Nathan wrote: Let's say I have a background service that performs several tasks. As it completes task A, it posts notification A with a certain intent and some extra data that indicates viewing result of A. As it completes task B, it posts notification B with a certain intent and some extra data that indicates viewing result of B. As it completes task C, it posts notification C with a certain intent and some extra data that indicates viewing result of C. At the end, the notification area has three notifications. Each one has the same intent, except for one of the extra data fields. I would expect that each one would load my activity with different extra data. They don't. PendingIntent.getActivity() will return a unique PendingIntent object *only* if the Intent you supply to that call is materially different than those used by other outstanding PendingIntents. By materially different, I mean where Intent#filterEquals() returns false. In your case, your three Intents are all the same from the perspective of filterEquals(), because filterEquals() does not take extras into account. Hence, you need to make three more distinct Intents. If your intents right now are using the component (e.g., new Intent(this, SomeActivity.class)), the easy way to do this is to assign some unique action string to them. That won't affect how the Intent gets routed, but it will make it distinct from a filterEquals() standpoint. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Online Training: 21-25 June 2010: http://onlc.com -- 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] How to detect in my application that Camera Settings has been changed?
Hi group, I am using camera in my application. It works well until following scenario:- 1- I start my application which in turn start the camera. 2- I press the home key button, so my Application is running in background now 3- Now I start the camera and change the settings of the camera application. like 'Auto Contrast' etc 4- I long press on 'Home' button key and select my application. Now in this case my application does not start and it says preview error. So, is there any broadcast message / notification available which i can use over here. Thanks, AJ -- 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: PNG quality in WebView based app
Wow! That must have driven you nuts trying to figure that one out. What provider were you using? Did you write a simple servlet or something that would serve the file as application/octet-stream? On May 10, 4:52 pm, Yahel kaye...@gmail.com wrote: I ran into the same problem a few monthes back. I spent hours trying to figure out why a webview would degrade the quality of an image. Turns out it was not the webview, it was my provider : When browsing the web on gprs or edge my provider downgrades image quality on their server so that its a lot lighter to download on their network. When I tried over wifi everything came back to normal. In the end I implemented a regular binary file download from my server, and then displayed that image. Yahel On 10 mai, 22:20, Jeff jeff.th...@gmail.com wrote: I am using WebView to display html content in an app. One of the pages has a rather large PNG image. The image is large and detailed on purpose because the idea is to use it as a map and allow users to zoom in to see the detail. Unfortunately, when the image is displayed with WebView, the quality is horrific. I am assuming that WebView is attempting to do some image optimization to reduce the size of the graphic. Is there anyway to prevent it from doing this? I don't want the image to lose any of its quality. Thanks, Jeff -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: NullPointer Exception When Clicking on Map with OverlayItems
Can you post the logcat? On May 11, 3:59 pm, Nithin nithin.war...@gmail.com wrote: Hi, I am displaying google map and over that some Overlay items are there. In onTap(), I am displaying dialog. Its showing map and the overlayItem on top of the map. But if I click anywhere in Map, its showing NullPointer exception. Any Idea why this occurs Nithin -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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] MediaPlayer pause on loop
Hi all, I am having an issue with a looping audio file using MediaPlayer. I am developing a realtime game and have a 100K MP3 file I want to loop as background music. The size of the file means I can't pre-load into memory (using SoundPool) so I am using the MediaPlayer to stream the data. All works fine, however if I set the stream to loop (MediaPlayer#setLooping(true)) when the stream gets to the end and MediaPlayer loops, I get a distinct pause in gameplay. Everything seems to hang for a good chunk of time (~100ms) presumably while MediaPlayer re-seeks to the start of the audio file, and this is killing my framerate and making the game unplayable at these points. There doesn't seem to be a way to configure any memory buffers etc on the MediaPlayer, so I'm wondering if I am using the wrong approach? Any other ways to run continuous background music? Thanks, Jason. -- 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] Apply Alphabetical Filters on listViewApply Alphabetical Filters on listView
Hi.. i need to create a list view that display same functionality as Contact App. I need to have a scroller through which i can traverse the list alphabetically. To achieve this i am following an example from API demos com.example.android.apis.view.List1.java. It is using a textfilter. When i implement this functionality on a static list view = it is working fine. But when i try this on a dynamic listview= it is not working. Plz help... -- 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: NullPointer Exception When Clicking on Map with OverlayItems
Hi, What is shown in logcat is, 05-11 17:41:04.591: INFO/System.out(1183): # Ending designMap() : 05-11 17:59:27.070: ERROR/AndroidRuntime(1338): Uncaught handler: thread main exiting due to uncaught exception 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): java.lang.NullPointerException 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at com.google.android.maps.ItemizedOverlay.getItemsAtLocation(ItemizedOverlay.java: 617) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at com.google.android.maps.ItemizedOverlay.getItemAtLocation(ItemizedOverlay.java: 586) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at com.google.android.maps.ItemizedOverlay.handleMotionEvent(ItemizedOverlay.java: 498) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at com.google.android.maps.ItemizedOverlay.onTouchEvent(ItemizedOverlay.java: 572) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at com.google.android.maps.OverlayBundle.onTouchEvent(OverlayBundle.java: 63) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at com.google.android.maps.MapView.onTouchEvent(MapView.java:625) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.view.View.dispatchTouchEvent(View.java:3672) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:850) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:820) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:820) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:820) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:820) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:820) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:820) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:820) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:820) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at com.android.internal.policy.impl.PhoneWindow $DecorView.superDispatchTouchEvent(PhoneWindow.java:1712) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java: 1202) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.app.Activity.dispatchTouchEvent(Activity.java:1987) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at com.android.internal.policy.impl.PhoneWindow $DecorView.dispatchTouchEvent(PhoneWindow.java:1696) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.view.ViewRoot.handleMessage(ViewRoot.java:1658) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.os.Handler.dispatchMessage(Handler.java:99) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.os.Looper.loop(Looper.java:123) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at android.app.ActivityThread.main(ActivityThread.java:4203) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at java.lang.reflect.Method.invokeNative(Native Method) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at java.lang.reflect.Method.invoke(Method.java:521) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:791) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 05-11 17:59:27.080: ERROR/AndroidRuntime(1338): at dalvik.system.NativeStart.main(Native Method) Nithin On May 11, 5:22 pm, Pratap ajit@gmail.com wrote: Can you post the logcat? On May 11, 3:59 pm, Nithin nithin.war...@gmail.com wrote: Hi, I am displaying google map and over that some Overlay items are there. In onTap(), I am displaying dialog. Its showing map and the overlayItem on top of the map. But if I click anywhere in Map, its showing NullPointer exception. Any Idea why this occurs Nithin -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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
[android-developers] Debugg problem source not found
Hi everyone when i am debugging the android application either on device or emulator.for some classes i got the error sorce not found eg. ActivityThread.performLaunchActivity(ActivityThread $ActivityRecord, Intent) line: 2418 ViewRoot.performTraversals() line: 643 i have already copied the android source code in the android-sdk- windows\platforms\android-3\sources what would be the problem? Thanks -- 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: Application wake up
Hi, Has anyone found any solution for Port directed SMS OR App directed SMS in android? Although the Inbox SMS hook is working but I am still unable to delete this SMS from Inbox. I dont want user to see this SMS notification. Thanks Sam On Apr 16, 5:04 pm, SAM gulati...@gmail.com wrote: Thanks Guys. Its working now. So the process goes like this: 1. In your manifest file, make a activity and a receiver. Mention your receiver class name here. 2. Make a entry for uses-permission android:name = android.permission.RECEIVE_SMS 3. To test on emulator, test by DDMS perspective view. 4. You application will receive SMS while its dead too. in Onreceive(), read the SMS and do whatever you want. you can also start your activity from here. Thanks sam On Mar 19, 7:56 am, Andreas andreas.bex...@gmail.com wrote: Hi, Please note that there is no longer any class called IntentReceiver. It is now called BroadcastReceiver. Also, to get this to work, you need to register the receiver in the AndroidManifest.xml like this: receiver android:name=.RespToSMS intent-filter action android:name=android.provider.Telephony.SMS_RECEIVED / /intent-filter /receiver Regards, Andreas On Mar 18, 2:50 pm, Vaibhav Kulkarni vaibhavkul...@gmail.com wrote: Hi Sam, I think you should create a service for that!!! You can use Intent for SMS in following way public class RespToSMS extends IntentReceiver { /* package name for Intent */ static final String ACTION = android.provider.Telephony.SMS_RECEIVED; public void onReceiveIntent(Context context, Intent intent) { if (intent.getAction().equals(ACTION)) { StringBuilder buf = new StringBuilder(); Bundle bundle = intent.getExtras(); if (bundle != null) { SmsMessage[] messages = Telephony.Sms.Intents.getMessagesFromIntent(intent); for (int i = 0; i lt; messages.length; i++) { SmsMessage message = messages[i]; buf.append(message.getDisplayMessageBody()); /* Check your SMS format and respond here... */ } } NotificationManager nm = (NotificationManager) context.getSystemService( Context.NOTIFICATION_SERVICE); nm.notifyWithText(123, buf.toString(), NotificationManager.LENGTH_LONG, null); } } } Thanks, Vaibhav On Thu, Mar 18, 2010 at 10:33 AM, SAM gulati...@gmail.com wrote: Hi, I have a requirement to wake up my application upon receiving a particular formatted SMS or App directed notification from server. My application is in dead state. Whenever the device receives a event may be a SMS in a particular format OR some notification(eg app directed notification from server), android OS will start my application. Its possible in Windows Mobile and BREW. Please let me know if its possible in Android and how. Thanks Sam -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-Hide quoted text - - Show quoted text - -- 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 athttp://groups.google.com/group/android-developers?hl=en- Hide quoted text - - Show quoted text - -- 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] ContactsContract and target version
Hi! I'm creating an app that needs to create a contact. My 1st attempt was: ContentValues values = new ContentValues(); values.put(Contacts.People.NAME, Name); values.put(People.Phones.TYPE, People.Phones.TYPE_MOBILE); values.put(People.Phones.NUMBER, +1); Uri myUri = getContentResolver().insert(People.CONTENT_URI,values); This creates an exception: column NUMBER is invalid (huh?) It seems People.Phones.NUMBER is deprecated so I tried to use ContactsContract. Unfornately ContactsContract and RawContacts are not resolved (using Eclipse) unless... I change the project target to 7. Since I need the app to run on target 3 (1.5), could please someone tell me how to add a contact - that works on always versions? 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
Re: [android-developers] Re: Application wake up
Send binary SMS to the specific port on the phone, they won't be shown in the inbox.. (except the HTC Tattoo sometimes shows binary SMS in the inbox.. seems to be a device-specific bug) cheers Am 11.05.2010 15:36, schrieb SAM: Hi, Has anyone found any solution for Port directed SMS OR App directed SMS in android? Although the Inbox SMS hook is working but I am still unable to delete this SMS from Inbox. I dont want user to see this SMS notification. Thanks Sam On Apr 16, 5:04 pm, SAMgulati...@gmail.com wrote: Thanks Guys. Its working now. So the process goes like this: 1. In your manifest file, make a activity and a receiver. Mention your receiver class name here. 2. Make a entry foruses-permission android:name = android.permission.RECEIVE_SMS 3. To test on emulator, test by DDMS perspective view. 4. You application will receive SMS while its dead too. in Onreceive(), read the SMS and do whatever you want. you can also start your activity from here. Thanks sam On Mar 19, 7:56 am, Andreasandreas.bex...@gmail.com wrote: Hi, Please note that there is no longer any class called IntentReceiver. It is now called BroadcastReceiver. Also, to get this to work, you need to register the receiver in the AndroidManifest.xml like this: receiver android:name=.RespToSMS intent-filter action android:name=android.provider.Telephony.SMS_RECEIVED / /intent-filter /receiver Regards, Andreas On Mar 18, 2:50 pm, Vaibhav Kulkarnivaibhavkul...@gmail.com wrote: Hi Sam, I think you should create a service for that!!! You can use Intent for SMS in following way public class RespToSMS extends IntentReceiver { /* package name for Intent */ static final String ACTION = android.provider.Telephony.SMS_RECEIVED; public void onReceiveIntent(Context context, Intent intent) { if (intent.getAction().equals(ACTION)) { StringBuilder buf = new StringBuilder(); Bundle bundle = intent.getExtras(); if (bundle != null) { SmsMessage[] messages = Telephony.Sms.Intents.getMessagesFromIntent(intent); for (int i = 0; ilt; messages.length; i++) { SmsMessage message = messages[i]; buf.append(message.getDisplayMessageBody()); /* Check your SMS format and respond here... */ } } NotificationManager nm = (NotificationManager) context.getSystemService( Context.NOTIFICATION_SERVICE); nm.notifyWithText(123, buf.toString(), NotificationManager.LENGTH_LONG, null); } } } Thanks, Vaibhav On Thu, Mar 18, 2010 at 10:33 AM, SAMgulati...@gmail.com wrote: Hi, I have a requirement to wake up my application upon receiving a particular formatted SMS or App directed notification from server. My application is in dead state. Whenever the device receives a event may be a SMS in a particular format OR some notification(eg app directed notification from server), android OS will start my application. Its possible in Windows Mobile and BREW. Please let me know if its possible in Android and how. Thanks Sam -- 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.comandroid-developers%2bunsubs限cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-Hide quoted text - - Show quoted text - -- 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 athttp://groups.google.com/group/android-developers?hl=en- Hide quoted text - - Show quoted text - -- 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
Re: [android-developers] someone please help me with these issues.
Aishwarya, You may want to break up the issues individually and post them. Optionally, you may also want to post sample code for each issue on some blog and put a pointer to it for someone to take a look at the code quickly. On Tue, May 11, 2010 at 5:43 AM, aishwarya shukla aishwaryashukl...@gmail.com wrote: 1. I am using a Broadcast Receiver which acquires a static WakeLock, then immediately starts an activity which starts a media player instance inside its onCreate, at the last line of OnCreate i have released the static wakelock which i had acquired in the BroadCastReceiver. Everything seems to work fine, except for the fact that the screen does wakeup but is locked and has to be manually unlocked before the user can see my activity, though the media player starts playing normally before itself. I have set lockStatic=mgr.newWakeLock(PowerManager.FULL_WAKE_LOCK| PowerManager.ACQUIRE_CAUSES_WAKEUP, LOCK_NAME_STATIC); still the screen has to be manually unlocked before the user can see the activity. Any workaround? 2. I have used an EditText inside a tablelayout, tablerow and have set the android:height and width to wrap_content, but still when i type on the softkeypad it exceeds the bounds of the EditText Box and overflows the screen too. have tried various properties on the EditText but none of them seems to work. 3. I have an Activity a ListView Activity which populates the List from a db. When the user clicks on an item in a list, i take him to a new Activity from where he can also delete the item he selected. The problem is that the Parent Activity's ListView is not refreshed and continues showing redundant content, when i have finished the child activity. I have tried making the cursor as static and calling cursor.requery() from my child activity before i finish it, but it doesnt seem to fix the issue. 4. I have used an Activity say activityA which sets up alarm using AlarmManager.set to a Receiver say RecA. If i want to cancel this alarm later from an Activity say ActivityB how do i do so? Somone please respond to the above issues soon. I have been trying a few workaounds since past few days, but am not able to fix these issues. 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 -- 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: Nexus one gps issue
Please anybody knows about it?? On May 11, 1:42 pm, Namrata puranik.namr...@gmail.com wrote: Hi, I am working app for nexus one which uses gps. I have placed turning on code of gps in onStart() of Activity and and turning off code in onStop(). As per logs On/Off works fine specially turning off. But then gps icon stays forever on notification bar. Is there any bug/ issue with Nexus One GPS? or am I doing anything wrong? Tunrning on/ off code is as follows onStart(){ ... String[] providers = { LocationManager.GPS_PROVIDER, LocationManager.NETWORK_PROVIDER }; int noOfProviders = providers.length; for (int i = 0; i noOfProviders; i++) { final String currentProvider = providers[i]; if (locManager.isProviderEnabled(currentProvider)) { locManager.requestLocationUpdates(currentProvider, 100L, 0.0f, _instance); } } ... } onStop(){ ... if (locManager != null) { locManager.removeUpdates(_instance); } ... } and the logs for turning off gps are.. LocationManager( 369): removeUpdates: listener = com.xxx.xxx@4495e330 D/NetworkLocationProvider( 76): removeListener(): com.xxx.xxx D/GpsLocationProvider( 76): stopNavigating D/libgps ( 76): qct_gps_stop Thanks in advance Namrata -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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] Need your expertise on Tab control
Hello, My app's main screen consists of 5 tabs. First Second Tabs have integrated the same ListActivity , because both displays similar data(List of - images, text etc..). Each time I click on those 2 tabs, it should refresh the image list dynamically based on some condition. Now my question is, where should I create the ListAdapter exactly and update the ListAdapter with the new data(image, text etc..) on each tab(First Second tab)? Is it in onCreate() OR onStart() OR onResume() ? As per the flow, onCreate() / onStart() are being called only very first time, and after that, only onResume() is being called. Please need your guidance Thank you so much.. Regards, DK -- 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
Re: [android-developers] MapView Marker and Parameter
On Mon, May 10, 2010 at 11:39 PM, Ning zeeg...@gmail.com wrote: Is there API to draw the blue flashing circle at arbitrary location same as the one provided by MyLocationOverlay in Google Map API? Yes, the Canvas object passed to your draw function. And is it possible to draw a parameter around the dot given a radius, like my location in Google Map? I'm not sure what you mean by parameter. If you mean a circle for the diameter, then yes, it is possible, again using the Canvas. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- 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] Multiple Notifications - PendingIntents with different data?
Let's say I have a background service that performs several tasks. As it completes task A, it posts notification A with a certain intent and some extra data that indicates viewing result of A. As it completes task B, it posts notification B with a certain intent and some extra data that indicates viewing result of B. As it completes task C, it posts notification C with a certain intent and some extra data that indicates viewing result of C. At the end, the notification area has three notifications. Each one has the same intent, except for one of the extra data fields. I would expect that each one would load my activity with different extra data. They don't. When onNewIntent is called, each has the extra data field set to C. I have rooted out any possible aliasing and checked the data as it is placed into a notification. It seems to allow only one set of data per package. Is what I am attempting not possible? Has anyone accomplished what I am attempting? For example, have you had a service download several large files, and then had notifications that would open each of those files? This is some of the relevant code: // post a finished notification. Notification finished = new Notification(R.drawable.notifier, tickerText, System.currentTimeMillis()); Intent intent = new Intent(); intent.setClass(DownloadService.this, MyActivity.class); intent.setAction(MyActivity.OPEN_LOCATION); // adding parameters to extras .. intent.putExtra(packageName.layer, layer); ... // The PendingIntent to launch our activity if the user selects this // notification PendingIntent contentIntent = PendingIntent.getActivity(DownloadService.this, 0, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT | Intent.FILL_IN_DATA); String contentTitle = getString(R.string.n_download_completed); String contentText = getString(R.string.n_download_results, layer); finished.setLatestEventInfo(DownloadService.this, contentTitle, contentText, contentIntent); mNotificationManager.notify(finishedid++, finished); Nathan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android- develop...@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 -- 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: MapView Marker and Parameter
Thank you, TreKing. That helps. On May 11, 10:30 am, TreKing treking...@gmail.com wrote: On Mon, May 10, 2010 at 11:39 PM, Ning zeeg...@gmail.com wrote: Is there API to draw the blue flashing circle at arbitrary location same as the one provided by MyLocationOverlay in Google Map API? Yes, the Canvas object passed to your draw function. And is it possible to draw a parameter around the dot given a radius, like my location in Google Map? I'm not sure what you mean by parameter. If you mean a circle for the diameter, then yes, it is possible, again using the Canvas. --- -- TreKing - Chicago transit tracking app for Android-powered deviceshttp://sites.google.com/site/rezmobileapps/treking -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: How to get selected items in a ListView (multi selection check boxes)? - URGENT PLZ
Anyone please... On May 10, 6:34 pm, dillipk codersnet2...@gmail.com wrote: Hello, How do I get the selected items in a ListView which contains a multi selelected check boxes.? The following code doesn't work correctly... getContacts() is being called in a Button click(). private String getContacts(){ SparseBooleanArray selectedContacts = listView.getCheckedItemPositions(); StringBuffer sb = new StringBuffer(); int size = selectedContacts .size(); for (int sbaKey = 0; sbaKey size; sbaKey++) { if (selectedContacts .get(sbaKey, false)) { //Log.d(TAG, Selected Categories : + listView.getItemAtPosition(sbaKey).toString()); sb.append(listView.getItemAtPosition(sbaKey).toString()); if(sbaKey = size - 2 ){ sb.append(','); } } } Log.d(TAG, Selected Contacts : + sb.toString()); return sb.toString(); } Creation: �...@override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setTitle(Preferences); setListAdapter(new ArrayAdapterString(this, android.R.layout.simple_list_item_multiple_choice, CONTACTS)); listView = getListView(); listView.setItemsCanFocus(false); listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); } Thank you for your help in advance.. -DK -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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] APKTool - decoding our apps
Hello, I stumbled across this program on the web: http://code.google.com/p/android-apktool/ And realized that it works pretty well. I can decode the programs I've made from the apk files. I can't really say I like that. Does anyone know of a way create the apk file without having programs like this being able to decode and open them? -André -- 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] which is better to use to avoid mem leaks== getbasecontext or getApplicationcontext
public Contexthttp://developer.android.com/reference/android/content/Context.html getApplicationContext () Since: API Level 1http://developer.android.com/guide/appendix/api-levels.html#level1 Return the context of the single, global Application object of the current process. public Contexthttp://developer.android.com/reference/android/content/Context.html getBaseContext () Since: API Level 1http://developer.android.com/guide/appendix/api-levels.html#level1 Returns - the base context as set by the constructor or setBaseContext Since applicationcontext is global application object, To avoid objects retained in memory after activity is closed (assuming this application has lots of activities), its better to use getbasecontext Is my understanding right.? Thanks for all your inputs. -- 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: APKTool - decoding our apps
I don't know, but I find the summary of it interesting. . It is a tool for reengineering 3rd party, closed, binary Android apps. It is NOT intended for piracy and other non-legal uses. It could be used for localizing, adding some features or support for custom platforms and other GOOD purposes. Baloney. Reengineering itself is an illegal use. There is no GOOD purpose it should be used for. It is a piracy tool pure and simple. Nathan On May 11, 8:28 am, André pha...@hotmail.com wrote: Hello, I stumbled across this program on the web: http://code.google.com/p/android-apktool/ And realized that it works pretty well. I can decode the programs I've made from the apk files. I can't really say I like that. Does anyone know of a way create the apk file without having programs like this being able to decode and open them? -André -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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
Re: [android-developers] Re: Multi Touch - Does anyone know how it works
Do you guys know if this is why the bug that many game developers have come across occurs.. where trying to simulate two joysticks on the screen wont work due to wrong touch info being consumed? I forget the details, but I think it had to do with if you touch one point, and while doing so, touch another..that works fine.. but if you release point 1, then touch again, it some how reads as point 2, instead of point 1? Was this issue resolved due to what you said above niko.. that multi-touch only works within one view? I would have thought a game would use a single view as well tho. On Tue, May 11, 2010 at 4:49 AM, niko20 nikolatesl...@yahoo.com wrote: No you cant just add onTouch to each button. The way multitouch is designed it will only work inside one view. You will need to draw everything yourself - you cant use multitouch over multiple view objects. It only works inside one View. Create a big view covering the screen, draw the contents yourself, and you can then get multitouch positions accurately. I know it sucks, right? I complained about it originally too but they didnt agree with me... -niko On May 11, 6:31 am, momojo jason.kah...@gmail.com wrote: Ok So I've gone through several tutorials on the web. I understand how the pointerCount works , I can get two points, etc, etc. My problem is I am trying to implement a game control, i.e. dpad and some buttons. The buttons are actually TextView objects with images. I Implement OnTouchListener Interface. my onTouch Method gets called when it should. The problem is if I have finger #1 on button a then press finger #2 on button b my OnTouch() method is called with the view of button a, not button b. Fine then I will just get the bounds of the buttons and see if they intersect with the points clicked. No luck, It seems as though the points that come in the MotionEvent are not relative to 0,0 , but to some other coordinate system. I would have thought all points were relative to upper left of screen. Here is my code. protected void onFinishInflate() { dpadView = findViewById(R.id.dpad); dpadView.setOnTouchListener(this); aButton = (TextView)findViewById(R.id.a_button); aButton.setOnTouchListener(this); bButton = (TextView)findViewById(R.id.b_button); bButton.setOnTouchListener(this); } public boolean onTouch(View v, MotionEvent event) { // Dump touch event to log // V.getId() is always equal to what the 1st finger is pressed on! Log.d(Controller,id: +v.getId()); dumpEvent(event); if(buttonHit(event,v)) { } return true; // indicate event was handled } private boolean buttonHit(MotionEvent event, View view) { for(int i=0;ievent.getPointerCount();i++) { int pointerId = event.getPointerId(i); int pointerX = (int)event.getX(pointerId); int pointerY = (int)event.getY(pointerId); Rect rect = new Rect(); view.getGlobalVisibleRect(rect); //view.getGlobalVisibleRect(rect); view.setBackgroundColor(Color.BLACK); Log.d(Controller, pointer ( + pointerX + , + pointerY + ) ); Log.d(Controller, bounds [( + rect.left + , + rect.top + )-( + rect.right + , + rect.bottom + )]); if( rect.contains(pointerX, pointerY)) { view.setBackgroundColor(Color.CYAN); Log.d(Controller,Hit button); view.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY); return true; } } return false; } I saw some posts from Romain Guy on Stack Overflow that said you can just add on OnTouchListener to each Button but when I do so I do not get a second event. Has anyone done this? Is there an example somewhere? -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups
[android-developers] Re: Nexus one gps issue
You probably do NOT want to put the starting and stopping of the location (GPS) providers in the onStart() and onStop(). The onStop() may not be called when your activity goes to the background: - It is not called because your activity remains active in the background - It is not called because the OS just killed your entire process. (this would actually kill the GPS provider as well). Instead, start and stop the GPS provider in the onResume() and onPause(). On May 11, 10:14 am, Namrata puranik.namr...@gmail.com wrote: Please anybody knows about it?? On May 11, 1:42 pm, Namrata puranik.namr...@gmail.com wrote: Hi, I am working app for nexus one which uses gps. I have placed turning on code of gps in onStart() of Activity and and turning off code in onStop(). As per logs On/Off works fine specially turning off. But then gps icon stays forever on notification bar. Is there any bug/ issue with Nexus One GPS? or am I doing anything wrong? Tunrning on/ off code is as follows onStart(){ ... String[] providers = { LocationManager.GPS_PROVIDER, LocationManager.NETWORK_PROVIDER }; int noOfProviders = providers.length; for (int i = 0; i noOfProviders; i++) { final String currentProvider = providers[i]; if (locManager.isProviderEnabled(currentProvider)) { locManager.requestLocationUpdates(currentProvider, 100L, 0.0f, _instance); } } ... } onStop(){ ... if (locManager != null) { locManager.removeUpdates(_instance); } ... } and the logs for turning off gps are.. LocationManager( 369): removeUpdates: listener = com.xxx.xxx@4495e330 D/NetworkLocationProvider( 76): removeListener(): com.xxx.xxx D/GpsLocationProvider( 76): stopNavigating D/libgps ( 76): qct_gps_stop Thanks in advance Namrata -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en- Hide quoted text - - Show quoted text - -- 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: APKTool - decoding our apps
Interesting that it's hosted on google as well! On May 11, 6:00 pm, Nathan critter...@crittermap.com wrote: I don't know, but I find the summary of it interesting. . It is a tool for reengineering 3rd party, closed, binary Android apps. It is NOT intended for piracy and other non-legal uses. It could be used for localizing, adding some features or support for custom platforms and other GOOD purposes. Baloney. Reengineering itself is an illegal use. There is no GOOD purpose it should be used for. It is a piracy tool pure and simple. Nathan On May 11, 8:28 am, André pha...@hotmail.com wrote: Hello, I stumbled across this program on the web: http://code.google.com/p/android-apktool/ And realized that it works pretty well. I can decode the programs I've made from the apk files. I can't really say I like that. Does anyone know of a way create the apk file without having programs like this being able to decode and open them? -André -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: APKTool - decoding our apps
Has anyone tried using an obfuscator on their app before apk'ing it? Something like http://proguard.sourceforge.net/ I'm going to give it a try and then try to reverse engineer it to see if it helps. Don't like the idea of people reverse engineering our code either... On May 11, 12:00 pm, Nathan critter...@crittermap.com wrote: I don't know, but I find the summary of it interesting. . It is a tool for reengineering 3rd party, closed, binary Android apps. It is NOT intended for piracy and other non-legal uses. It could be used for localizing, adding some features or support for custom platforms and other GOOD purposes. Baloney. Reengineering itself is an illegal use. There is no GOOD purpose it should be used for. It is a piracy tool pure and simple. Nathan On May 11, 8:28 am, André pha...@hotmail.com wrote: Hello, I stumbled across this program on the web: http://code.google.com/p/android-apktool/ And realized that it works pretty well. I can decode the programs I've made from the apk files. I can't really say I like that. Does anyone know of a way create the apk file without having programs like this being able to decode and open them? -André -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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
Re: [android-developers] Re: How to disable home and other buttons so as to persist an app?
So you're trying to be an iPhone? :D Yah, as they said, there is no way to make that work. Romain, one question on the Home key.. is there any way to detect it so you can close your app when they press the Home key? I would assume the standard lifecycle events still fire, so you can at least pause any game threads, music, etc so as not to consume any resources. On Tue, May 11, 2010 at 2:48 AM, Ashok Jeevan ashokjee...@gmail.com wrote: Hi, Thanks Mr Romain Guy, for the information. @Mike dg : The requirement is that one app has to be loaded at startup which displays a browser with a specified URL. And one of the requirement is that whatever buttons the user presses or clicks, the browser shouldn't exit. The browser with the specified URL should be the only app that the user has access to. Since the 'Home' button on being pressed, exists the application, the above requirement can't be implemented. Ashok Jeevan +91 9895401278 On Thu, May 6, 2010 at 8:00 PM, Mike dg vinb...@gmail.com wrote: What are you trying to do? You could see that tons of things could go wrong with an app that runs on boot and doesn't allow you to get away. -Mike dg On May 6, 3:07 am, Ashok Jeevan ashokjee...@gmail.com wrote: Hi guys, I am building an app which uses a WebView. This app runs at startup. Is there a way to maintain the app running(persists) even if the user presses the 'Home' or 'Back' button? In other words,pressing the 'Home', 'Back' or the other buttons shouldn't close the activity. Ashok Jeevan +91 9895401278 -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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: How to disable home and other buttons so as to persist an app?
That won't work. What you want to do is not possible unless you create your own ActivityManager allowing just one activity: your activity. I guess you have to create your own AOSP branch for this to happen. All apps play by the same rules. And what if the user gets a phone call? What if a SMS comes in? What if not only your app wants to be displayed all the time, but another app wants to be displayed all the time as well? On May 11, 5:48 am, Ashok Jeevan ashokjee...@gmail.com wrote: Hi, Thanks Mr Romain Guy, for the information. @Mike dg : The requirement is that one app has to be loaded at startup which displays a browser with a specified URL. And one of the requirement is that whatever buttons the user presses or clicks, the browser shouldn't exit. The browser with the specified URL should be the only app that the user has access to. Since the 'Home' button on being pressed, exists the application, the above requirement can't be implemented. Ashok Jeevan +91 9895401278 On Thu, May 6, 2010 at 8:00 PM, Mike dg vinb...@gmail.com wrote: What are you trying to do? You could see that tons of things could go wrong with an app that runs on boot and doesn't allow you to get away. -Mike dg On May 6, 3:07 am, Ashok Jeevan ashokjee...@gmail.com wrote: Hi guys, I am building an app which uses a WebView. This app runs at startup. Is there a way to maintain the app running(persists) even if the user presses the 'Home' or 'Back' button? In other words,pressing the 'Home', 'Back' or the other buttons shouldn't close the activity. Ashok Jeevan +91 9895401278 -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en- Hide quoted text - - Show quoted text - -- 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: How to set and get thread priority from Java and native layers
It could be that the thread's ThreadGroup has a maximum priority of 5. A thread's priority cannot be higher than it's thread-group max- priority. It could be that some code you didn't code, but call instead, that sets the thread priority to 5. On May 10, 11:37 pm, Krishnakumar Ramachandran krishnakumar.ramachand...@gmail.com wrote: I tried that too. But still when I try to query my audio thread's priority, it still shows its priority as 5. On Tue, May 11, 2010 at 8:25 AM, Streets Of Boston flyingdutc...@gmail.comwrote: What about Thread.setPriority(...) ? That seems to be working for me. When, using the above method, i set the priority of a background- thread too high it has an impact on the GUI (it gets sluggish). It must be doing something... On May 10, 9:20 pm, Krishnakumar Ramachandran krishnakumar.ramachand...@gmail.com wrote: Hi has anyone got any idea on this? On Mon, May 10, 2010 at 12:56 PM, KK krishnakumar.ramachand...@gmail.comwrote: I have a multithreaded streaming app which has mainly the following 5 threads 1 Main App(UI) Thread 1 controller thread (in native) 1 audio decoder thread (in native) 1 video decoder thread(in native) 1 thread to query the head position of audio (in Java) Apart from this I have video rendering with OpenGL. My problem is, if I query the thread priority using the Thread.getPriority method (my native threads make callbacks to Java and I am making the query at that point of time), I am getting the priority of each of them as 5. For my audio query thread (the last one in the list) I am explicitly setting the priority using Process.setThreadPriority(Process.THREAD_PRIORITY_URGENT_AUDIO); Also for my decoder threads, I am giving higher priority than my controller thread(using pthread APIs in native). But still finally all of them seem to have same priority. Can anyone please tell me what is wrong here. Also what should I be doing to increase the priority of my threads(both from Java and native). Thanks KK -- 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.comandroid-developers%2bunsubscr...@googlegroups.com android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group athttp:// groups.google.com/group/android-developers?hl=en- Hide quoted text - - Show quoted text - -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en- Hide quoted text - - Show quoted text - -- 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
Re: [android-developers] which is better to use to avoid mem leaks== getbasecontext or getApplicationcontext
social hub wrote: public Context http://developer.android.com/reference/android/content/Context.html getApplicationContext () Since: API Level 1 http://developer.android.com/guide/appendix/api-levels.html#level1 Return the context of the single, global Application object of the current process. public Context http://developer.android.com/reference/android/content/Context.html getBaseContext () Since: API Level 1 http://developer.android.com/guide/appendix/api-levels.html#level1 Returns * the base context as set by the constructor or setBaseContext Since applicationcontext is global application object, To avoid objects retained in memory after activity is closed (assuming this application has lots of activities), its better to use getbasecontext Is my understanding right.? Neither. Activity is a Context. Service is a Context. If you need a Context, you already have one -- just use it. Those methods are for special cases, not the normal case. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android Development Wiki: http://wiki.andmob.org -- 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-beginners] ubuntu 10.04 emulator not launching
Yes I did try the verbose option. I find a segmentation fault. It got fixed now after some updates to Ubuntu 10.04. Not sure what fixed it but after some updates the emulator has started to work again now. Regards, Riaz Ur Rahaman On Thu, May 6, 2010 at 6:13 AM, David Turner di...@android.com wrote: can you start the emulator from the command line properly (e.g. : $ANDROID_SDK_ROOT/tools/emulator -avd name) Can you try with the -verbose option to see if it dumps useful information, there is also -debug-all which is going to dump a *lot* of stuff. It looks like the emulator has problems connecting to your X server. How is your DISPLAY environment variable defined ? On Mon, May 3, 2010 at 12:30 AM, riazrahaman rahaman.r...@gmail.comwrote: Hi, Was not able to launch the emulator on Ubuntu 10.04. Getting the below error in eclipse. Is there a work around or a fix for this? [2010-05-02 23:35:34 - HelloWorld] Automatic Target Mode: Unable to detect device compatibility. Please select a target device. [2010-05-02 23:35:39 - HelloWorld] Launching a new emulator with Virtual Device 'android15' [2010-05-02 23:35:42 - HelloWorld] New emulator found: emulator-5554 [2010-05-02 23:35:42 - HelloWorld] Waiting for HOME ('android.process.acore') to be launched... [2010-05-02 23:35:43 - Emulator] XIO: fatal IO error 11 (Resource temporarily unavailable) on X server :0.0 [2010-05-02 23:35:43 - Emulator] after 7 requests (6 known processed) with 0 events remaining. [2010-05-02 23:35:43 - HelloWorld] emulator-5554 disconnected! Cancelling 'com.paad.chapter2.HelloWorld activity launch'! Is this a known issue with the 10.04 Lucid lynx ubuntu? Regards, Riaz Ur Rahaman -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- 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
Re: [android-developers] Re: On activity (re)usage en creation
On Tue, May 11, 2010 at 1:31 AM, EnnaN nhui...@gmail.com wrote: It is in this case easiest to make a separate activity for each type of page, but this means that while 'browsing' you're making a new activity for each click and that feels a bit redundant, expensive or.. well, something like that? I was wondering if it would be wise to make an effort to keep both pages in the same activity. If you're dealing with actual links and web pages, then yeah, it makes more sense to have a WebView or something where only the current page changes and not create a new activity. If you're using buttons or something else and building a standalone app that pulls in data, then rethink having a button on the details page of comment that takes you back to other entries. Or, again, playing with the flags that you use to launch the activities (like using singleTask) will force them to be re-used instead of creating new ones. That also involves more work in handling the update intent information, so it's up to you which you prefer. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- 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: clock of emulator 1.6 runs 100% slower than real time clock!!!
is this clock slowness of emulator 1.6 a direct cause of the freaky behavior of AudioRecorder class that quite some developers found with SDK 1.6??? that is, the slowness of system clock causes AudioRecorder to sample audio 100% slowlier than the speed it should?? if yes, what action should i take to fix the issue? please advice. thanks a lot !!! On May 10, 4:35 pm, HeHe cnm...@gmail.com wrote: often the clock of emulator 1.6 runs significantly (100-150%) slower than real world clock. for example, after 10 minutes of a human life have elapsed, from logcat timestamp only 5 minutes have elapsed on my emulator 1.6, has anyone using emulator 1.6 experienced the same issue? if yes, how did you tackle with it? -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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] PLEASE HELP!!! may i develop app for Android 1.6 using SDK 2.x?
the slowness of system clock with SDK 1.6 makes debugging of my app that heavily depends on correct clock timing impossible. hence, i would like to know if i can develop app for Android 1.5/1.6 using more recently released SDK (eg. 2.0)? if yes, how? thanks in advancet for any advice!! -- 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: PLEASE HELP!!! may i develop app for Android 1.6 using SDK 2.x?
If I understand your question correctly, then yes. In your manifest, just set the following: uses-sdk android:minSdkVersion=3 android:targetSdkVersion=6 / the app will still work on 1.5+. Just make sure you don't use any SDK methods that don't exist on earlier platforms without checking the user's local sdk version. On May 11, 9:53 am, HeHe cnm...@gmail.com wrote: the slowness of system clock with SDK 1.6 makes debugging of my app that heavily depends on correct clock timing impossible. hence, i would like to know if i can develop app for Android 1.5/1.6 using more recently released SDK (eg. 2.0)? if yes, how? thanks in advancet for any advice!! -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: PLEASE HELP!!! may i develop app for Android 1.6 using SDK 2.x?
On May 11, 10:32 am, Mark Wyszomierski mar...@gmail.com wrote: the app will still work on 1.5+. Just make sure you don't use any SDK methods that don't exist on earlier platforms without checking the user's local sdk version. A further tip: as one of the ways to check you aren't using API that won't work on 1.5, set your project properties to 1.5 and see if there are compile errors. Do this once in a while, and at least once before every release. If any methods come up that do not compile on 1.5, and you still want to use them, you'll need to use reflection to make them compile for 1.5. It's messy but it works. Nathan -- 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: PLEASE HELP!!! may i develop app for Android 1.6 using SDK 2.x?
hi Nathan and Mark, thanks a lot to both of you!! one more question: in Eclipse, how can i set project properties to 1.5? could you elaborate the menu options or point me to the documentation page that indicates how-to. thanks again!! On May 11, 10:50 am, Nathan critter...@crittermap.com wrote: On May 11, 10:32 am, Mark Wyszomierski mar...@gmail.com wrote: the app will still work on 1.5+. Just make sure you don't use any SDK methods that don't exist on earlier platforms without checking the user's local sdk version. A further tip: as one of the ways to check you aren't using API that won't work on 1.5, set your project properties to 1.5 and see if there are compile errors. Do this once in a while, and at least once before every release. If any methods come up that do not compile on 1.5, and you still want to use them, you'll need to use reflection to make them compile for 1.5. It's messy but it works. Nathan -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: APKTool - decoding our apps
That looks good. But I have no idea how to use it? I've been trying to find a tutorial for it. Have you found that? -André On May 11, 6:09 pm, pacoder sove...@gmail.com wrote: Has anyone tried using an obfuscator on their app before apk'ing it? Something likehttp://proguard.sourceforge.net/ I'm going to give it a try and then try to reverse engineer it to see if it helps. Don't like the idea of people reverse engineering our code either... On May 11, 12:00 pm, Nathan critter...@crittermap.com wrote: I don't know, but I find the summary of it interesting. . It is a tool for reengineering 3rd party, closed, binary Android apps. It is NOT intended for piracy and other non-legal uses. It could be used for localizing, adding some features or support for custom platforms and other GOOD purposes. Baloney. Reengineering itself is an illegal use. There is no GOOD purpose it should be used for. It is a piracy tool pure and simple. Nathan On May 11, 8:28 am, André pha...@hotmail.com wrote: Hello, I stumbled across this program on the web: http://code.google.com/p/android-apktool/ And realized that it works pretty well. I can decode the programs I've made from the apk files. I can't really say I like that. Does anyone know of a way create the apk file without having programs like this being able to decode and open them? -André -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: startActivityForResult returns result BEFORE activity starts.
It does say that it won't work if the activity is in the singleTask mode. I haven't tried to launch the activity in singleTask mode, and the API examples don't seem to have done anything special to make it *not* be singleTask mode. android:launchMode=standard is in the manifest. But I'll try harder to make sure it is not in single task mode. It's something to try at least. Nathan -- 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: Multiple Notifications - PendingIntents with different data?
I've done it successfully by using setData(Uri) and making sure Intent.FILL_IN_DATA is set. I'm not sure why it won't see the intent as unique when it differs by Extra Data only, but at least this works. Nathan -- 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: PLEASE HELP!!! may i develop app for Android 1.6 using SDK 2.x?
thanks, Mark. i think i need to upgrade SDK asap, or i will become crazy! emulator 1.6 is far more terrible than 1.5. beside the slow clock issue, it tends to lose connection with adb, so i have been having to either kill emulator or kill adb frequently to debug my app. enough. i cannot stand it any more. On May 11, 9:53 am, HeHe cnm...@gmail.com wrote: the slowness of system clock with SDK 1.6 makes debugging of my app that heavily depends on correct clock timing impossible. hence, i would like to know if i can develop app for Android 1.5/1.6 using more recently released SDK (eg. 2.0)? if yes, how? thanks in advancet for any advice!! -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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
Re: [android-developers] Re: Multiple Notifications - PendingIntents with different data?
Nathan wrote: I've done it successfully by using setData(Uri) and making sure Intent.FILL_IN_DATA is set. I'm not sure why it won't see the intent as unique when it differs by Extra Data only, but at least this works. Nathan it's enough to use unique requestCode when calling getActivity pskink -- 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] Controlling the rendering order of child views
Hi, I have an application wherein I extend the ViewGroup class for laying out the child views as per my requirements. Some of the child views are instances of ImageView class and have partly transparent background. Given the alpha blending is order dependent, I would like to control the rendering order of the ImageView inside the my own Layout class which extends ViewGroup. Could someone please suggest how could I achieve the same? Thanks in advance, DivKis -- 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
Re: [android-developers] Controlling the rendering order of child views
Hi, You can do it by calling setChildrenDrawingOrderEnabled(true) and then implementing getChildDrawingOrder(int, int). On Tue, May 11, 2010 at 11:37 AM, Divkis divick.kish...@gmail.com wrote: Hi, I have an application wherein I extend the ViewGroup class for laying out the child views as per my requirements. Some of the child views are instances of ImageView class and have partly transparent background. Given the alpha blending is order dependent, I would like to control the rendering order of the ImageView inside the my own Layout class which extends ViewGroup. Could someone please suggest how could I achieve the same? Thanks in advance, DivKis -- 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 -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- 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
Re: [android-developers] Changing the battery icon position
On Tue, May 11, 2010 at 1:59 AM, ankita.nhst ankita.kash...@nechclst.inwrote: But, now I just want battery status icon on my screen alongwith other components of my activity. Is that possible?? Nope. If you hide the status bar, the battery icon goes with it. If you want to show a battery status icon along with your own components, you'll have to add a custom icon and handle the battery level changing events yourself. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- 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
Re: [android-developers] Problem installing your own developed app
On Tue, May 11, 2010 at 3:18 AM, nep0x nespap...@yahoo.es wrote: 2.- Which the difference between debug and run an app if the result is the same: install it on your device Debug allows you to step through your program in the debugger and stop at break points. Run just runs the app. Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES] Please help me because i have no idea what the meaning of this errors. Always try this first.http://lmgtfy.com/?q=INSTALL_PARSE_FAILED_NO_CERTIFICATES - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- 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] Power-loss semantics of SQlite on Android
Hello, I have an app that stores a database on SD card. If I don't use beginTransaction/endTransaction, does Android have any guarantee about the the contents of a database when power is lost? For example, if I have code like this: //db.beginTransaction(); //try { db.delete(TABLE_NAME, id=123, null); System.out.println(Deleted 123); db.delete(TABLE_NAME, id=456, null); System.out.println(Deleted 456); //db.setTransactionSuccessful(); //} finally { // db.endTransaction(); //} and the database is in SD card. When I randomly pull the SD card from the phone, is any of the following guaranteed to be true if I insert the SD card again and reload the database: (1) Order of deletion -- if id=456 has been deleted, then id=123 must have been deleted. (2) Immediacy of commit -- if I see the message Deleted 123 from logcat, then id=123 must have been deleted. (3) Non corruption -- rows that are unrelated to id=123 and id=456 are guaranteed to remain in the database regardless Note that I am not using transactions because I don't need the two rows to be atomically deleted. However, I do not want the user has any surprises -- if I tell them a row has been deleted, then this row should not appear again when the user re-inserts the SD card. Thanks! -- 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] Activity based Tabs
Hi All, I have Activity based tabs...i.e i have used TabActivity,tabhost etc Now when we switch between the tabs, for the 1st time the oncreate is called and then after the onResume methode is called I want to know what event/function, of the activity, is called when i click on the the tab which is already selected. -- 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] drawable-hdpi not appearing in eclipse emulator
Hi there, So I have this game running on Android 1.6, and I put the different density images in their respective folders res/drawable-hdpi/image.png res/drawable-mdpi/image.png res/drawable-ldpi/image.png I made each image a different color so I can tell if it is loading the right image. When I test my program on different density screens it only chooses the mdpi images. It scales them to match the correct dpi but doesn't choose the right folder. It just defaults to mdpi. In the manifest I have, android:normalScreens=true android:anyDensity=false Anyone have a similar problem? I'm sure it is something simple that I am overlooking but I can't figure it out. From what I read on the Android Support Multiple Screens guide is that you should just have to put the different density images in their correct folders and Android will do the rest. -- 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
Re: [android-developers] Sharing gps stuff between several activity
On Tue, May 11, 2010 at 4:06 AM, Federico Paolinelli fedep...@gmail.comwrote: I found myself using the same code for accessing to gps / cell location stuff from a couple of activities of my application. Yup, it happens. What I was wondering now is, which is the best way to avoid code duplication? Don't duplicate code? =P No, seriously, as soon as you find yourself copying and pasting - stop. You're doing something wrong. Take all that copy - pasted code and study it. Determine what it does, how it does, and what the variables are (if any). All the duplicated stuff should go in one central location. How that is structured will largely depend on your app and your coding style. Should I use a superclass for the activities which implements that kind of stuff? Use an helper class? Because of the way Android is structured, I find that helper classes make more sense then super classes. For example, you can't really have a base activity class that centralizes all common activity functionality, since some activities have to extend List-, ExpandableList-, or Map- activity, for example. You can however have a helper class that each Activity has as a member which they forward their common functionality to. How do you deal with this kind of problems? Create a helper class, sometimes static if it makes sense, that does the work you find yourself copying and pasting. For GPS, for example, I have a class that takes care of starting and stopping the GPS funtionality, keeps track of the current location, can return it in various forms (coordinates, named location, etc), notifies of location updates, and handles other related tasks. Each activity that requires it just instantiates it with the proper parameters (provider, criteria, frequency, etc), calls start and stop as necessary, and lets the class handle the rest. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- 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] Can not create service interface
Hi, For some reason I can not create an AIDL service interface, no matter how simple it is. I am using the latest version of eclipse. This is what I get, no matter what service functions I add to the aidl file: The method attachInterface(IInterface, String) in the type Binder is not applicable for the arguments (MyServiceInterface.Stub, String) MyServiceInterface.java The generated file MyServiceInterface.java, contains numerous errors. Among them is testapp.test.net cannot be resolved to a type. Very strange, since eclipse can do this for everything else. I have other projects in my workspace where I use AIDL successfully, but now I can not add this to any project. Very strange. If remove the aidl file, I can compile and run the app without any problem. Anyone that have any idea what is going on here? Anders -- 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] shouldOverrideUrlLoading not getting called for file:///android_asset links
I am using WebView to display web content in my app. Since I want to keep all content in my webview and not launch the browser, I override shouldOverrideUrlLoading and call loadUrl(). One of the pages has an image that is very large, so I want to put it in the assets directory. When the user clicks on a link that starts with http:// everything works fine. When they click on a link that starts with file:///android_asset, shouldOverrideUrlLoading never gets called so my app never calls loadUrl - hence nothing happens. Anyone know why this is? Thanks! -- 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] Emulator (AVD) voice recording
Hello guys, Does anybody have any idea about how to record voice on the emulator from development machine? Please help me out!!! I tried different ways but couldn't do it. Thank you 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: Sharing gps stuff between several activity
Create a helper class, sometimes static if it makes sense, that does the work you find yourself copying and pasting. For GPS, for example, I have a class that takes care of starting and stopping the GPS funtionality, keeps track of the current location, can return it in various forms (coordinates, named location, etc), notifies of location updates, and handles other related tasks. Each activity that requires it just instantiates it with the proper parameters (provider, criteria, frequency, etc), calls start and stop as necessary, and lets the class handle the rest. Which is what I did while waiting for an answer. I know that code duplication is bad, I just needed the best way to fix it. Since java does not support multiple inheritance, creating a superclass just for share the code doesn't feel so natural, which is the reason why I went for the helper class. Many thanks for the complete and detalied answer. Federico -- 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: Spurious calls to onPause?
For whatever it's worth, this continues to happen. It seems to happen faster and more frequently if I'm running in the debugger, but it happens fairly often under all circumstances. I've had to move all my onPause code to onStop, which is not optimal but it's the only thing that works. I'm running on Cupcake, and my impression is that Cupcake is simply not done - there are lots of things that just flat out don't work (e.g. this problem, RelativeLayout, route add, Thread.isInterrupted, etc). In many cases we've debugged into the system code and found the bugs that cause the problems. Can anyone comment on how true this is of more current builds? Thanks, Aaron On Apr 22, 11:08 am, asher as...@vanteon.com wrote: Thanks for responding. OK, this is weird. When I posted the issue originally, I believe I was running in a 1.6 emulator, and the behavior was 100% consistent. I've tested it a few times since then on my hardware (which is a custom device running 1.5), and it's been consistent. Today, I tried it in a 1.5 emulator, and it didn't happen at all, either in the actual application that originally exhibited the problem or in a test app. I tried it on my hardware, and it did happen, but then I got distracted for a few minutes, and when I tried it again it didn't. At this moment, I can't reproduce it at all under any circumstances. I'm confused. I've since moved all my cleanup code to onClose, which isn't ideal but it probably won't hurt anything on this specialized device. I'll keep an eye on this, and if it happens again I'll post an update. Thanks, Aaron On Apr 16, 7:16 pm, Michael Thomas enervat...@gmail.com wrote: Mark Murphy wrote: asher wrote: OK, I should have done this earlier. I created a new Android app in Eclipse, added an onPause override in the activity containing nothing but a single log message (and the super call), and ran it, and got exactly the same behavior. This seems to be either a bug in Android (I'm running 1.5), or I'm seriously misunderstanding something about the activity lifecycle. Can anyone help? If anyone's actually reading this, would you at least respond so I know I'm not shouting in the dark here? I cannot reproduce your problem on Android 1.5, Android 1.6, Android 2.0.1, or Android 2.1 (emulator) or on the DROID (2.1). Is it possible that the app is starting with the screen off? This can happen when you load an app from adb/eclipse. If you loaded the app in that situation, I'd sort of expect that you'd see the resume followed by pause behavior, but it's only a guess. Mike -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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: APKTool - decoding our apps
Proguard make it a bit harder to RE, but it'll still possible (and the APKtool gives you possibility to debug which is a really powerful RE tool), moreover you cannot use all of proguard optimization because you will not be able to convert classes to dex, in fact you can only use shrink and agressive overloading. Bottom line is: proguard lets you shrink you code about 30% but it'll not make your application hack / RE proof. -- Bart Janusz (Beepstreet) On May 11, 6:09 pm, pacoder sove...@gmail.com wrote: Has anyone tried using an obfuscator on their app before apk'ing it? Something likehttp://proguard.sourceforge.net/ I'm going to give it a try and then try to reverse engineer it to see if it helps. Don't like the idea of people reverse engineering our code either... On May 11, 12:00 pm, Nathan critter...@crittermap.com wrote: I don't know, but I find the summary of it interesting. . It is a tool for reengineering 3rd party, closed, binary Android apps. It is NOT intended for piracy and other non-legal uses. It could be used for localizing, adding some features or support for custom platforms and other GOOD purposes. Baloney. Reengineering itself is an illegal use. There is no GOOD purpose it should be used for. It is a piracy tool pure and simple. Nathan On May 11, 8:28 am, André pha...@hotmail.com wrote: Hello, I stumbled across this program on the web: http://code.google.com/p/android-apktool/ And realized that it works pretty well. I can decode the programs I've made from the apk files. I can't really say I like that. Does anyone know of a way create the apk file without having programs like this being able to decode and open them? -André -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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] How to fix hit area after scaling
I am scaling the canvas of a linear layout on draw, but this throws off all the hit areas of my views inside of this layout. They respond as if there was no scaling taking place. What do I have to do to get themselves to re-register their hit areas? Thanks Jonathan -- 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
Re: [android-developers] getting R.String Value using different class
On Tue, May 11, 2010 at 4:07 AM, Mookie charles.heath.ber...@gmail.comwrote: R.String.Hello does have a value if i look at it in my expressions window but if i use the getString Function, i end up with An exception occurred: java.lang.NullPointerException What's the full stack trace? - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- 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: Multiple Notifications - PendingIntents with different data?
On May 11, 11:33 am, skink psk...@gmail.com wrote: Nathan wrote: I've done it successfully by using setData(Uri) and making sure Intent.FILL_IN_DATA is set. I'm not sure why it won't see the intent as unique when it differs by Extra Data only, but at least this works. Nathan it's enough to use unique requestCode when calling getActivity Really? Ok, thanks, I'll try that. I hadn't tried because PendingIntent.GetActivity() says: requestCode Private request code for the sender (currently not used). Nathan -- 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
Re: [android-developers] Power-loss semantics of SQlite on Android
Android uses SQLite, so your questions are really about how SQLite behaves. On their web site, a relevant part might be: http://www.sqlite.org/faq.html#q19 On Tue, May 11, 2010 at 11:45 AM, Tomei Ningen tomei.nin...@yahoo.comwrote: Hello, I have an app that stores a database on SD card. If I don't use beginTransaction/endTransaction, does Android have any guarantee about the the contents of a database when power is lost? For example, if I have code like this: //db.beginTransaction(); //try { db.delete(TABLE_NAME, id=123, null); System.out.println(Deleted 123); db.delete(TABLE_NAME, id=456, null); System.out.println(Deleted 456); //db.setTransactionSuccessful(); //} finally { // db.endTransaction(); //} and the database is in SD card. When I randomly pull the SD card from the phone, is any of the following guaranteed to be true if I insert the SD card again and reload the database: (1) Order of deletion -- if id=456 has been deleted, then id=123 must have been deleted. (2) Immediacy of commit -- if I see the message Deleted 123 from logcat, then id=123 must have been deleted. (3) Non corruption -- rows that are unrelated to id=123 and id=456 are guaranteed to remain in the database regardless Note that I am not using transactions because I don't need the two rows to be atomically deleted. However, I do not want the user has any surprises -- if I tell them a row has been deleted, then this row should not appear again when the user re-inserts the SD card. Thanks! -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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
Re: [android-developers] drawable-hdpi not appearing in eclipse emulator
You told it you don't support densities with android:anyDensity=false. Thus it will run your app as if it is the original density, mdpi. In some cases the framework may be able to actually load the correct density resource and seamlessly use it while you still think you are running in mdpi... but not always, and really, if you are coding your app to support multiple densities, you shouldn't tell Android that you don't support densities. :) On Tue, May 11, 2010 at 12:01 PM, Cameron.M.Johnson cameron.m.john...@gmail.com wrote: Hi there, So I have this game running on Android 1.6, and I put the different density images in their respective folders res/drawable-hdpi/image.png res/drawable-mdpi/image.png res/drawable-ldpi/image.png I made each image a different color so I can tell if it is loading the right image. When I test my program on different density screens it only chooses the mdpi images. It scales them to match the correct dpi but doesn't choose the right folder. It just defaults to mdpi. In the manifest I have, android:normalScreens=true android:anyDensity=false Anyone have a similar problem? I'm sure it is something simple that I am overlooking but I can't figure it out. From what I read on the Android Support Multiple Screens guide is that you should just have to put the different density images in their correct folders and Android will do the rest. -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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
Re: [android-developers] Multi instance of app launch from status bar notification.
On Tue, May 11, 2010 at 4:18 AM, yangm yangm...@gmail.com wrote: It's seem like two my-app in window stack. *but my expect is one app instance.* Launching from home screen is different than launching from the status bar - different intents thus different instances of the activity. Look at and play around with the various launch mode flags, specifically singleTask. - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- 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: drawable-hdpi not appearing in eclipse emulator
This is from the Android Dev Guide http://developer.android.com/guide/ practices/screens_support.html Pre-scaling of resources (such as image assets) For example, if the current screen's density is high, the platform loads resources that are tagged with the qualifier hdpi and uses them without scaling. If no such resources are available, the platform uses the default resources instead, scaling them from the baseline density (medium) to high. This is what I based my question off of. Here it says as long as I have the hdpi qualifier, it will automatically choose images from that folder for a high density screen. Is this not correct or am I missing something? I could always hard code statements to check the current screens density and preload the PNG graphics that correspond to it. I am just curious if this actually works. The upscaling of the graphics work, but not the automatic qualifier choosing. Cam On May 11, 1:28 pm, Dianne Hackborn hack...@android.com wrote: You told it you don't support densities with android:anyDensity=false. Thus it will run your app as if it is the original density, mdpi. In some cases the framework may be able to actually load the correct density resource and seamlessly use it while you still think you are running in mdpi... but not always, and really, if you are coding your app to support multiple densities, you shouldn't tell Android that you don't support densities. :) On Tue, May 11, 2010 at 12:01 PM, Cameron.M.Johnson cameron.m.john...@gmail.com wrote: Hi there, So I have this game running on Android 1.6, and I put the different density images in their respective folders res/drawable-hdpi/image.png res/drawable-mdpi/image.png res/drawable-ldpi/image.png I made each image a different color so I can tell if it is loading the right image. When I test my program on different density screens it only chooses the mdpi images. It scales them to match the correct dpi but doesn't choose the right folder. It just defaults to mdpi. In the manifest I have, android:normalScreens=true android:anyDensity=false Anyone have a similar problem? I'm sure it is something simple that I am overlooking but I can't figure it out. From what I read on the Android Support Multiple Screens guide is that you should just have to put the different density images in their correct folders and Android will do the rest. -- 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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] Downloading Google Docs to Device
Hello Developers, I have been working with the gdata-client-library for the past few days and I am officially stumped on how to go about downloading .csv and .xls files. I've posted a question here @ S.O. http://stackoverflow.com/questions/2813470/downloading-spreadsheets-from-google-docs Thanks, ~Jeremy -- 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] Example to increment a var on a timer and print it out?
Seems like I need something like onTickListener, then I increment my variable and setText and invalidate. If you have a view, you can set onClickListener then performClick. Would that work? Thanks... I'm confused -- 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] External allocation too large for this process OutOfMemoryException
OK, so I've done some searching, seen others hit this problem but never really saw a solid resolution. I have a situation where I am loading large-ish images (~120KB jpg) from a remote webserver and displaying them to users in a gallery view. Now these images take a bit of time to download, so I would like to cache them. So I stick the bitmap in a hashmap of softreferences inside a static manager class. I know the usual culprit here is that the programmer is leaking memory. But this is the same approach (soft references, hashmap) that JBQ takes in his shelves app, and I really don't think I'm keeping any more references to the bitmap than the one soft reference. So I don't think leaking is the problem, although if someone who knows better insists that I probably made some mistake, I'll revisit this. And yes I know my images are too large, make them smaller, but really I want an image larger than the screen so users can zoom and pan around inside the image. If you want to tell me that's not a function Android can support, then I am at a loss for words. So my app gets an External allocation too large message on logcat. It only happens after I run the program for a long time. I see finalize() methods being called on my Image derivative objects, I also see many of the softreference entries going to null inside my hashmap, so I suspect that my cache is operating correctly, although I am not sure how timely the actual bitmaps are being GCed, but I see GC messages saying ~900KB freed, which I can't see coming from anywhere else in my app. So I have three main questions that I can't find the answer to in similar past threads: 1. I've seen recommendation on calling recycle() on bitmaps. But given the fact that I want to keep the bitmap in softreferencecache to keep the app responsive, I don't really know when the softreference goes invalid to call recycle. If the GC runs and clears the softreference that is the only remaining reference to the bitmap, is that as good as calling the recycle on the bitmap, or not necessarily? 2. Is there a way I can manually keep my memory usage down right before bitmap decoding is going to need to work? I see ways to see if the system is in low memory state. But I don't care about that, I need to know about my own dalvik process. How can I estimate whether I have the 1228800 bytes to decode the uncompressed image. Because I know every time I'm about to allocate the image, is there a recommended way to detect issues, and is there a way to force the GC to successfully clean up? I only display one image at a time, although it's possible that the BaseAdapter has more widgets created than just the one being displayed (but I don't suspect that it has that many views holding references to the bitmaps, it does recycle views after all). I see that one Dalvik VM API is deprecated and going internal. What's left for me to use? 3. LAST RESORT: If it's impossible to get Dalvik to stay at a low memory usage. Then I suppose I need to stop caching my bitmaps in a hashmap. In which case I'm going to write them to storage (yuck). I don't want to pollute their SD card, and I don't want them to see the app cache consuming some of their precious ~90MB of usable internal space. Is there an application lifecycle hook that I can hook into to clear up my file cache? I don't want to delete stuff as soon as an Activity goes into the background because they might go right back, I want to hook into when my entire application hasn't done anything in the while and Android low memory kills it. Then I have a minor question: 1. In JBQ's shelves application I see he switches between decoding with SKIA which he uses BitmapFactory.decodeStream and BitmapFactory.decodeByteArray, I didn't realize that one was different. Is SKIA bad? How should we as developers know this? Thanks in advance. -Eric -- 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: Accelerometer not working when screen turns off
Holy crap, this again?!? I just discovered this because we ordered four Nexus Ones to do some demos of our research on the Discovery Channel. All of a sudden what was working perfectly on the G1 stopped working altogether on the Nexus One. If you read the archives of this list, you'll see that I've harped about this a lot in the past, and was delighted when it was changed in Cupcake. Now they've gone and broke it again. And I just spent hundreds shipping these things to Canada. Argggh. So Google, are you going to remain silent on this issue again, or will you let us know at the very least why this decision was made. You've pissed off a lot of developers. Not to mention that your Nexus One phone won't be featured on the Discovery Channel bit that is being filmed tomorrow. Tough luck. Cheers, Jordan On Apr 26, 8:25 pm, mike enervat...@gmail.com wrote: I'll third that on wanting to know what's up. Some insight as to whether this is a hardware issue on some platforms would be pretty nice too... the same thing happens on the iPhone but getting any insight from them is impossible. Mike On 04/24/2010 09:14 AM, Jonathan wrote: Thanks Lance. I saw that... it is one of the highest ranked issues out there and the comments are being abused quite a bit, but there does not seem to be any response from Google about whether or not they plan to correct this going forward, or if they feel it is something that even needs to be corrected. I've been trying everything I can think of to find some kind of workaround, but so far have failed to do so. It would be great to get a response from one of the Google engineers on this and I think it would hopefully at least put the issue to rest, even if the response is that they do not plan to change this going forward. I hope that is not the answer, but at least we would know. The odd thing is that thesensorsappear to behave somewhat differently depending on the actual device. For example, there are different behaviors between the Droid and the Nexus One, despite the fact that they are both using Android 2.1. So possibly some of the issues are related to the variations in the hardwaresensors themselves, but that is just more speculation. Dianne, if you are out there, I think there are a lot of people that would like to get a response on this one. Thank you!! On Apr 24, 10:14 am, Lance Naneklna...@gmail.com wrote: http://code.google.com/p/android/issues/detail?id=3708 On Apr 13, 6:32 am, Jonathanjharrisweinb...@gmail.com wrote: As I understand it, there seems to have been a change in the OS that prevents the accelerometer from running when the screen turns off and the phone CPU goes into its power saving state. Can this be confirmed? I have gotten around this by using a wake lock, but this is a much less than ideal solution as it drains a lot of battery. If the accelerometer was disabled in low power mode to save the battery, it may very well have the opposite effect in many cases, such as mine. A partial wake lock seems to be required to keep it running, which is obviously much worse than if just the accelerometer were running without the need for the wake lock. Are there any other workarounds anyone knows of to getting accelerometer values while the phone is in low power mode? Also, are there any plans to change this in future versions of the OS? If there are no plans to change this, I would definitely like to petition for this to be changed. Thoughts? Ideas? Workarounds? 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 athttp://groups.google.com/group/android-developers?hl=en -- 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 athttp://groups.google.com/group/android-developers?hl=en -- 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] Upgrading 2009 I/O device from Donut (1.6) to Eclair (2.0/2.1)?
I have periodically attempted to search for information about this, but never really got to the bottom of it. Are there any instructions online for upgrading the 2009 I/O device from Donut (1.6) to Eclair (2.0/2.1)? I successfully updated from Cupcake (1.5) to Donut (1.6), but every time I have tried to find information on the next upgrade I have not seen anything online. What am I missing? For I/O 2010 you need Eclair to view the conference application from any Android device, which is a little frustrating All help appreciated. I have an inkling that this is a little like a if you can't figure it out yourself then you shouldn't be using it sort of setup... hopefully I am wrong about that. 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
Re: [android-developers] Debugg problem source not found
On Tue, May 11, 2010 at 8:33 AM, Mohammad Siddiqui siddiqui.m...@gmail.comwrote: what would be the problem? Um ... you don't have the source? - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- 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