[android-developers] Cached Background Bitmaps From Widgets?
So I was just reading a great overview of some of the IO happenings written by Mark Murphy and posted over at http://androidguys.com/?p=5342 and was very intrigued by something... here is the relevant text Next, Romain moved into images, particularly backgrounds for widgets. Backgrounds will always be fitted to the widget, and so Android may have to scale your bitmap to fit the widget – however, scaling at runtime is expensive. It is better, where possible to pre-scale the image and use the scaled one in your layouts, rather than having Android scale it on the fly. You can do this in Java code, via Bitmap#createScaledBitmap(), and setting the widget background from the cached scaled value. From my understanding this is basically saying you can figure out the end size of your widget by reading values cached bitmap object, but I have no idea where to get this object. When I started working with widgets I spent a lot of time trying to figure out the dimensions of the widget but figured it was a lost cause because my understanding was that RemoteView gets inflated after you ever get a chance to work with the specific dimensions... it seems this is still the case but a background bitmap is still cached somewhere? Where can I get a hold of that bitmap object? I tried writing a proof of concept sample for myself, basically th widget layout was a frame layout with a imageView set to fill parent for both width and height... I created a bitmap of a small size (40x40) and set the widgets image view to this bitmap via removoteView.setImageViewBitmap(), i then went back to update the widget 1 minute later and my bitmap object had not been scaled at all... Can anyone help me out with this? Romain maybe? I have a few ideas that require this ability so any help is appreciated --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Cached Background Bitmaps From Widgets?
Hi, A way to do this is to use the onSizeChanged() method. In that method, you know what the exact size of your view is. From there you can easily call Bitmap.createScaledBitmap() to scale your bitmap down. On Thu, May 28, 2009 at 11:00 PM, snctln catlin.s...@gmail.com wrote: So I was just reading a great overview of some of the IO happenings written by Mark Murphy and posted over at http://androidguys.com/?p=5342 and was very intrigued by something... here is the relevant text Next, Romain moved into images, particularly backgrounds for widgets. Backgrounds will always be fitted to the widget, and so Android may have to scale your bitmap to fit the widget – however, scaling at runtime is expensive. It is better, where possible to pre-scale the image and use the scaled one in your layouts, rather than having Android scale it on the fly. You can do this in Java code, via Bitmap#createScaledBitmap(), and setting the widget background from the cached scaled value. From my understanding this is basically saying you can figure out the end size of your widget by reading values cached bitmap object, but I have no idea where to get this object. When I started working with widgets I spent a lot of time trying to figure out the dimensions of the widget but figured it was a lost cause because my understanding was that RemoteView gets inflated after you ever get a chance to work with the specific dimensions... it seems this is still the case but a background bitmap is still cached somewhere? Where can I get a hold of that bitmap object? I tried writing a proof of concept sample for myself, basically th widget layout was a frame layout with a imageView set to fill parent for both width and height... I created a bitmap of a small size (40x40) and set the widgets image view to this bitmap via removoteView.setImageViewBitmap(), i then went back to update the widget 1 minute later and my bitmap object had not been scaled at all... Can anyone help me out with this? Romain maybe? I have a few ideas that require this ability so any help is appreciated -- 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 -~--~~~~--~~--~--~---
[android-developers] Re: Hide the virtual keyboard
Indeed, Sujay, thank you! This will disable (suppress) the soft keyboard: editText_input_field.setOnTouchListener(otl); private OnTouchListener otl = new OnTouchListener() { public boolean onTouch (View v, MotionEvent event) { return true; // the listener has consumed the event } }; On May 28, 10:23 pm, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Hi alex i think u could solve ur problem by using the onTouchListener rather since it returns a boolean stating whether u handled the event or not if u want to show the keyboard return false... else return true... i'm not very sure that this is wat u want... but u can give it a try --~--~-~--~~~---~--~~ 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] Authorization Idea
Hello all, I would like to apply authorization on my Android application. Once the user logs in I would like to be able to hide or display the actions/activities according to user's role. For instance; If the user in standard role I do not want to let her to start some activities(also hide the activities). Whereas, if the user is in admin role I do want to let her to start some activities that she is authorized to. In addition to separate activity based authorization, I would like to apply UI changes on the same activity according to the user's role. For example; if the user in standard role, she cannot see Reports button on the activity, but if the user in admin role, she can see the Reports button. I can do this via attaching code inside the real code but I want to separate the concept of authorization from the real code. Is there any attribute for methods or activities in Android that let me define authorization on method and activity level. Any help/example would be appreciated, Regards, jojo --~--~-~--~~~---~--~~ 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: Cached Background Bitmaps From Widgets?
Romain, Thank you very much for the quick response I really appreciate it. This sounds like a very reasonable approach to this problem, but unfortunately I am still confused. I apologize in advance, because I am sure this is a simple concept that I am just not understanding at the moment... Before I go any further I figure I should explain my basic widget update procedure I do it all in a service at the recommendation of jsharkey to avoid ANR dialogs, my service runs somewhat like this - grab an instance of the appWidgetManager - get all of the appWidgetIds for my widget - start loop over these ids -- create a new RemoteView object from the widget Id and my xml Layout which is just a frameLayout and an ImageView -- set the imageView bitmap via RemoteViews.SetImageViewBitmap() -- update the widget via appWidgetManager.updateAppWidget - end loop So usually when I want to get ahold of a view I do a findViewById in an activity, but since I am doing this from a service I didn't think I had access to this method. Where do I access the actual ImageVIew being used so that I can get access to the onSizeChanged method? Or am I thinking about this all wrong? Thanks again for the quick response, I am looking forward to anything else you can help me with on this matter. ---snctln - end loop So I can use teh onSizeChanged() method to see when the bitmap gets scaled... I assume this is for the image View? On May 29, 1:06 am, Romain Guy romain...@google.com wrote: Hi, A way to do this is to use the onSizeChanged() method. In that method, you know what the exact size of your view is. From there you can easily call Bitmap.createScaledBitmap() to scale your bitmap down. On Thu, May 28, 2009 at 11:00 PM, snctln catlin.s...@gmail.com wrote: So I was just reading a great overview of some of the IO happenings written by Mark Murphy and posted over athttp://androidguys.com/?p=5342 and was very intrigued by something... here is the relevant text Next, Romain moved into images, particularly backgrounds for widgets. Backgrounds will always be fitted to the widget, and so Android may have to scale your bitmap to fit the widget – however, scaling at runtime is expensive. It is better, where possible to pre-scale the image and use the scaled one in your layouts, rather than having Android scale it on the fly. You can do this in Java code, via Bitmap#createScaledBitmap(), and setting the widget background from the cached scaled value. From my understanding this is basically saying you can figure out the end size of your widget by reading values cached bitmap object, but I have no idea where to get this object. When I started working with widgets I spent a lot of time trying to figure out the dimensions of the widget but figured it was a lost cause because my understanding was that RemoteView gets inflated after you ever get a chance to work with the specific dimensions... it seems this is still the case but a background bitmap is still cached somewhere? Where can I get a hold of that bitmap object? I tried writing a proof of concept sample for myself, basically th widget layout was a frame layout with a imageView set to fill parent for both width and height... I created a bitmap of a small size (40x40) and set the widgets image view to this bitmap via removoteView.setImageViewBitmap(), i then went back to update the widget 1 minute later and my bitmap object had not been scaled at all... Can anyone help me out with this? Romain maybe? I have a few ideas that require this ability so any help is appreciated -- 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 -~--~~~~--~~--~--~---
[android-developers] Re: Application.onPause()? Is there a hook like this?
... It's a static reference, ie global to the process. So as activities are started the ref points to the new activity. That said, I agree the right thing to do here isn't obvious. But it's also not obvious to me why you think it's bad to unregister the listener in your apps onDestroy. I am skeptical battery life would be that badly harmed? If GPS keeps running for no reason when the user is on the home screen, users will complain, and rightfully so. GPS is probably the largest battery sucker on Android. Anyway, I guess I'll just stick with my hack, it works well (although I hate that I have to call it in EVERY SINGLE activity the user could potentially exit the app from). Frankly, I already thought about putting together a library with support classes that take care of all those things. I more and more find myself writing boilerplate code for things that really should already be handled by Android... best example is long running operations support (threads spawning from a context), which is very difficult to get right on Android with all the lifecycle states your app can be in, but that's a different story. --~--~-~--~~~---~--~~ 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: howto: scroll a text view
k thanks again mark, not sure what was wrong the first time, guess I should stay away from the xml wizard seems to always cause problems for me On May 28, 11:43 pm, Mark Murphy mmur...@commonsware.com wrote: So are you saying this will actually work and did I possibly just have a typo somewhere? Yes. A ScrollView wrapping a TextView is perfectly normal. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] how to make a view drawable
i have a custom view on which i have drawn some lines(to represent a grid) i want to use it as a background to another view!!! --~--~-~--~~~---~--~~ 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: Sensor not being notified when in standby
It is possible but keeping the phone on to receive the events will seriously hurt battery life and should be avoided if at all possible. On May 28, 4:58 pm, Éderson M Ferreira ederso...@gmail.com wrote: Hi, I am listening events from accelerometer sensor and everything is going right. The problem occurs when phone gets in standby mode and I am not being notified by sensors anymore. Does Anyone know if it's possible to get sensor notifications, by implementing a listener, even if phone is in standby? Thanks, Éderson --~--~-~--~~~---~--~~ 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: video capture doesn't seem to work in 1.5
Activity just close at recorder.prepare(); dont see any exception On May 28, 5:30 pm, Marco Nelissen marc...@android.com wrote: What do you mean by no luck? Does something crash? Do you get an exception? Does it create the recording file? Is there any data in it? On Thu, May 28, 2009 at 9:25 AM, zeeshan genx...@gmail.com wrote: Hi dear, i am trying to capture video since a week but still no luck. can anybody help me to figure out what i am missing in the code below: final MediaRecorder recorder = new MediaRecorder(); ContentValues values = new ContentValues(3); values.put(MediaStore.MediaColumns.TITLE, Recorded video); values.put (MediaStore.MediaColumns.DATE_ADDED, System.currentTimeMillis()); // values.put (MediaStore.MediaColumns.MIME_TYPE, recorder.getMimeContentType()); Uri newUri = getContentResolver().insert (Media.EXTERNAL_CONTENT_URI, values); //String path = getContentResolver() getDataFilePath(newUri); //final String filePath=newUri.toString (); final String filePath=/sdcard/lion-seul.3gp; recorder.setAudioSource (MediaRecorder.AudioSource.MIC); recorder.setVideoSource (MediaRecorder.VideoSource.CAMERA); recorder.setOutputFormat (MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder (MediaRecorder.AudioEncoder.AMR_NB); //recorder.setVideoSize(176, 144); // QCIF //recorder.setOutputFormat (MediaRecorder.OutputFormat.MPEG_4); recorder.setVideoEncoder (MediaRecorder.VideoEncoder.MPEG_4_SP); recorder.setOutputFile(filePath); // CameraView.thisCameraView.setRequestedOrientation //(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); SurfaceHolder holder; videosurface.setVisibility(View.VISIBLE); holder = videosurface.getHolder(); recorder.setPreviewDisplay(holder.getSurface ()); try { recorder.prepare(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } recorder.start(); --~--~-~--~~~---~--~~ 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 log messages sent using SMS service?
Hi All, I am beginner to Android platform. I would like to know how to capture the SMS messages that i sent using SMS service. I have used my own editor instead of Messaging Composer. I am able to send the messages using the SMS service from my Editor but Some how i could not see the messages in Messaging application. *Here is the code snippet used:* *//---sending message using SMS service API --- private void sendSMS(String phoneNumber, String message) { PendingIntent pi = PendingIntent.getActivity(this, 0, new Intent(this, SMS.class), 0); SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage(phoneNumber, null, message, pi, null); }* Any help would be appreciated. Best Regards, Bindu --~--~-~--~~~---~--~~ 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] Error in running Google Map and Calendar in Android SDK1.5 Release
Hi All, I am trying to run Google Map and Calendar Application in SDK 1.5 release emulator but not able to do same These services work fine in* android-sdk-linux_x86-1.0_r1* So I tried several approaches like getting Calendar.apk and CalendarProvider.apk from this release and installing the same to emulator. But it does not work since it requires Google Authencation. Which is provided By Google LogIn Srvice in Dev Tools. But it does not work so I tried to install Development.apk from stable release. It has got dependencies of Google map That again requires Google log in So all in loop. So any have successfullly run Google map and Calender app on latest release Please let me know steps Thanks and Regards Arun --~--~-~--~~~---~--~~ 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 make a view drawable
in xml its android:background=@drawable/background or in the oncreate for your canvas call setBackgroundREsource (R.drawable.background); i think :) On May 29, 2:16 am, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: i have a custom view on which i have drawn some lines(to represent a grid) i want to use it as a background to another view!!! --~--~-~--~~~---~--~~ 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 transparency and OpenGL ES
Thank you both for the solution (images must be power of two dimensions) and the additional helpful information! Cheers! -Nate On May 28, 12:56 pm, Anton socialhac...@gmail.com wrote: The ball.png that you reference above is 30x30 pixels. As MrChaz said, you must use power of two sized bitmaps. Otherwise the texImage2D function will not accept your texture. It seems likely that that is what is going on here. Also, this works in the 16 bits per pixel modes as well. You don't need a separate alpha channel in your frame buffer to do alpha compositing, so a simple RGB454 frame buffer works, which is what you get if you use a SimpleEGLConfigChooser (false) to select your pixel format. 16bpp formats are twice as fast when it comes to rendering as 32bpp formats (if your fill rate limited, and if you're rendering a 2D game with sprites then you probably are). Another word of caution, PNG files are supposed to (if you follow the spec) have non-premultiplied alpha channels. But it seems that not many people actually follow the standard, and so you can find PNG files that do it either way. If your PNG files are in fact using non- premultiplied alpha then the glBlendFunction should be (GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA). If they use premultiplied alpha then it should be as MrChaz said (GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA). If you use the first and see dark halos around all of your sprites then you probably have premultiplied alpha PNGs. As a side note, premultiplied alpha is better for a number of reasons. It simplifies a number of compositing operations and treats all of the color and alpha channels in a uniform way. It also allows for super-luminous pixels. -Anton On May 27, 7:00 pm, Nate nathan.sw...@gmail.com wrote: I am rendering this PNG with no transparency just fine:http://n4te.com/temp/test.png However if I try to render this PNG (with transparency) with the exact same code, I just get a white box:http://n4te.com/temp/ball.png I am loading the PNG into a texture like this: Bitmap bitmap = BitmapFactory.decodeStream(input); int[] temp = new int[1]; gl.glGenTextures(1, temp, 0); textureID = temp[0]; gl.glBindTexture(GL10.GL_TEXTURE_2D, textureID); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST); // GL_LINEAR for quality. gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE); GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); bitmap.recycle(); I am using this blending: gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); How is it possible to render a PNG with transparency in OpenGL ES? Thanks! -Nate --~--~-~--~~~---~--~~ 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] throughput tools
Hi All, How I can measure USB/MMC throughput at Android Level? Is there any tool/executable available for measuring USB/MMC throughput. Regard, krish --~--~-~--~~~---~--~~ 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 i use 15MB space for my App?
Hi , i am wondering my application have too many images in assets which is about 15MB but there is only 14MB space available for android App. is there any way to increase this space? --~--~-~--~~~---~--~~ 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: video capture doesn't seem to work in 1.5
is anybody come across the same problem or anyone have a working video capture example. your help is appreciated waiting for the help On May 29, 9:17 am, zeeshan genx...@gmail.com wrote: Activity just close at recorder.prepare(); dont see any exception On May 28, 5:30 pm, Marco Nelissen marc...@android.com wrote: What do you mean by no luck? Does something crash? Do you get an exception? Does it create the recording file? Is there any data in it? On Thu, May 28, 2009 at 9:25 AM, zeeshan genx...@gmail.com wrote: Hi dear, i am trying to capture video since a week but still no luck. can anybody help me to figure out what i am missing in the code below: final MediaRecorder recorder = new MediaRecorder(); ContentValues values = new ContentValues(3); values.put(MediaStore.MediaColumns.TITLE, Recorded video); values.put (MediaStore.MediaColumns.DATE_ADDED, System.currentTimeMillis()); // values.put (MediaStore.MediaColumns.MIME_TYPE, recorder.getMimeContentType()); Uri newUri = getContentResolver().insert (Media.EXTERNAL_CONTENT_URI, values); //String path = getContentResolver() getDataFilePath(newUri); //final String filePath=newUri.toString (); final String filePath=/sdcard/lion-seul.3gp; recorder.setAudioSource (MediaRecorder.AudioSource.MIC); recorder.setVideoSource (MediaRecorder.VideoSource.CAMERA); recorder.setOutputFormat (MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder (MediaRecorder.AudioEncoder.AMR_NB); //recorder.setVideoSize(176, 144); // QCIF //recorder.setOutputFormat (MediaRecorder.OutputFormat.MPEG_4); recorder.setVideoEncoder (MediaRecorder.VideoEncoder.MPEG_4_SP); recorder.setOutputFile(filePath); // CameraView.thisCameraView.setRequestedOrientation //(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); SurfaceHolder holder; videosurface.setVisibility(View.VISIBLE); holder = videosurface.getHolder(); recorder.setPreviewDisplay(holder.getSurface ()); try { recorder.prepare(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } recorder.start(); --~--~-~--~~~---~--~~ 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: Adding intent filter in code
I thought, (1) only works for broadcast intents, not for activity intents? Does (2) work for activity intents? Peli On May 29, 4:25 am, Mark Murphy mmur...@commonsware.com wrote: My question is that is it possible to add an intent-filter in code, for example from a background service? I would like to be able to offer the user the ability to share via my activity only if some other conditions are met. You have two choices: 1. Use registerReceiver() in your Service. 2. Still register the receiver via the manifest, and use PackageManager to enable and disable it as needed. The former requires an always-running hunk of Android code, which sucks if you don't need it. And many thanks to whichever of the Google I/O sessions pointed out the enable/disable trick! -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Does the android 1.5 browser support navigator.geolocation?
Hi guys, Can anyone tell me whether the android browser in 1.5 supports the geolocation W3C standard? I tried loading some demo pages on the emulator and it doesn't seem to work. As I don't have an actual phone, i 'm curious whether it works. 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] How to know if we are in home screen
Hi, How to know if we are in home screen? For a USAT GCF case i need to know this. Is there a way to know this? Atleast can we get a reference to the top most activity in the activity stack maintained by andriod? This information will be very helpful. Thanks InAdvance Srinivas --~--~-~--~~~---~--~~ 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 transparency and OpenGL ES
I was wandering if you managed to load a RGBA texture without pre- multiplied alpha. I'm working with an assumption that every texture is alpha pre- multiplied, because I was unable to load a RGBA texture without pre- multiplication (on G1). I'd love to know if it's possible or not. Thanks, David On May 28, 9:56 pm, Anton socialhac...@gmail.com wrote: The ball.png that you reference above is 30x30 pixels. As MrChaz said, you must use power of two sized bitmaps. Otherwise the texImage2D function will not accept your texture. It seems likely that that is what is going on here. Also, this works in the 16 bits per pixel modes as well. You don't need a separate alpha channel in your frame buffer to do alpha compositing, so a simple RGB454 frame buffer works, which is what you get if you use a SimpleEGLConfigChooser (false) to select your pixel format. 16bpp formats are twice as fast when it comes to rendering as 32bpp formats (if your fill rate limited, and if you're rendering a 2D game with sprites then you probably are). Another word of caution, PNG files are supposed to (if you follow the spec) have non-premultiplied alpha channels. But it seems that not many people actually follow the standard, and so you can find PNG files that do it either way. If your PNG files are in fact using non- premultiplied alpha then the glBlendFunction should be (GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA). If they use premultiplied alpha then it should be as MrChaz said (GL10.GL_ONE, GL10.GL_ONE_MINUS_SRC_ALPHA). If you use the first and see dark halos around all of your sprites then you probably have premultiplied alpha PNGs. As a side note, premultiplied alpha is better for a number of reasons. It simplifies a number of compositing operations and treats all of the color and alpha channels in a uniform way. It also allows for super-luminous pixels. -Anton On May 27, 7:00 pm, Nate nathan.sw...@gmail.com wrote: I am rendering this PNG with no transparency just fine:http://n4te.com/temp/test.png However if I try to render this PNG (with transparency) with the exact same code, I just get a white box:http://n4te.com/temp/ball.png I am loading the PNG into a texture like this: Bitmap bitmap = BitmapFactory.decodeStream(input); int[] temp = new int[1]; gl.glGenTextures(1, temp, 0); textureID = temp[0]; gl.glBindTexture(GL10.GL_TEXTURE_2D, textureID); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST); // GL_LINEAR for quality. gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE); GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); bitmap.recycle(); I am using this blending: gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); How is it possible to render a PNG with transparency in OpenGL ES? Thanks! -Nate --~--~-~--~~~---~--~~ 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 create a simple list of names, with personal image for each row
Thank you Vincent, I've read the link you sent, and it was opening my mind. Now I've solved the problem inheriting from BaseAdapter. There are also some methods to ovverride, and the most important is getView for callback. Then I created a simple class that inherit from LynearLayout, to define the layout of each row. So I solved the problem. The trouble I have right now, is simpler in my opinion. I've decided to delegate the loading of data from network to a thread class, that is started in the main activity with thread.start() passing to it's constructor the inherited BaseAdapter class, making the thread able to modify the list itself. Before launching the new thread the activity starts a ProgressDialog with pd = ProgressDialog.show(...params...); when the thread ends, it requests the stop of the ProgressDialog sending a signal to an handler made for this aim in this way: handler.sendEmptyMessage(0). Now you will ask: where is the problem? Well, the problem is that when the thread ends nothing is displayed on the screen, but the data are there!! The strange thing is that when I use the Hierarchy Viewer, clicking on the Load View Hierarchy button, the screen render the list!!! Can someone help me?? Thank you guys! --~--~-~--~~~---~--~~ 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 put 15MB images in my App?
i think download option would be the better solution. i need to download in a bunch like 50 images on next click. i only have idea to take image and display with fowllowing approach: private static Bitmap getImageBitmap(String url) { Bitmap bm = null; try { URL aURL = new URL(url); URLConnection conn = aURL.openConnection(); conn.connect(); InputStream is = conn.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); bm = BitmapFactory.decodeStream(bis); bis.close(); is.close(); } catch (IOException e) { e.printStackTrace(); } return bm; } / this just load image from my url, may be in cache . can u please provide any solution to download my files from url and put them in my apk to use it later thanks for your time and help, waiting for the reply On May 21, 8:38 pm, Mike Hearn mh.in.engl...@gmail.com wrote: You can encrypt the files on the sdcard. Just be aware that using the sdcard carries with it some taxes, eg, you have to handle it being taken out whilst in use On May 21, 4:59 pm,zeeshangenx...@gmail.com wrote: Hi, i am afraid if Max space for android App is 14MB , how can i put 15MB images in my App. my application includes more than 500 PNG images which are confidentials and cann't be put on sd card. i need to put them in my assets. is it something that can not be achieved in android? --~--~-~--~~~---~--~~ 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 have onItemClickListener for setListAdapter(new EfficientAdapter(this));?
ohh thanks. this can do my job. @Override protected void onListItemClick(ListView l, View v, int position, long id) { } On May 28, 5:34 pm, Marco Nelissen marc...@android.com wrote: You don't set a separate OnItemClickListener for each position, you set one for the entire list, and in your click listener you will be told which position was selected. On Thu, May 28, 2009 at 9:05 AM, zeeshan genx...@gmail.com wrote: Hi, i need image and text on list view and i am using list 14 example in API demo. i can have image and text in listview but wondering how to implement onItemClickListener for each position anybody help plz --~--~-~--~~~---~--~~ 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 convert bitmap to byte array?
Hi, guys! I want to store pictures from the internet in my data base as byte arrays. I get the pictures as bitmaps, but can't find way to convert it to byte array. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Where do i put 45 MB Audio Files.
Perhaps you need to think hard about whether you actually need 45MB of audio files? What format are you using? What bitrate? Are these full songs? What does your application do? There are usually more efficient ways to do most everything. Sometimes it requires a totally new approach to the problem. On May 28, 11:51 pm, Freshman csato...@gmail.com wrote: Hi guys, I am new to android and i need to play list of audio files in my application. but iwhere can i put all the audio files as its large in size arround 45 MB ? and how can i access it ? any help/info regarding this greatly appreciated. many thaks, Freshman --~--~-~--~~~---~--~~ 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: Can't keep AlertDialog on screen when KeyEvent.KEYCODE_BACK is handled with 1.5 (??)
FYI, looks like setPositiveButton and setNegativeButton are gone, and now you have setButton, setButton2, and setButton3. On Fri, May 29, 2009 at 12:50 AM, Rob Franz rob.fr...@gmail.com wrote: Thanks Marco. Took out the super.onKeyDown and it does block... you're right. However, my complaint on the other thing - lack of setPositiveButton and setNegativeButton - still stands :-) If I do two calls to setButton, I only get the last button. Were the above two functions removed? Thanks again. Rob On Fri, May 29, 2009 at 12:45 AM, Marco Nelissen marc...@android.comwrote: It's not a bug. I'm guessing you were expecting AlertDialog.show() to block until the user makes the choice, but that's not how it works. It's easy to make this work though: simply don't call super.onKeyDown() when the user pressed the back button. That will keep the system from ending your activity. Then just call finish() when you do want to end the activity. On Thu, May 28, 2009 at 9:36 PM, Rob Franz rob.fr...@gmail.com wrote: Hi all, I've got something simple where I want to raise an AlertDialog after catching this keypress: @Override public boolean onKeyDown(int keyCode, KeyEvent event){ super.onKeyDown(keyCode, event); switch (keyCode){ case KeyEvent.KEYCODE_BACK: alertDialog= new AlertDialog.Builder(this).create(); alertDialog.setTitle(Option); alertDialog.setMessage(Perform?); alertDialog.setButton(Yes, new DialogInterface.OnClickListener () { public void onClick(DialogInterface dialog, int whichButton) { setResult(RESULT_OK); finish(); }}); alertDialog.setButton(No, new DialogInterface.OnClickListener () { public void onClick(DialogInterface dialog, int whichButton) { }}); alertDialog.show(); break; default: break; } return true; } The interesting thing here is that when you hit the back button, you *do* see the AlertDialog for a split second, but then you're back at the previous screen you were at. Almost as if the system is hellbent on sending the user back to the previous screen, regardless of what the developer has constructed around this event. Anyone else see this behavior? I'm using 1.5r2 here. Any help would be appreciated - I'm pretty sure I'm using this correctly and that this is a bug. Thanks Rob --~--~-~--~~~---~--~~ 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] Deleting buffer cache for IO throughput
Hi, We are writing an application to measure throughput speed of SD card on ARM-based Android target using Java APIs. When we execute the application twice for read operation, results are seen to be affected with buffer cache. For example, first read throughput is 275 KBps and second read throughput is 350KBps. Application is simple Java-based application, it is .jar app. It is not using the Application class and hence, not having AndroidManifest.xml present. (). Is there any way to clear the buffer cache after each run of the application ? Thanks and Regards, Vrukesh --~--~-~--~~~---~--~~ 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: TextView Highlight/Select Issue
Please, this is getting so frustrating now. I have tried setting the TextView highlight colour to transparent but that doesn't work. If I set the ListView selector to draw on top, it covers the ImageView I have on the row but the textView remains on top. If I apply a normal style to the TextView it doesn't highlight when tapped but as soon as I apply a selector drawable to it, it causes thos highlight on tap issue. This is my last plea for help ;) On May 29, 1:14 am, mscwd01 mscw...@gmail.com wrote: It seems the problem only occurs when the selector drawable is applied to the TextView. Can anyone explain why this would allow the TextView to be selected/highlighted when tapped? On May 28, 11:00 am,mscwd01mscw...@gmail.com wrote: Hey, I have a ListView where each row is a layout inflated from an xml file. Within each layout I have a TextView which is defined by the following: TextView style=@style/MenuItem android:paddingLeft=10sp android:textColor=@drawable/menu_item / The style attribute sets the font size and style, the textColor attribute is a selector drawable which changes the TextView font colour depending on whether it is currently selected or not. This is defined by the following: selector xmlns:android=http://schemas.android.com/apk/res/android; item android:state_selected=true android:color=#FF / item android:state_pressed=true android:color=#FF / item android:color=#00 / /selector However, when I use this selector drawable to set the font colour it results in a weird issue where the TextView gets highlighted when the row is tapped, or tapped and dragged. See this screenshot for a better idea: http://i39.tinypic.com/v4q90n.jpg Is there anyway I can disable the TextView so it cannot be highlighted when tapped? 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] An android application to display cursor position
Hi All, I am new in Android application programming. I need to develop an android application which simply displays the cursor position (co ordinates) very urgently. If any has some pointers in same wud be a great help to me Regards, Arun -- wish u all the best --~--~-~--~~~---~--~~ 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 put an AppWidget on lock screen?
The documentation hints that: ...the lock screen could also contain widgets, and it would have a different way of adding, removing and otherwise managing widgets. [1] Now that I have 1.5, I can see the lock screen changed to show the same background as the home screen. Is there a way to put AppWidgets on the lock screen in 1.5? [1] http://developer.android.com/reference/android/appwidget/package-descr.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Speech Recognition Grammar
Hi, can someone please tell me how to create a new Grammar for speech recognition..when i tried to do this , iam seeing the following error D/RecognizerEngine( 236): start new grammar E/Srec( 236): ESR_READ_ERROR: Problem loading syntax from image This is how iam trying to create a grammar.. mSrecGrammar = mSrec.new Grammar(SREC_DIR + /grammars/BTvoice.g2g); can someone please let me know where to configure this .g2g file? Regards, Bhargavi --~--~-~--~~~---~--~~ 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] NP API Plugin
Does any know how to install NP plugin into Android's browser? --~--~-~--~~~---~--~~ 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 know when map has zoomed?
Hi all, I was wondering is there any way of knowing when the zoom animation in map view has ended?? After each zoom I need to calculate how far my overlays are from each other, but I haven't figured out yet how to know when the map has been zoomed. Is there any way to do that?? -Mika --~--~-~--~~~---~--~~ 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: An android application to display cursor position
Which cursor? Do you mean the position of the user's finger when it's on the screen? On May 29, 9:03 am, arun choudhary achoudhary2...@gmail.com wrote: Hi All, I am new in Android application programming. I need to develop an android application which simply displays the cursor position (co ordinates) very urgently. If any has some pointers in same wud be a great help to me Regards, Arun -- wish u all the best --~--~-~--~~~---~--~~ 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: What's the best way to handle an task w/progress dialog on orientation change?
So, how do I keep the service alive between orientations but shut it down when the user has totally exited the app? I use this 'trick' to figure out if an onDestroy is really a destroy or just a configuration change by the user (e.g. closing keyboard): Use onRetainNonConfigurationInstance() and getLastNonConfigurationInstance(). ... boolean mDoDestroy = true; ... public Object onRetainNonConfigurationInstance() { mDoDestroy = false; return someObject; } protected void onDestroy() { if (mDoDestroy) { // shut down your services or something that is necessary // after your app is actuall destroyed. Clean up everything. } else { // A configuration-change happened.. e.g. the user // just opened or closed the keyboard. Don't destroy/cleanup // everything. Keep things around that are necessary for the next // instance of this activity. } } On May 28, 11:53 pm, Robert Green rbgrn@gmail.com wrote: I just tested using only bindService and now it's not doing what I need it to do. The requirement is to have the service stay running between orientation changes. Now it stops when the first activity unbinds and starts new when the new activity binds, losing the current work (which is a form submission), so now the server has processed something but the client isn't going to get a response. That doesn't work for me. Just in case you guys are wondering, my use case is this (and EVERYONE that I've seen use the app tries this) 1) User flips open keyboard to fill out text fields 2) User clicks on submit button 3) App contacts server, starts processing, shows progress dialog 4) User flips phone shut 5) App reorients 6) App shows user the result of the operation. So, how do I keep the service alive between orientations but shut it down when the user has totally exited the app? I just came up with a way. What do you think about this? I have a shut down on a timer if my service isn't doing anything. I just tested it and it works perfectly. It also ensures that the service stops in a timely fashion. I know only about 2-3 seconds are needed for even the worst orientation changes but I just wanted to be safe. I have my activities calling startService and bindService onResume and calling unbindService onPause. The whole thing works well, is seamless to the user, seems really sound and plays nice with the OS by shutting down when no longer in use. private void startShutdownThread() { Log.d(TAG, Starting shutdown thread); shutDownThread = new Thread() { @Override public void run() { while (shuttingDown shutDownCount 0) { //Log.d(TAG, Shutting down in + shutDownCount); try { Thread.sleep(1000); } catch (InterruptedException e) { } shutDownCount--; } // if the shut down hasn't been interrupted, then shut 'er down. if (shuttingDown) { shuttingDown = false; stopSelf(); } else { Log.d(TAG, Shutdown thread exiting...); } } }; shutDownThread.start(); } public IBinder onBind(Intent intent) { Log.d(TAG, onBind()); bindCount++; // if the shutDownThread is running, stop it. if (shuttingDown) { Log.d(TAG, Shutdown thread stopped); shuttingDown = false; shutDownThread = null; } return mBinder; } @Override public void onRebind(Intent intent) { Log.d(TAG, onRebind()); bindCount++; // if the shutDownThread is running, stop it. if (shuttingDown) { Log.d(TAG, Shutdown thread stopped); shuttingDown = false; shutDownThread = null; } } @Override public boolean onUnbind(Intent intent) { Log.d(TAG, onUnbind()); bindCount--; if (bindCount == 0) { // if no one is bound, start the countdown shutDownCount = 30; shuttingDown = true; startShutdownThread(); } return
[android-developers] Re: What's the best way to handle an task w/progress dialog on orientation change?
This code seems to rely on the fact that your background thread does not die immediately. If your service is rebound within 30 * 1000 milliseconds, then it all works well. - This is an unlikely scenario, but what if the re-bind happens more than 30 seconds later? - What if the service is stopped entirely and - when your activity (re) binds - a brand new instance of your service is started? Not very likely scenario either, but i'm not sure that it could never happen. Why, instead, don't you keep your service alive by calling startService ()? This makes sure that any subsequent 'unbind' does not stop and destroy your service. On May 28, 11:53 pm, Robert Green rbgrn@gmail.com wrote: I just tested using only bindService and now it's not doing what I need it to do. The requirement is to have the service stay running between orientation changes. Now it stops when the first activity unbinds and starts new when the new activity binds, losing the current work (which is a form submission), so now the server has processed something but the client isn't going to get a response. That doesn't work for me. Just in case you guys are wondering, my use case is this (and EVERYONE that I've seen use the app tries this) 1) User flips open keyboard to fill out text fields 2) User clicks on submit button 3) App contacts server, starts processing, shows progress dialog 4) User flips phone shut 5) App reorients 6) App shows user the result of the operation. So, how do I keep the service alive between orientations but shut it down when the user has totally exited the app? I just came up with a way. What do you think about this? I have a shut down on a timer if my service isn't doing anything. I just tested it and it works perfectly. It also ensures that the service stops in a timely fashion. I know only about 2-3 seconds are needed for even the worst orientation changes but I just wanted to be safe. I have my activities calling startService and bindService onResume and calling unbindService onPause. The whole thing works well, is seamless to the user, seems really sound and plays nice with the OS by shutting down when no longer in use. private void startShutdownThread() { Log.d(TAG, Starting shutdown thread); shutDownThread = new Thread() { @Override public void run() { while (shuttingDown shutDownCount 0) { //Log.d(TAG, Shutting down in + shutDownCount); try { Thread.sleep(1000); } catch (InterruptedException e) { } shutDownCount--; } // if the shut down hasn't been interrupted, then shut 'er down. if (shuttingDown) { shuttingDown = false; stopSelf(); } else { Log.d(TAG, Shutdown thread exiting...); } } }; shutDownThread.start(); } public IBinder onBind(Intent intent) { Log.d(TAG, onBind()); bindCount++; // if the shutDownThread is running, stop it. if (shuttingDown) { Log.d(TAG, Shutdown thread stopped); shuttingDown = false; shutDownThread = null; } return mBinder; } @Override public void onRebind(Intent intent) { Log.d(TAG, onRebind()); bindCount++; // if the shutDownThread is running, stop it. if (shuttingDown) { Log.d(TAG, Shutdown thread stopped); shuttingDown = false; shutDownThread = null; } } @Override public boolean onUnbind(Intent intent) { Log.d(TAG, onUnbind()); bindCount--; if (bindCount == 0) { // if no one is bound, start the countdown shutDownCount = 30; shuttingDown = true; startShutdownThread(); } return true; } Done! Man I'm happy to have that working. I've been retrofitting all the netcode with this service for the past 20 hours of coding and I can't wait to not be working on this anymore! On May 28, 9:58 pm, Robert Green
[android-developers] Re: What's the best way to handle an task w/progress dialog on orientation change?
Done! Man I'm happy to have that working. I've been retrofitting all the netcode with this service for the past 20 hours of coding and I can't wait to not be working on this anymore! Well, I did show you a simpler way to do it. I'm not sure you should write a tutorial on this - like I said, it's a lot more complicated than is necessary. You only need a service if you want to run in the background when your activities aren't on-screen, which it sounds like isn't warranted here. --~--~-~--~~~---~--~~ 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 convert bitmap to byte array?
Hi, Use Bitmap.compress() and store the bitmap in PNG. That's what the Home screen does. On Fri, May 29, 2009 at 5:08 AM, Mike Lanin mike.la...@gmail.com wrote: Hi, guys! I want to store pictures from the internet in my data base as byte arrays. I get the pictures as bitmaps, but can't find way to convert it to byte array. Thanks in advance. -- 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 -~--~~~~--~~--~--~---
[android-developers] Re: Remove screen lock like the MENU key do?
Walter androidremotecont...@gmail.com wrote: I've been looking for this, as my research, no way to do it for now. - 显示引用的文字 - Thanks for Walter ! I have been looking into the source code,and did'nt find there has a way to do this too! Maybe it is true that we can't remove the lock in our application as now as we know. --~--~-~--~~~---~--~~ 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] Parsing Dates in other Locales
I need to parse a date using a flexible date format (like MM/dd/ or dd-MMM), and so far I've always used SimpleDateFormat for that (since unfortunately, android.text.format.Time.parse doesn't support date format strings). This works fine in an US environment, but as soon as I switch to any other locale, MMM translates into the number of the month (i.e. it's 6 instead of Jun). This seems like a problem that's new to Cupcake, although I'm not sure. Is there any way to parse date strings in another locale other than writing my own parser? android.text.format.DateFormat.format is great for converting from date to string, but I can't find anything going the other way around. -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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Hide the virtual keyboard
Actually, there's still a problem. I only want suppress the soft keyboard from showing up -- because I have a custom on-screen keypad. Consuming the touch event suppresses the soft keyboard, but it also holds the focus on the text field, making it impossible to touch another text field. I have two text fields, and I want to suppress the keyboard on both, but of course both fields must still be touchable. Any idea how to suppress the soft keyboard, but not have the above mentioned negative side effect? On May 28, 11:19 pm, Alex B alexba...@gmail.com wrote: Indeed, Sujay, thank you! This will disable (suppress) the softkeyboard: editText_input_field.setOnTouchListener(otl); private OnTouchListener otl = new OnTouchListener() { public boolean onTouch (View v, MotionEvent event) { return true; // the listener has consumed the event } }; --~--~-~--~~~---~--~~ 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] embedding photo in body of email
Can we embed a photo in the body of the email Is there a way to embed a photo in the body of the email if yes then how?? Please help me someone. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Android UI guidelines again
Hello All, I know there were a lot of topics like this created earlier, but most of them haven't got any response. I'd like to raise this topic once again and probably ask more concrete questions. I need to create several forms which allow users entering data. Form allows entering text (EditText), numbers (EditText with appropriate input method), boolean fields (CheckBox), choose some options from a list (Spinner) etc. From my previous UI development experience I learned that users expect similar behaviour/loo'n'feel in similar situations. I tried to figure out form designing guidelines looking at built-in Android applications. There were two applications which have forms: Contacts and Calendar. Unfortunately I was unable to define any rules which are common for both applications. From the layout point of view, Contacts uses ListView-like form which looks like a settings form, whereas Calendar uses traditional form with labels and input controls. Choice of an option from a list is implemented differently: - Contacts - Ringtone field - is implemented as a ListPreference widget; - Calendar - Repetition field - is implemented as a TextView (label) + Spinner. Boolean field entry is implemented differently: - Contacts - Incoming calls field - implemented as a CheckBoxPreference; - Calendar - All day flag - implemented as a TextView (label) + CheckBox. So my question is what approach should I use when designing forms for data entry application? Should my forms look like an Event form or like a Contact form? It would be great if somebody from Android team read this message. I see that Android UI evolves, so probably you can give us (developers) some hint about further (planned) UI modifications which help us to design consistent UI. 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: What's the best way to handle an task w/progress dialog on orientation change?
On May 28, 4:40 pm, Streets Of Boston flyingdutc...@gmail.com wrote: Is it safe to cache a Handler (in a static variable)? It should be OK, from my reading of the code. It keeps a reference to the current threads looper, but that should exist for as long as the process does anyway. I *think* you'd code it up like this, although I haven't actually done it :) public class MyActivity extends Activity implements Handler.Callback { static Object sHandlerLock = new Object(); static Handler sHandler; public void handleMessage(Message msg) { } public void onCreate() { synchronized (MyActivity.sHandlerLock) { sHandler = new Handler(this); } } public void onDestroy() { // Could be onStop as well I think synchronized (MyActivity.sHandlerLock) { sHandler = null; } if (isFinishing) myThread.interrupt(); // tell the worker thread to shut down. } } then in your thread: public void run() { // ... do some work synchronized (MyActivity.sHandlerLock) { if (MyActivity.sHandler != null) MyActivity.sHandler.sendMessage (whatever); } } You have to lock because otherwise you could test sHandler against null to see if the activity is still around to receive your status update, find it's set, then the main thread destroys the activity resulting in your worker thread crashing when it tries to send a message to the main thread. Note the call to interrupt() in onDestroy. You don't want your worker thread to hang around doing stuff when the user is actually done with your app. I'm not 100% sure this is correct though - the javadoc for isFinishing() is kinda vague. Eg I don't know if using the home button counts as finishing an activity or just task switching away. --~--~-~--~~~---~--~~ 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: What's the best way to handle an task w/progress dialog on orientation change?
Mike: I DO need it to run in the background, that is, while orientation is changing. The service is also really nice because I can do things like submit a score in the background while the user is going from the game back to the game menu. I don't like the static handler idea because it can't have more advanced capabilities like the queue my service has. Basically my service guarantees that the network request will finish and the response will be available to the next registered callback handler. I really like that. I know it's more complicated but my app feels really nice and polished now. Streets of Boston: Each bind is prefaced with a startService. This ensures that the service will be running and will continue to run after the unbind. The service is smart and shuts itself down so this approach works perfectly for me. If a rebind happens 30 seconds later, the service will just start back up in persistent-run-mode like always because startService will have been called. Since the really important stuff always happens within a few seconds of an unbind, the restarting later doesn't matter at all. Also, it will never restart while a user is in an activity because the activity binds onResume and unbinds onPause, so it remains bound the entire time it is visible. I think the way I did it is responsible because the service is always available when needed but doesn't stick around more than 30 seconds longer than the user was last in the app. I'm sure there are other ways but this is coded, well-tested and on the market so I'm not changing it anytime soon :) On May 29, 10:43 am, Mike Hearn mh.in.engl...@gmail.com wrote: Done! Man I'm happy to have that working. I've been retrofitting all the netcode with this service for the past 20 hours of coding and I can't wait to not be working on this anymore! Well, I did show you a simpler way to do it. I'm not sure you should write a tutorial on this - like I said, it's a lot more complicated than is necessary. You only need a service if you want to run in the background when your activities aren't on-screen, which it sounds like isn't warranted here. --~--~-~--~~~---~--~~ 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: G1 ManageApplications - the size of the application data does not change when ...
I've added a call to the vacuum command but after I delete all of the data from the database, the G1's Manage Applications screen still shows 2MB of data for our app. Here's a snippet of my code that calls vacuum: if (!dbInstance.inTransaction()) { dbInstance.execSQL(vacuum); // compact the db TLog.log(SQLRS vacuum db cnt tables dropped + Integer.toString(cntDropped)); } else { TLog.log(SQLRS cannot vacuum db it's in transaction, cnt tables dropped + Integer.toString(cntDropped)); } Is anyone else having problems with this? Thanks, Jade On May 28, 6:13 pm, jade j...@edufone.com wrote: Marco, Thanks for the quick reply! Here's the link to the vacuum command in case anyone else needs it:http://sqlite.org/lang_vacuum.html Jade On May 28, 3:57 pm, Marco Nelissen marc...@android.com wrote: IIRC sqlite databases aren't automatically compacted when things are deleted from them. You need to use the 'vacuum' command to do that. On Thu, May 28, 2009 at 2:44 PM, jade j...@edufone.com wrote: When we delete items from our sqlite database in our Android app, the size of the data under our application (under the G1's settings - Applications - Manage applications) doesn't change. It changes when we add data but not when we delete it. We have a debugging mode where we query the sqlite database and from that data I can tell that the records have been deleted. Is anyone else having this problem? I've also looked at this post: http://groups.google.com/group/android-developers/browse_thread/threa... we only have 18 unlinked records so I don't think this is the problem. Jade --~--~-~--~~~---~--~~ 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] Toast without light up
Hi If I am running a service, and I want to sent a toast, the phone lights up. Is there a way to show the Toast without turning on the light? Thanks Daniel --~--~-~--~~~---~--~~ 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 UI guidelines again
Minor add-on about buttons: Contacts application has: Done/Revert buttons. Calendar application has: Save/Discard changes buttons. Besides there is another difference when user edits existing item (not creating new one): Contacts application: you can delete a contact using view contact screen or using context menu in the contact list; Calendar application: you can delete an event using view event options menu, day view context menu and (!) using delete button in the edit event form. On May 29, 7:05 pm, Andriy Zakharchuk andriy.zakharc...@gmail.com wrote: Hello All, I know there were a lot of topics like this created earlier, but most of them haven't got any response. I'd like to raise this topic once again and probably ask more concrete questions. I need to create several forms which allow users entering data. Form allows entering text (EditText), numbers (EditText with appropriate input method), boolean fields (CheckBox), choose some options from a list (Spinner) etc. From my previous UI development experience I learned that users expect similar behaviour/loo'n'feel in similar situations. I tried to figure out form designing guidelines looking at built-in Android applications. There were two applications which have forms: Contacts and Calendar. Unfortunately I was unable to define any rules which are common for both applications. From the layout point of view, Contacts uses ListView-like form which looks like a settings form, whereas Calendar uses traditional form with labels and input controls. Choice of an option from a list is implemented differently: - Contacts - Ringtone field - is implemented as a ListPreference widget; - Calendar - Repetition field - is implemented as a TextView (label) + Spinner. Boolean field entry is implemented differently: - Contacts - Incoming calls field - implemented as a CheckBoxPreference; - Calendar - All day flag - implemented as a TextView (label) + CheckBox. So my question is what approach should I use when designing forms for data entry application? Should my forms look like an Event form or like a Contact form? It would be great if somebody from Android team read this message. I see that Android UI evolves, so probably you can give us (developers) some hint about further (planned) UI modifications which help us to design consistent UI. 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] Android FancyGestureDetector
Android port of fantastic Fancy Gestures http://bakhtiyor.com/2009/05/fancy-gesture-detector/ --~--~-~--~~~---~--~~ 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 add a keyboard setting screen
Hello, The Android keyboard has a Android Keyboard Settings screen in the Settings-LocaleText menu. I am developing an input method, using the Sample keyboard program as a starting point. How can I add a Setting screen for my keyboard, in the Settings-LocaleText menu, similar to the Android keyboard ? Thanks Nitin --~--~-~--~~~---~--~~ 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: Toast without light up
Is there a way to show the Toast without turning on the light? I don't know, but that has to be my all-time favorite question here. --~--~-~--~~~---~--~~ 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 UI guidelines again
What they've said in the past on IRC is that they don't have guidelines so much as they have actual designers walking over and saying that sucks. (Which explains the inconsistencies as well.) On Fri, May 29, 2009 at 12:49 PM, Andriy Zakharchuk andriy.zakharc...@gmail.com wrote: Minor add-on about buttons: Contacts application has: Done/Revert buttons. Calendar application has: Save/Discard changes buttons. Besides there is another difference when user edits existing item (not creating new one): Contacts application: you can delete a contact using view contact screen or using context menu in the contact list; Calendar application: you can delete an event using view event options menu, day view context menu and (!) using delete button in the edit event form. On May 29, 7:05 pm, Andriy Zakharchuk andriy.zakharc...@gmail.com wrote: Hello All, I know there were a lot of topics like this created earlier, but most of them haven't got any response. I'd like to raise this topic once again and probably ask more concrete questions. I need to create several forms which allow users entering data. Form allows entering text (EditText), numbers (EditText with appropriate input method), boolean fields (CheckBox), choose some options from a list (Spinner) etc. From my previous UI development experience I learned that users expect similar behaviour/loo'n'feel in similar situations. I tried to figure out form designing guidelines looking at built-in Android applications. There were two applications which have forms: Contacts and Calendar. Unfortunately I was unable to define any rules which are common for both applications. From the layout point of view, Contacts uses ListView-like form which looks like a settings form, whereas Calendar uses traditional form with labels and input controls. Choice of an option from a list is implemented differently: - Contacts - Ringtone field - is implemented as a ListPreference widget; - Calendar - Repetition field - is implemented as a TextView (label) + Spinner. Boolean field entry is implemented differently: - Contacts - Incoming calls field - implemented as a CheckBoxPreference; - Calendar - All day flag - implemented as a TextView (label) + CheckBox. So my question is what approach should I use when designing forms for data entry application? Should my forms look like an Event form or like a Contact form? It would be great if somebody from Android team read this message. I see that Android UI evolves, so probably you can give us (developers) some hint about further (planned) UI modifications which help us to design consistent UI. 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: Android UI guidelines again
Follow what Contacts does :) On Fri, May 29, 2009 at 9:05 AM, Andriy Zakharchuk andriy.zakharc...@gmail.com wrote: Hello All, I know there were a lot of topics like this created earlier, but most of them haven't got any response. I'd like to raise this topic once again and probably ask more concrete questions. I need to create several forms which allow users entering data. Form allows entering text (EditText), numbers (EditText with appropriate input method), boolean fields (CheckBox), choose some options from a list (Spinner) etc. From my previous UI development experience I learned that users expect similar behaviour/loo'n'feel in similar situations. I tried to figure out form designing guidelines looking at built-in Android applications. There were two applications which have forms: Contacts and Calendar. Unfortunately I was unable to define any rules which are common for both applications. From the layout point of view, Contacts uses ListView-like form which looks like a settings form, whereas Calendar uses traditional form with labels and input controls. Choice of an option from a list is implemented differently: - Contacts - Ringtone field - is implemented as a ListPreference widget; - Calendar - Repetition field - is implemented as a TextView (label) + Spinner. Boolean field entry is implemented differently: - Contacts - Incoming calls field - implemented as a CheckBoxPreference; - Calendar - All day flag - implemented as a TextView (label) + CheckBox. So my question is what approach should I use when designing forms for data entry application? Should my forms look like an Event form or like a Contact form? It would be great if somebody from Android team read this message. I see that Android UI evolves, so probably you can give us (developers) some hint about further (planned) UI modifications which help us to design consistent UI. Thank you in advance. -- 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 -~--~~~~--~~--~--~---
[android-developers] Re: What's the best way to handle an task w/progress dialog on orientation change?
I DO need it to run in the background, that is, while orientation is changing. That's not in the background - the activity manager will keep your process alive during configuration changes anyway, regardless of whether you have a service or not. The only reason to use a service is if you need your process to live on when the activities are not on screen. I don't like the static handler idea because it can't have more advanced capabilities like the queue my service has. Sorry, I don't understand this. You can pass any objects you like through a handler and handlers use the threads message queue anyway. So I don't see why you can't have a queue using a handler. --~--~-~--~~~---~--~~ 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: 1.5: Phone no longer stays awake when Stay Awake is enabled under Development settings
It's very strange, but now it looks like I don't have that problem anymore. I'm sitting here looking at the phone (which is connected to my computer) and it has not gone into screen lock - i can still see what's on the screen. Only difference is I updated to 1.5r2, but I would imagine resolving our previous issue would take a change to the phone's build? I'm confused. -R On Thu, May 28, 2009 at 12:05 PM, Keith Wiley kbwi...@gmail.com wrote: Yep. I have the same problem. I haven't officially reported it because I did a manual install from (presumably) the same file you are using instead of waiting for the official OTA. However, it seems highly unlikely that this problem will be fixed in the next week or so, so I'm sure all developers will be suffering with this until a fix is pushed out. Behavior is: screen dims quickly followed by phone going to sleep after the set time period (1 minute) against my wishes. When it is awakened, I must reenter my pattern code to regain access EVERY TIME (extremely tedious). In addition, for obvious OS-related reasons, the activity is reinitialized each time this occurs, which breaks a debugging session, forcing me to restart the session. I haven't installed SDK 1.5 r_2 yet (I'm still on r_1), but I don't see how it could possibly impact on this. Can anyone verify this problem with SDK 1.5 r_2? I assume most other developers are also having this problem. Can anyone else verify? Cheers! On May 28, 5:42 am, Rob Franz rob.fr...@gmail.com wrote: Has anyone else noticed this? It's slightly annoying. I downloaded my version of 1.5 from https://android.clients.google.com/updates/partner/signed-kila-ota-14... Thanks Rob --~--~-~--~~~---~--~~ 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: implementation of onDestroy for a service containing a worker or backround thread
Can some one please respond? Appreciate 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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: NP API Plugin
Migol wrote: Does any know how to install NP plugin into Android's browser? You can't install any plugins to Browser, except by modifying the device firmware. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 0.95 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Adding intent filter in code
Peli wrote: I thought, (1) only works for broadcast intents, not for activity intents? Does (2) work for activity intents? Both are for broadcast intents, but I was totally baffled by the ability to share via my activity statement, so I elected to provide a broader answer. Besides, I was kinda sleepy when I wrote that reply... :-( If the question really is how to add new intent filters for an *activity* on the fly, I have no idea off the top of my head how you'd pull that off. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 0.95 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: implementation of onDestroy for a service containing a worker or backround thread
onDestroy() can still be called. If an activity calls stopService(...), the service's onDestroy may be called. On May 28, 12:24 pm, Gautam gautam_raychaudh...@hotmail.com wrote: Thanks... The plan is to start the service once (startService()) and never call stopService. I want my service to be running always (will set service.forground() = true). When any activity wants to use the service it would get the service via bind and invoke methods on the service. Also, by looking at the documentation, it seems that the platforfm does not provide power down broadcast intents. So, onDestroy() on the service would never be called or used. Is it a right assumption? --~--~-~--~~~---~--~~ 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: Why the Android docs are inconsistent?
OK i ll do that On May 28, 9:55 am, Hamy hamilt...@gmail.com wrote: Agreed. Please file doc bugs for the benefit of is all. Hamy On May 27, 11:12 pm, Raphael r...@android.com wrote: Please file doc bugs athttp://b.android.com--the API probably evolved before 1.0 without the javadoc being updated. R/ On Wed, May 27, 2009 at 6:51 PM,havexzbali.param...@gmail.com wrote: I have looking for something and found these inconsistencies in the online documentation This is a snippet from FAQ section http://developer.android.com/guide/appendix/faq/commontasks.html#broa... NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); nm.notifyWithText(R.id.alarm, Alarm!!!, NotificationManager.LENGTH_SHORT, null); Now when I try to find the 'notifyWithText' api, I could not find it. Another example is IntentReciever. I just want to know is this class exists? As I found code in this forum itself using IntentReciever, but I cant find this class in the doc. And why standard intents like action android:name=android.provider.Telephony.SMS_RECEIVED are not documented?- 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] ADC2 announced
http://code.google.com/android/adc/ - 'open only to applications that have not been published'. Thanks for screwing devs. --~--~-~--~~~---~--~~ 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 UI guidelines again
Do you mean that in Donut we'll see Calendar application rewritten and its look closer to the current Contacts style? Actually, I thought about it a little bit. It seems to me that Contacts form is more convenient in case when you have many optional/ multiple (I mean you may have from 0 to many values) fields. However, in case when when all (or the most of) fields are mandatory and single (like we have in case with event), those plus/minus buttons look redundant. So I hardly imagine Event form in the current Contact form style. On May 29, 8:11 pm, Romain Guy romain...@google.com wrote: Follow what Contacts does :) On Fri, May 29, 2009 at 9:05 AM, Andriy Zakharchuk andriy.zakharc...@gmail.com wrote: Hello All, I know there were a lot of topics like this created earlier, but most of them haven't got any response. I'd like to raise this topic once again and probably ask more concrete questions. I need to create several forms which allow users entering data. Form allows entering text (EditText), numbers (EditText with appropriate input method), boolean fields (CheckBox), choose some options from a list (Spinner) etc. From my previous UI development experience I learned that users expect similar behaviour/loo'n'feel in similar situations. I tried to figure out form designing guidelines looking at built-in Android applications. There were two applications which have forms: Contacts and Calendar. Unfortunately I was unable to define any rules which are common for both applications. From the layout point of view, Contacts uses ListView-like form which looks like a settings form, whereas Calendar uses traditional form with labels and input controls. Choice of an option from a list is implemented differently: - Contacts - Ringtone field - is implemented as a ListPreference widget; - Calendar - Repetition field - is implemented as a TextView (label) + Spinner. Boolean field entry is implemented differently: - Contacts - Incoming calls field - implemented as a CheckBoxPreference; - Calendar - All day flag - implemented as a TextView (label) + CheckBox. So my question is what approach should I use when designing forms for data entry application? Should my forms look like an Event form or like a Contact form? It would be great if somebody from Android team read this message. I see that Android UI evolves, so probably you can give us (developers) some hint about further (planned) UI modifications which help us to design consistent UI. Thank you in advance. -- 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 -~--~~~~--~~--~--~---
[android-developers] Re: How to find out screen status: active/dark?
I've dug through the documentation but couldn't find a call that would fit: Is there a way to find out the screen status (Active/dark)? You can listen for Intent.ACTION_SCREEN_OFF and ACTION_SCREEN_ON broadcasts. However, I would strongly recommend registering for these dynamically at runtime using Context.registerReceiver(). This ensures that you'll only receive the broadcasts if your Service is already awake, which is what you want. :) -- Jeff Sharkey jshar...@android.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] Re: How to put an AppWidget on lock screen?
That documentation is describing an example of what another AppWidgetHost might look like, but we haven't implemented widgets on the default lock screen that shipped with 1.5. j On Fri, May 29, 2009 at 6:13 AM, dar dher...@gmail.com wrote: The documentation hints that: ...the lock screen could also contain widgets, and it would have a different way of adding, removing and otherwise managing widgets. [1] Now that I have 1.5, I can see the lock screen changed to show the same background as the home screen. Is there a way to put AppWidgets on the lock screen in 1.5? [1] http://developer.android.com/reference/android/appwidget/package-descr.html -- Jeff Sharkey jshar...@android.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] Re: ADC2 announced
Think about it for a moment, it's SO unfair to submit already published applications. Ivan Soto Fernandez Web Developer http://ivansotof.com On Fri, May 29, 2009 at 12:35 PM, gsmd gsm...@gmail.com wrote: http://code.google.com/android/adc/ - 'open only to applications that have not been published'. Thanks for screwing devs. --~--~-~--~~~---~--~~ 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: Why the Android docs are inconsistent?
Or better yet, contribute documentation patches :) On Fri, May 29, 2009 at 11:31 AM, havexz bali.param...@gmail.com wrote: OK i ll do that On May 28, 9:55 am, Hamy hamilt...@gmail.com wrote: Agreed. Please file doc bugs for the benefit of is all. Hamy On May 27, 11:12 pm, Raphael r...@android.com wrote: Please file doc bugs athttp://b.android.com--the API probably evolved before 1.0 without the javadoc being updated. R/ On Wed, May 27, 2009 at 6:51 PM,havexzbali.param...@gmail.com wrote: I have looking for something and found these inconsistencies in the online documentation This is a snippet from FAQ section http://developer.android.com/guide/appendix/faq/commontasks.html#broa... NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); nm.notifyWithText(R.id.alarm, Alarm!!!, NotificationManager.LENGTH_SHORT, null); Now when I try to find the 'notifyWithText' api, I could not find it. Another example is IntentReciever. I just want to know is this class exists? As I found code in this forum itself using IntentReciever, but I cant find this class in the doc. And why standard intents like action android:name=android.provider.Telephony.SMS_RECEIVED are not documented?- Hide quoted text - - Show quoted text - -- 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 -~--~~~~--~~--~--~---
[android-developers] Re: Why the Android docs are inconsistent?
Dats a good idea ..I just have to figure out how to do it... On May 29, 1:44 pm, Romain Guy romain...@google.com wrote: Or better yet, contribute documentation patches :) On Fri, May 29, 2009 at 11:31 AM, havexz bali.param...@gmail.com wrote: OK i ll do that On May 28, 9:55 am, Hamy hamilt...@gmail.com wrote: Agreed. Please file doc bugs for the benefit of is all. Hamy On May 27, 11:12 pm, Raphael r...@android.com wrote: Please file doc bugs athttp://b.android.com--theAPI probably evolved before 1.0 without the javadoc being updated. R/ On Wed, May 27, 2009 at 6:51 PM,havexzbali.param...@gmail.com wrote: I have looking for something and found these inconsistencies in the online documentation This is a snippet from FAQ section http://developer.android.com/guide/appendix/faq/commontasks.html#broa... NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); nm.notifyWithText(R.id.alarm, Alarm!!!, NotificationManager.LENGTH_SHORT, null); Now when I try to find the 'notifyWithText' api, I could not find it. Another example is IntentReciever. I just want to know is this class exists? As I found code in this forum itself using IntentReciever, but I cant find this class in the doc. And why standard intents like action android:name=android.provider.Telephony.SMS_RECEIVED are not documented?- Hide quoted text - - Show quoted text - -- 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- 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: Why the Android docs are inconsistent?
source.android.com explains everything :) On Fri, May 29, 2009 at 12:03 PM, havexz bali.param...@gmail.com wrote: Dats a good idea ..I just have to figure out how to do it... On May 29, 1:44 pm, Romain Guy romain...@google.com wrote: Or better yet, contribute documentation patches :) On Fri, May 29, 2009 at 11:31 AM, havexz bali.param...@gmail.com wrote: OK i ll do that On May 28, 9:55 am, Hamy hamilt...@gmail.com wrote: Agreed. Please file doc bugs for the benefit of is all. Hamy On May 27, 11:12 pm, Raphael r...@android.com wrote: Please file doc bugs athttp://b.android.com--theAPI probably evolved before 1.0 without the javadoc being updated. R/ On Wed, May 27, 2009 at 6:51 PM,havexzbali.param...@gmail.com wrote: I have looking for something and found these inconsistencies in the online documentation This is a snippet from FAQ section http://developer.android.com/guide/appendix/faq/commontasks.html#broa... NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); nm.notifyWithText(R.id.alarm, Alarm!!!, NotificationManager.LENGTH_SHORT, null); Now when I try to find the 'notifyWithText' api, I could not find it. Another example is IntentReciever. I just want to know is this class exists? As I found code in this forum itself using IntentReciever, but I cant find this class in the doc. And why standard intents like action android:name=android.provider.Telephony.SMS_RECEIVED are not documented?- Hide quoted text - - Show quoted text - -- 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- Hide quoted text - - Show quoted text - -- 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 -~--~~~~--~~--~--~---
[android-developers] Re: How to put an AppWidget on lock screen?
Thanks for answering. It'll be pretty cool when you add that in. On May 29, 2:42 pm, Jeff Sharkey jshar...@android.com wrote: That documentation is describing an example of what another AppWidgetHost might look like, but we haven't implemented widgets on the default lock screen that shipped with 1.5. j On Fri, May 29, 2009 at 6:13 AM, dar dher...@gmail.com wrote: The documentation hints that: ...the lock screen could also contain widgets, and it would have a different way of adding, removing and otherwise managing widgets. [1] Now that I have 1.5, I can see the lock screen changed to show the same background as the home screen. Is there a way to put AppWidgets on the lock screen in 1.5? [1]http://developer.android.com/reference/android/appwidget/package-desc... -- Jeff Sharkey jshar...@android.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] SDCard becoming un-writeable
Hey, My app occationaly fails with this/that sort of an IO error when trying to _write_ a file to the sdcard. No problems in reading files. I have tested it on both textual files ( via FileWriter etc) and binary files ( new RandomAccessFile( filepath, rw); ). I have no reasun to believe that the sdcard is corrupted, as other apps, picture viewer included, works just fine. I have read a hint somewhere about such a problem relating to the sdcard moving into read-only mode but i did not manage to follow that lead. Your ideas will be welcomed tnx, GiladH --~--~-~--~~~---~--~~ 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: ADC2 announced
Lost my attention immediately. The few pennies I'll get from the Android Mock-it Place are better than nothing at all. What a joke. On May 29, 12:35 pm, gsmd gsm...@gmail.com wrote: http://code.google.com/android/adc/- 'open only to applications that have not been published'. Thanks for screwing devs. --~--~-~--~~~---~--~~ 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: Help with Services
Sujay, There are two ways I know of doing this: 1. Easy way is to have the service to broadcast the result. 2. A little more complex way is to have an AIDL which is very similar to CORBA and enable the IPC between the service and your app components. This i assume would be more sync in nature as opposed to option#1. I am not sure if there are any other ways of doing this.. Thx! On May 29, 12:03 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Hi all, i'm starting an activity that inturn calls a service i wanna get notified when the service competes... can anyone temme how i can do this??? -- Regards, Sujay Bette Davis http://www.brainyquote.com/quotes/authors/b/bette_davis.html - Brought up to respect the conventions, love had to end in marriage. I'm afraid it did. --~--~-~--~~~---~--~~ 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] xmlbeans support in 1.5
This question has been asked before. However, the slideshow at http://www.slideshare.net/sullis/web-services-and-android-osspac-2009 says that xmlbeans is not supported in 1.0 and 1.1. Does that mean xmlbeans is supported now?. Has anyone managed to get xmlbeans working in android?. 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] how to get classes in an apk using DexClassLoader?
I have an apk installed in /data/app. I want to use the class methods in there. Here is what I tried: public void test0method(){ DexClassLoader dLoader = new DexClassLoader(/data/app/ com.my.internal.apk, /data/local/tmp, null, ClassLoader.getSystemClassLoader()); try { Class cLoad = dLoader.loadClass (com.my.internal.SystemProperties); // got ClassNotFoundException at above line Method mLoad = cLoad.getMethod(GetString,new Class[]{}); Object obj = cLoad.newInstance(); Object sysProp = cLoad.newInstance(); mLoad.invoke(obj); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } I got ClassNotFoundException. By peeking into the apk, I don't see class files but classes.dex. I would assume SystemProperties class is in classes.dex. Why can I load it? What did I do wrong? Thanks, Sherry --~--~-~--~~~---~--~~ 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: OpenGL
I have worked this out! So for anyone who's interested: When I removed gl.glEnableClientState(GL10.GL_COLOR_ARRAY); from the code, it started working on the device, as well as continuing to work on the emulator. When I put it back in we only get coloured shapes in the emulator, and not on the device. Does anyone know why there is this inconsistency? Is it a bug in the sdk? Or a lack of understanding on my part? Cheers, Nilz. On 26 May, 22:45, Nilz nilz.v.pa...@gmail.com wrote: Hi There! After spending the better half of this day getting my HTC Magic to work in developer mode, I've now found that some of my frist openGL coding attempts that appeared to work fine in the emulator doesn't work as expected on the device. I've narrowed this down to glColorf(r, g, b, a) not working as expected on the device itself. The provided OpenGL samples do work though. So for example, after modifying Cube.java from the samples to the below code I find that I get the expected grey square on the emulator but a blank white screen (background fill colour) on the device. class Cube { public Cube() { int one = 0x1; int vertices[] = { -one, -one, -one, one, one, -one, one, one, }; // Buffers to be passed to gl*Pointer() functions // must be direct, i.e., they must be placed on the // native heap where the garbage collector cannot // move them. // // Buffers with multi-byte datatypes (e.g., short, int, float) // must have their byte order set to native order ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length*4); vbb.order(ByteOrder.nativeOrder()); mVertexBuffer = vbb.asIntBuffer(); mVertexBuffer.put(vertices); mVertexBuffer.position(0); } public void draw(GL10 gl) { gl.glFrontFace(GL10.GL_CW); gl.glVertexPointer(2, gl.GL_FIXED, 0, mVertexBuffer); gl.glColor4f(0.5f, 0.5f, 0.5f, 0.5f); gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4); } private IntBuffer mVertexBuffer; } I'm using the latest 1.5 SDK, and my device is the HTC Magic running firmware version 1.5. Can anyone explain to me why when switching from colour buffers and using glDrawElements to glColorf and glDrawArrays, stops shapes from being coloured in? Cheers,Nilz. --~--~-~--~~~---~--~~ 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] SampleView in a Layout?
Hi, @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new SampleView(this)); } private static class SampleView extends View implements OnGestureListener { but how could I make that I use a Layout, where are three Buttons are included and implement the above Sampleview? Just for explanation: I need the Sampleview for a Diagram I created, but i would be great to place two normal buttons bellow... is this possible? or do I have to create a normal layout xml with a Bitmap inside and paint there my stuff? Thanks Chris --~--~-~--~~~---~--~~ 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: Telephony Manager functions don't work
alexdonnini wrote: I have low expectations that this message will get any response as it seems that Google developers do not like to address issues too close to the Android core and to strategic mobility applications. Do you honestly think insulting Google developers will improve your chances of getting answers? Yet, getNeighboringCellInfo() does not work. Any attempt to call it in an application results in application failure. File a bug report at http://b.android.com. I didn't find any issues referencing that method. If you can attach a project that reproduces the issue, so much the better. BTW, the Android 1.5 docs say you need the ACCESS_COARSE_UPDATES permission -- do you hold that permission? That might be a documentation bug, in that I cannot find any other reference to that permission, so you might also try ACCESS_COARSE_LOCATION. None of that would seem to line up with the stack trace you posted in that one thread, but you never know... -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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: What's the best way to handle an task w/progress dialog on orientation change?
Are you trying to tell me that it's totally safe to throw stuff in static fields? I've always avoided it because of years of shared space in a JVM in web apps. I know Android uses separate processes for each application but is it safe to say that it will kill all of your static allocations even if you don't clean them up properly? If that's the case, then yes, I probably could have gotten away with using a static gateway instead of a remote service. On May 29, 12:18 pm, Mike Hearn mh.in.engl...@gmail.com wrote: I DO need it to run in the background, that is, while orientation is changing. That's not in the background - the activity manager will keep your process alive during configuration changes anyway, regardless of whether you have a service or not. The only reason to use a service is if you need your process to live on when the activities are not on screen. I don't like the static handler idea because it can't have more advanced capabilities like the queue my service has. Sorry, I don't understand this. You can pass any objects you like through a handler and handlers use the threads message queue anyway. So I don't see why you can't have a queue using a handler. --~--~-~--~~~---~--~~ 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: What's the best way to handle an task w/progress dialog on orientation change?
Robert Green wrote: Are you trying to tell me that it's totally safe to throw stuff in static fields? I wouldn't go with totally safe, but it's an unfortunate requirement in some Android cases (e.g., sharing a WakeLock between a BroadcastReceiver triggered by AlarmManager and a Service doing the actual work being scheduled to run in the background). I've always avoided it because of years of shared space in a JVM in web apps. I know Android uses separate processes for each application but is it safe to say that it will kill all of your static allocations even if you don't clean them up properly? Garbage collection rules still hold, until the whole process is killed (or, I assume, recycled -- I sincerely hope they flush the heap when they reuse an existing process). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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: Parsing Dates in other Locales
I think this is because many locales are not included in the cupcake release due to size issues. (even less were included in the 1.0 and 1.1 releases) Locales.getAvailableLocales() should return all locales that are supported. The goal will be to include all the locales ICU has to offer. But this is a mid term goal because of the already mentioned size issues. If you try to format a date with a locale that's not available I think it'll just return the number as a fallback. The same should apply to weekday names. -- Urs On Fri, May 29, 2009 at 5:54 PM, EboMike ebom...@gmail.com wrote: I need to parse a date using a flexible date format (like MM/dd/ or dd-MMM), and so far I've always used SimpleDateFormat for that (since unfortunately, android.text.format.Time.parse doesn't support date format strings). This works fine in an US environment, but as soon as I switch to any other locale, MMM translates into the number of the month (i.e. it's 6 instead of Jun). This seems like a problem that's new to Cupcake, although I'm not sure. Is there any way to parse date strings in another locale other than writing my own parser? android.text.format.DateFormat.format is great for converting from date to string, but I can't find anything going the other way around. -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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to find out screen status: active/dark?
Jeff, What would the behavior be if you registered the broadcast receiver and listed these intents in the manifest? Would the run time start the service to invoke the onReceive() method? If so this is a great tip for optimization. Thanks On May 29, 1:38 pm, Jeff Sharkey jshar...@android.com wrote: I've dug through the documentation but couldn't find a call that would fit: Is there a way to find out the screen status (Active/dark)? You can listen for Intent.ACTION_SCREEN_OFF and ACTION_SCREEN_ON broadcasts. However, I would strongly recommend registering for these dynamically at runtime using Context.registerReceiver(). This ensures that you'll only receive the broadcasts if your Service is already awake, which is what you want. :) -- Jeff Sharkey jshar...@android.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] Screen Brightness
Hi, I read here in several posts thats possible with WindowManager.LayoutParams lp = getWindow().getAttributes(); lp.screenBrightness = 100 / 100.0f; getWindow().setAttributes(lp); to change the screen brightness. ok, but it looks only for the actual activity. (there it works) When I close my activity, the standart system brightness is still the same But how to change the overall brightness, like several tools for 1.5 do? thanks chris --~--~-~--~~~---~--~~ 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: Bluetooth and Serial Port Profile
Hi Manny, Sounds like your socket was not getting closed properly. There is some discussion of a new interface BluetoothSocket.java on android-platform. An implementation will soon be available in the open source tree. Nick On Wed, May 27, 2009 at 5:14 AM, Manny manfred.spell...@gmail.com wrote: Hello, I am looking forward using the Bluetooth API. For now I am sticking with RfcommSocket.java. I have removed the @hide and recompiled the SDK. With the new android.jar I can use RfcommSocket now. I use a Developer Phone with the standard 1.5. Can I use the standard firmware with RfcommSocket or do I need a new image as well ? For now I have some serious problems. create and connectAsync on a channel work only one time, every second time I get the Log-Message 05-27 12:08:46.183: ERROR/bluetooth_RfcommSocket.cpp(13416): RFCOMM async connect error (25): Device or resource busy (16) I use shutdown and destroy to correctly cleaning the socket, but next time I start the app I get this message, I can only use a new channel then it works one time. In this case I get the Log-message 05-27 13:15:54.333: INFO/bluetooth_RfcommSocket.cpp(13485): RFCOMM async connect is in progress (Operation now in progress) The next problem is that I get this Log-Message when I make a flush on the OutputStream. 05-27 13:29:44.633: WARN/System.err(13580): java.io.IOException: Transport endpoint is not connected This message comes independently if the socket is connected or not. What I want to do is connecting the Developer Phone with the Bluetooth receiver on my notebook, sending data and receiving it on the Notebook on a Com-Port maybe with HyperTerminal for Test purpose (In real world a different Hardware is used instead). Bluetooth on the Notebook uses Com4 and 5 for SPP. The Notebook finds the G1 Dev Phone, but as profile for it only A2DP is listed. The G1 Dev Phone finds the Notebook after scanning, Pairing but not connected is stated for this. Any idea how I can get this working ? For now with unhide RfcommSocket ? or do I have to wait for your Bluetooth API ? Do I need a new image for this ? Since we have to present our customer a draft version in aboout 2 weeks there is a little pressure on this for us. So in general can we get that working with the actual possibilities of the SDK and the Dev-Phone or do we have to wait, on a later version of SDK, with your Bluetooth API, or a different Hardware. Hopefully you can help me I am looking forward to any answers Manny On 13 Mai, 08:19, Nick Pelly npe...@google.com wrote: Just a quick heads up. I'm almost complete on reworking RfcommSocket.java to improve its interface, fix a number of bugs, and eventually make it a public API. I will soon post on android-platform once its ready for more eyes. Cheers, Nick On Tue, May 12, 2009 at 11:01 AM, Zach Hobbs ho...@helloandroid.com wrote: Another note: You don't really have to flash the image with the @hide gone, that class will be accessible by any APK. You just need to have it visible in your development environment. -Zach On May 12, 1:05 pm, Alin Radut alin.claudiu.ra...@gmail.com wrote: On May 12, 7:00 am, Zach Hobbs ho...@helloandroid.com wrote: Did you change anything when you built the SDK? If not, then the classes will still not be visible. Hint: classes or methods with @hide in the comment block above the code are not visible in the jar built for the SDK. I removed the @hide from RfcommSocket.java and after a lengthy 4 hour compile now it shows up in the .jar file. The problem is that after I flashed the device with the img files I can't access the Wireless controls screen because it crashes. It appears that there is a problem with the bluetooth A2DP service. The adb logcat output is available here:http://clawoo.ro/pub/logcat.txt and the traces.txt file is available here: http://clawoo.ro/pub/traces.txt The problem is that I cannot enable the bluetooth service if I cannot access that screen so I cannot test if I can interact with RFCOMM as I need. Do anyone have any idea why the wireless controls screen crashes and what can I do about it? Thanks, Alin --~--~-~--~~~---~--~~ 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: Help with Services
Take a look at the API Demoes source code. There is source code for a Service that handles request from an activity and that can do callbacks back to an activity for updates (e.g. progress). On May 29, 1:03 am, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Hi all, i'm starting an activity that inturn calls a service i wanna get notified when the service competes... can anyone temme how i can do this??? -- Regards, Sujay Bette Davis http://www.brainyquote.com/quotes/authors/b/bette_davis.html - Brought up to respect the conventions, love had to end in marriage. I'm afraid it did. --~--~-~--~~~---~--~~ 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: Parsing Dates in other Locales
All the more a reason for me to switch to android.text.format, because that one DOES have those strings in several languages - but I can't see a replacement for SimpleDateFormat.parse(). Is there no way other than writing my own parser? On May 29, 2009 1:37 PM, Urs Grob grob@gmail.com wrote: I think this is because many locales are not included in the cupcake release due to size issues. (even less were included in the 1.0 and 1.1 releases) Locales.getAvailableLocales() should return all locales that are supported. The goal will be to include all the locales ICU has to offer. But this is a mid term goal because of the already mentioned size issues. If you try to format a date with a locale that's not available I think it'll just return the number as a fallback. The same should apply to weekday names. -- Urs On Fri, May 29, 2009 at 5:54 PM, EboMike ebom...@gmail.com wrote: I need to parse a date using a flexible date format (like MM/dd/ or dd-MMM), and so far I've always used SimpleDateFormat for that (since unfortunately, android.text.format.Time.parse doesn't support date format strings). This works fine in an US environment, but as soon as I switch to any other locale, MMM translates into the number of the month (i.e. it's 6 instead of Jun). This seems like a problem that's new to Cupcake, although I'm not sure. Is there any way to parse date strings in another locale other than writing my own parser? android.text.format.DateFormat.format is great for converting from date to string, but I can't find anything going the other way around. -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 at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] SpriteText and coloured surfaces
I've tried to modify the SpriteText sample code, so that it doesn't use textures on the shapes, but instead colour the shapes. For example, modify the sample so that it's a coloured triangle instead of one with the android image. But is doesn't work, and I can't see why. I tried replacing the triangle completey with the Cube object (also from the sample code), as this is a coloured object, but still no luck! What I always end up getting is black objects! When I remove/ comment out the labels and the labelmaker from the code then all of a suddent the objects are coloured as they are supposed to be. Does anyone know how to get coloured objects/surfaces working with the SpriteText sample? Cheers, Nilz. --~--~-~--~~~---~--~~ 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: can not find a file in dynamically loaded jar
Thanks for your advice. I created an apk using the same classes and installed it using adb install to Emulator. Now I tried to use the following code to access the methods in Class SystemProperties which is part of newly installed apk. I still got ClassNotFoundException: public void test0method(){ DexClassLoader dLoader = new DexClassLoader(/data/app/ com.my.internal.apk, /data/local/tmp, null, ClassLoader.getSystemClassLoader()); try { Class cLoad = dLoader.loadClass (com.my.internal.SystemProperties); // above line throw ClassNotFoundException Method mLoad = cLoad.getMethod(GetString,new Class[]{}); Object obj = cLoad.newInstance(); Object sysProp = cLoad.newInstance(); mLoad.invoke(obj); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } I peeked into the apk file and saw classes.dex there. Is there a way I can dump the content of a dex file and to see if the classes are there? Thanks, Sherry On May 28, 12:43 pm, fadden fad...@android.com wrote: On May 26, 4:00 pm, sherry syang...@gmail.com wrote: I'm trying to dynamically load a jar file, then load the classes inside the jar. The code is simple but I keep getting ClassNotFind exception. The class is in the jar. How can I figure out what is wrong? Two thoughts come to mind: (1) The Dalvik VM uses its own DEX format, not Java .class files. If you have a Jar full of classfiles, it's not going to work. The VM expects to find a single classes.dex in a jar file. (2) For loading classes from DEX files outside your app's APK you probably want to use DexClassLoader (introduced in 1.5). URLClassLoader is not really useful for loading classes. --~--~-~--~~~---~--~~ 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: Telephony Manager functions don't work
My application does have uses-permission android:name=android.permission.ACCESS_COARSE_LOCATION / uses-permission android:name=android.permission.ACCESS_FINE_LOCATION / uses-permission android:name=android.permission.ACCESS_COARSE_UPDATES / Here is an example of the fialure I referred to in my message: This code: ArrayListNeighboringCellInfo mNeighboringCellInfo; mNeighboringCellInfo = new ArrayListNeighboringCellInfo (); mNeighboringCellInfo = (ArrayList) mTelephonyManager.getNeighboringCellInfo(); for(int i = 0; i mNeighboringCellInfo.size(); ++i) { System.out.println(mNeighboringCellInfo.get(i) - +mNeighboringCellInfo.get(i)); } generates this failure: 05-29 16:46:08.981: WARN/dalvikvm(5415): VFY: unable to resolve virtual method 13918: Landroid/telephony/ TelephonyManager;.getNeighboringCellInfo ()Ljava/util/List; 05-29 16:46:08.981: WARN/dalvikvm(5415): VFY: rejecting opcode 0x74 at 0x013a 05-29 16:46:08.981: WARN/dalvikvm(5415): VFY: rejected Lcom/android/ commmanager/CommManager;.onCreate (Landroid/os/Bundle;)V 05-29 16:46:08.981: WARN/dalvikvm(5415): Verifier rejected class Lcom/ android/commmanager/CommManager; 05-29 16:46:08.981: WARN/dalvikvm(5415): Class init failed in newInstance call (Lcom/android/commmanager/CommManager;) 05-29 16:46:08.991: WARN/dalvikvm(5415): threadid=3: thread exiting with uncaught exception (group=0x40013e28) Could you send the community an example of code where you were successful in using getNeighboringCellInfo()? It would help all of us who have not been able to get getNeighboringCellInfo() to work, correct our mistakes. Thanks. On May 29, 4:24 pm, Mark Murphy mmur...@commonsware.com wrote: alexdonnini wrote: I have low expectations that this message will get any response as it seems that Google developers do not like to address issues too close to the Android core and to strategic mobility applications. Do you honestly think insulting Google developers will improve your chances of getting answers? Yet, getNeighboringCellInfo() does not work. Any attempt to call it in an application results in application failure. File a bug report athttp://b.android.com. I didn't find any issues referencing that method. If you can attach a project that reproduces the issue, so much the better. BTW, the Android 1.5 docs say you need the ACCESS_COARSE_UPDATES permission -- do you hold that permission? That might be a documentation bug, in that I cannot find any other reference to that permission, so you might also try ACCESS_COARSE_LOCATION. None of that would seem to line up with the stack trace you posted in that one thread, but you never know... -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Need Android talent? Ask on HADO!http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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: audio recorder
I think I found my problem. First - the AudioRecord only seems to work for this combination of parameters: ar_test = new AudioRecord(MediaRecorder.AudioSource.MIC, 8000, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT, 10); (buffer size must be 4096 apparently) and Second - you must have permission for RECORD_AUDIO set in manifest Onward and upward... On May 28, 6:45 pm, intbt in...@tacberry.com wrote: With version 1.5, I keep getting this error 05-29 01:36:39.440: ERROR/AudioRecord-JNI(1280): Error creating AudioRecord instance: initialization check failed. 05-29 01:36:39.450: ERROR/AudioRecord-Java(1280): [ android.media.AudioRecord ] Error code -20 when initializing native AudioRecord object. and then: 05-29 01:36:39.630: ERROR/AndroidRuntime(1280): java.lang.IllegalStateException: startRecording() called on an uninitialized AudioRecord. My code: ar_test = new AudioRecord(MediaRecorder.AudioSource.MIC, 11025, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_8BIT, 20); ar_test.read(ar_buffer, 0, 15); ar_test.startRecording(); toneTimer.setTimer(1); toneTimer.countdownTimer(); ar_test.stop(); Can some one explain what I am missing? --~--~-~--~~~---~--~~ 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: Telephony Manager functions don't work
alexdonnini wrote: My application does have uses-permission android:name=android.permission.ACCESS_COARSE_LOCATION / uses-permission android:name=android.permission.ACCESS_FINE_LOCATION / uses-permission android:name=android.permission.ACCESS_COARSE_UPDATES / Oh, well, so much for the permission idea. generates this failure: 05-29 16:46:08.981: WARN/dalvikvm(5415): VFY: unable to resolve virtual method 13918: Landroid/telephony/ H...that's a different virtual method number than in the other stack trace...not quite sure what that means. Off the cuff, it feels like the C .so doesn't export its edition of getNeighboringCellInfo(), so the JNI lookup is failing. I'm not quite good enough in surfing the Android source code to try to confirm this theory, though. Could you send the community an example of code where you were successful in using getNeighboringCellInfo()? I've never tried it, which is why I suggested filing a bug over at http://b.android.com if the permissions didn't clear up your problem. You couched your post as this issue being another Great Google Conspiracy. You're welcome to depict the situation however you like. But, it would seem prudent to also file a bug report, to see if that gets you better results. But, hey, that's just me. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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: Sending SMS more than 160 characters
On May 28, 11:26 pm, Mark mark.ka...@gmail.com wrote: On May 28, 12:42 am, devendra.madhe...@gmail.com devendra.madhe...@gmail.com wrote: I am trying to send large SMS more than 160 characters using SendMultipartText() API. But On receivver side , i am getting two messages ( SMS). Query: Is there any way to send as one shot SMS (size more than 160 characters) and it should be received in one SMS only? There is no way to send a single message longer than 160 chars, this is an underlying design featrue of SMS. The system's I've worked with allowed up to 5 SMS' to be stringed together allowing something like 760 characters - but I don't know how it is done apart from the SMS' contains some special codes! /Andrew --~--~-~--~~~---~--~~ 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 find out screen status: active/dark?
When you define a receiver in the manifest, the system will force your process awake to handle those broadcasts, even when your process may not be running. The overhead of ramping up a new process every time the user turns on/off the display is very high, which is why you want to avoid it. But in his case it's cheap when his Service is already running. j On Fri, May 29, 2009 at 1:37 PM, clemsongrad dpotl...@gmail.com wrote: Jeff, What would the behavior be if you registered the broadcast receiver and listed these intents in the manifest? Would the run time start the service to invoke the onReceive() method? If so this is a great tip for optimization. Thanks On May 29, 1:38 pm, Jeff Sharkey jshar...@android.com wrote: I've dug through the documentation but couldn't find a call that would fit: Is there a way to find out the screen status (Active/dark)? You can listen for Intent.ACTION_SCREEN_OFF and ACTION_SCREEN_ON broadcasts. However, I would strongly recommend registering for these dynamically at runtime using Context.registerReceiver(). This ensures that you'll only receive the broadcasts if your Service is already awake, which is what you want. :) -- Jeff Sharkey jshar...@android.com -- Jeff Sharkey jshar...@android.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] Market Not Updating Version Info
I just uploaded a new version of my application to the Android Market and then I choose to upload an update it doesn't update the version number of the app. It is only doing this as of Cupcake. Anyone else seeing this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Console logging missing on Eclipse
I'm running Eclipse Ganymede on Ubuntu 8.04 and suddenly with no configuration changes as of yesterday am missing logging on the Console Window. I see startup logging when I launch an app but once launched there are no more lines of information. The buttons for Verbose etc are also missing. Log.v messages are not showing. Anyone else seeing this? I'm wondering if one of Ubuntu's updates screwed things up? I may try reinstalling the plug-in or even Eclipse but thought I would check here first. Brian Conrad JyotishTools.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] Re: Telephony Manager functions don't work
Sorry Mark, I thought you had tried it. I will file a bug report. Thanks. Alex Donnini On May 29, 5:01 pm, Mark Murphy mmur...@commonsware.com wrote: alexdonnini wrote: My application does have uses-permission android:name=android.permission.ACCESS_COARSE_LOCATION / uses-permission android:name=android.permission.ACCESS_FINE_LOCATION / uses-permission android:name=android.permission.ACCESS_COARSE_UPDATES / Oh, well, so much for the permission idea. generates this failure: 05-29 16:46:08.981: WARN/dalvikvm(5415): VFY: unable to resolve virtual method 13918: Landroid/telephony/ H...that's a different virtual method number than in the other stack trace...not quite sure what that means. Off the cuff, it feels like the C .so doesn't export its edition of getNeighboringCellInfo(), so the JNI lookup is failing. I'm not quite good enough in surfing the Android source code to try to confirm this theory, though. Could you send the community an example of code where you were successful in using getNeighboringCellInfo()? I've never tried it, which is why I suggested filing a bug over athttp://b.android.comif the permissions didn't clear up your problem. You couched your post as this issue being another Great Google Conspiracy. You're welcome to depict the situation however you like. But, it would seem prudent to also file a bug report, to see if that gets you better results. But, hey, that's just me. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Need Android talent? Ask on HADO!http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ 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: Console logging missing on Eclipse
Never mind. Somehow LogCat (not Console) got turned off and digging around I found the setting to turn it on. On May 29, 2:14 pm, Brian Conrad brianjto...@gmail.com wrote: I'm running Eclipse Ganymede on Ubuntu 8.04 and suddenly with no configuration changes as of yesterday am missing logging on the Console Window. I see startup logging when I launch an app but once launched there are no more lines of information. The buttons for Verbose etc are also missing. Log.v messages are not showing. Anyone else seeing this? I'm wondering if one of Ubuntu's updates screwed things up? I may try reinstalling the plug-in or even Eclipse but thought I would check here first. Brian Conrad JyotishTools.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] Re: Sending SMS more than 160 characters
The SMS protocol allows for fragmented SMS delivery, where one long message is splitted into several SMS packets sent to the wire (each one charged separately, of course :-)) This involves setting a fragment bit in the packet, as well as filling an optional header with fragment index+count and other information. The Android GSM stack should be able to re-assemble these properly. When you talk about the other hand, what device is this ? On Fri, May 29, 2009 at 11:01 PM, Andrew andrewr...@gmail.com wrote: On May 28, 11:26 pm, Mark mark.ka...@gmail.com wrote: On May 28, 12:42 am, devendra.madhe...@gmail.com devendra.madhe...@gmail.com wrote: I am trying to send large SMS more than 160 characters using SendMultipartText() API. But On receivver side , i am getting two messages ( SMS). Query: Is there any way to send as one shot SMS (size more than 160 characters) and it should be received in one SMS only? There is no way to send a single message longer than 160 chars, this is an underlying design featrue of SMS. The system's I've worked with allowed up to 5 SMS' to be stringed together allowing something like 760 characters - but I don't know how it is done apart from the SMS' contains some special codes! /Andrew --~--~-~--~~~---~--~~ 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 classes in an apk using DexClassLoader?
Now I used dexdump on /data/app/com.my.internal.apk and saw SystemProperties class is in the classes.dex file: Class #9- Class descriptor : 'Lcom/sprint/internal/SystemProperties;' Access flags : 0x30001 (PUBLIC VERIFIED OPTIMIZED) Superclass: 'Ljava/lang/Object;' Can someone tell me why DexClassLoader.loadClass can not find it? Thanks. Sherry On May 29, 1:10 pm, sherry syang...@gmail.com wrote: I have an apk installed in /data/app. I want to use the class methods in there. Here is what I tried: public void test0method(){ DexClassLoader dLoader = new DexClassLoader(/data/app/ com.my.internal.apk, /data/local/tmp, null, ClassLoader.getSystemClassLoader()); try { Class cLoad = dLoader.loadClass (com.my.internal.SystemProperties); // got ClassNotFoundException at above line Method mLoad = cLoad.getMethod(GetString,new Class[]{}); Object obj = cLoad.newInstance(); Object sysProp = cLoad.newInstance(); mLoad.invoke(obj); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } I got ClassNotFoundException. By peeking into the apk, I don't see class files but classes.dex. I would assume SystemProperties class is in classes.dex. Why can I load it? What did I do wrong? Thanks, Sherry --~--~-~--~~~---~--~~ 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 classes in an apk using DexClassLoader?
sherry wrote: Now I used dexdump on /data/app/com.my.internal.apk and saw SystemProperties class is in the classes.dex file: Class #9- Class descriptor : 'Lcom/sprint/internal/SystemProperties;' Access flags : 0x30001 (PUBLIC VERIFIED OPTIMIZED) Superclass: 'Ljava/lang/Object;' Can someone tell me why DexClassLoader.loadClass can not find it? Even if you were to get this working in an emulator, I am uncertain it would work on a device, as you may not be able to access /data/app from your own application. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---