Re: [android-developers] Re: Resolution Problem in Nexus One
This has nothing to do with your manifest. You are blowing away the current configuration in the resources with your own you have created that is not initialized. Things aren't going to work when you do that. You could improve that by giving it a properly created Configuration, but I don't want to help with doing that because what you are trying to do is never going to work quite right because you will be fighting with the platform over what configuration is being used in the resources. On Thu, Jul 22, 2010 at 10:57 PM, Engin Arslan enginarsla...@gmail.comwrote: Webnet, As I said in my question I tried following in my androidmanfest.xml but it did not work. supports-screens android:smallScreens=true android:normalScreens=true android:largeScreens=true android:anyDensity=true / I think problem is updating configuration as Dianne said however I do not alternative way of specifiying application language Can anyone suggest me better way? On Jul 21, 2:46 pm, Webnet Android webnet.andr...@gmail.com wrote: On 21 July 2010 13:24, Engin Arslan enginarsla...@gmail.com wrote: any suggestions?? http://adrianvintu.com/blogengine/post/Force-Locale-on-Android.aspx -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Change Menu on the fly
If it's an Options menu, from the docs it is clear that onCreate will only be called the first time. But if you want to control the items in the runtime, you should also override the onPrepareOptionsMenu. In this method, you can add or remove any items when the menu is triggered. -Kumar Bibek http://tech-droid.blogspot.com On Jul 22, 11:15 pm, Joseph Earl joseph.w.e...@gmail.com wrote: What kind of menu do you mean? An options menu, context menu, gridview etc On Jul 22, 4:05 pm, drill sebastianar...@hotmail.com wrote: Hi, I have a Gallery with a couple of photos, which is working really great. but now i like to have a menu which is sensetive for the picture which is shown currently. So for pic1 i like to have menu1 for pic2 i wanna have menu2, etc . How would I achive this goal? Anyone had similar issues? Thanks a lot. ragrds -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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] broadcast receiver issue
Hi All, I am working on one project where i am using broadcast receiver in one of my activity to capture the incomming call and its works fine. when one of my other activity is open and that time if call is come then my broadcast receiver is fail to respond. can any one help me for this ? or its nessesorry to declare broadcast receiver in all my activity to do some comman task. thanks regards sandeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 2d canvas game: FPS Jitter problem
Thanks everyone for your input! I have gotten a lot of feedback and will try to implement all of the answers. I need to try and limit the frames per second properly. And also it was recommended to me to use 2 threads, one for graphics and one for the physics I will try both and see what happens! On Jul 22, 3:43 pm, Robert Green rbgrn@gmail.com wrote: Cameron, Are you using time-based movement or frame-based? Would you mind sending me an APK? I can check it out for you and maybe help out a little with some suggestions. On Jul 22, 3:16 pm, Cameron cameron.m.john...@gmail.com wrote: Thanks for the reply Matt, I have used the DDMS in Eclipse to see if there is any GC that happens and nothing that belongs to my thread. There are some but those are by the Android system itself. I have also optimized the hell out of this game following all of the examples from google and other forums. I do exaclty what you said with the adding new monsters example on the go but it doesn't seem to great any GC events. I will preload them like you suggested and see what happens. Also I will try to use the uptimeMillis(). Right now im using now = System.currentTimeMillis(); On Jul 22, 1:07 pm, Matt matthew.quig...@gmail.com wrote: Well, it sounds like the frame rate goes down intermittently because of the garbage collector. First of all, you should not be doing any object creation during your game loop. This way there is never any need for a GC. 1. Create all of your objects before hand. For example, Monster[] mMonsters = new Monster[Monster.MAX]; setup() { for (int i = 0; i mMonsters.length; i++) { mMonsters[i] = new Monster(); mMonsters[i].used = false; } ...} Instead of creating a new monster every time one comes into play, just set its used flag to true (and set it to false, instead of deleting it, when the monster is done). 2. Use android.os.SystemClock.uptimeMillis() when limiting your FPS. Basically what you want to do is keep track of each game tick, and if it hasn't been 1/30 seconds yet, sleep for the remaining time. 3. Google java game optimization. -Matt On Jul 22, 3:46 pm, Cameron cameron.m.john...@gmail.com wrote: I based my game off of the lunar lander demo, although heavily modified, and I can get around 40-50fps but the problem is it fluctuates between 40-50fps so much that it causes the moving graphics to jitter! Its very annoying and makes my game look really shitty when in fact its running at a good frame rate. I tried setting the thread priority higher but that just made it worse... now it will fluctuate between 40-60fps... I was thinking of limiting the FPS to about 30 so that it will be constant. Is this a good idea and does anyone else have experience or a different solution? Thanks! PS: If you have an example of limiting or creating constant FPS that would be helpful. I've tried it before but never got it quite right. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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] command to find os information / system information
hi there, i have to store what version of android users are using, search all over internet, hard to find this info... any help would be highly appreciated !.. thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: command to find os information / system information
ok ... got the information, here is the link http://android-er.blogspot.com/2009/09/read-android-system-info-using.html On Jul 23, 11:19 am, Jake integr...@gmail.com wrote: hi there, i have to store what version of android users are using, search all over internet, hard to find this info... any help would be highly appreciated !.. 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
Re: [android-developers] command to find os information / system information
Which version? OS version ? Kernel version ? SDK version ? By Java code ? By command ? Or you have to read android.os.Build first. 2010/7/23 Jake integr...@gmail.com: hi there, i have to store what version of android users are using, search all over internet, hard to find this info... any help would be highly appreciated !.. 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 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] command to find os information / system information
Ex. import android.os.Build; // Build.VERSION String codeName = Build.VERSION.CODENAME; String incremental = Build.VERSION.INCREMENTAL; String release = Build.VERSION.RELEASE; String sdk = Build.VERSION.SDK; int sdk_int = Build.VERSION.SDK_INT; 2010/7/23 XC He schosnab...@gmail.com: Which version? OS version ? Kernel version ? SDK version ? By Java code ? By command ? Or you have to read android.os.Build first. 2010/7/23 Jake integr...@gmail.com: hi there, i have to store what version of android users are using, search all over internet, hard to find this info... any help would be highly appreciated !.. 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 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 is a WeakReference?
You left out something very important: the code hidden under // reload the image must not assume that it is not itself interrupted by yet another call to the garbage collector. That is, instead of simply continuing to use the soft/weak reference, it should make a strong reference to the same object, allowing this latter reference to either go out of scope or be set to null when it is done. But if we are making this strong reference, what was the point of using the weak/soft reference in the first place? Ah, that is the tricky thing about using them. Depending on when you can make and release the strong reference, they might not buy you much; they might not buy you anything at all. That is why they are not recommended for much outside of caches and normalized mappings. On Jul 22, 11:07 am, Joseph Earl joseph.w.e...@gmail.com wrote: Suppose you had a long list of images. As the user scrolled down you load the images from the net, and then display them. To avoid having to reload the images again if the user scrolls back up, you put the images in a cache (probably something like a MapString, Drawable) However because it is a long list you don't want to run into an out of memory situation if the user scrolls very far down and lots of images are put in the cache. So instead of storing the Drawables directly in the map, you create a MapString, WeakReferenceType (although I would use SoftReference for the purpose described here). This means that if Android is going to encounter an out of memory situation it will clear all of the Soft/Weak references (and thus hopefully avoid running out of memory). You will have to load the images again since your cache has been cleared, but this is far better than your application running out of memory and crashing. So you do something like: // caching an image MapString, SoftReference cache = new HashMapString, SoftReferenceDrawable(); cache.put(http://mysite.com/images/1.jpg;, new SoftReferenceDrawable.put(myDrawable)); // retrieve an image if (cache.containsKey(url)) { // looks like we have this image cached Drawable drawable = cache.get(url).get(); if (drawable == null) { // the softreference has been cleared by the GC, reload the image } else { // softreference is still valid, got our image } } Essentially a weak reference is a weaker reference than a soft reference - the GC should free weak references to regain memory before soft references. I think that's (mostly) correct, hope it helps. On Jul 22, 6:48 pm, GodsMoon godsm...@gmail.com wrote: Google just posted a new blog post onhttp://android-developers.blogspot.com/2010/07/multithreading-for-per I understand the AsyncTask and I'm even using one in a list with images already. But I don't understand what a WeakReference is. I gather is is a garbage collector directive, but I thought I didn't need to manage garbage collection on Android. http://developer.android.com/reference/java/lang/ref/WeakReference.html isn't as helpful as I was hoping it would be. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 we start application after installing .apk file
You can't start your application. Neither service nor activity. The only ugly workaroung I can offer is: 1. Have your other application already installed on the device. 2. Subscribe to receive PACKAGE_INSTALLED broadcast. 3. Check if broadcated unstalled package is your application that needs to be autostarted. 4. If it is, send appropriate intent for it to start. On Jul 21, 3:44 pm, A N K ! T ankit.awasth...@gmail.com wrote: i am trying to make application run just after installing it. -- Thanks Ankit Awasthi -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 cannot be played (but Audio is?!) - Video Track fell behind?
I believe you, Mark, but I must profess this is a little counter- intuitive. After all, the same PC will play much more demanding video (higher resolution, fancier codes, etc.) running Windows Media Player or Linux's Totem, so why can't the emulator handle it? Is there really that much overhead in the emulation process? The Wikipedia page on QEMU makes it sound like their method of emulating the ARM should be very efficient, even on Intel CPUs. But as I said, it is only a -little- counter-intuitive: it only takes a little thought to see how much work might be going on in that emulation, even though the bulk of the MediaPlayer is native code. On Jul 22, 6:42 pm, Mark Murphy mmur...@commonsware.com wrote: Unless you have a rather fast PC (like, oh, a quad-core), the emulator will not play back video very well. On Thu, Jul 22, 2010 at 9:17 PM, Victoria Busse victoriasarabu...@gmail.com wrote: No device yet, only emulator (although tomorrow or at the beginning of next I will have an HTC Wildfire, so my app should be running on that) The file format is .mp4 -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.1 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: SQLiteOpenHelper per activity??
Passing data from Activity to Activity is what ContentProviders are good at; they even let you pass from application to application. On Jul 22, 5:24 pm, Zsolt Vasvari zvasv...@gmail.com wrote: You cannot pass a SQLiteDatabase object from activity to activity. Perhaps you could store it in a global static, but I think that's not a good idea. On Jul 22, 11:18 pm, ecforu ecforus...@gmail.com wrote: But what's the reason for not keeping it open? Or actually a better question is why do is my database dependent on an activity at all? These are two totally different pieces to the puzzle (i.e. as in an MVC pattern or similar design). On Wed, Jul 21, 2010 at 8:29 PM, Zsolt Vasvari zvasv...@gmail.com wrote: I never keep an actualy SQLiteDatabase object around ever. In all my activities, I create a helper object and obtain the SQLDatabase object which I keep around throwing away the helper object. And I make sure that I close the database in my activities' onDestroy method. On Jul 22, 4:07 am, ecforu ecforus...@gmail.com wrote: Do I need an instance of my SQLiteOpenHelper class for each Activity I have? I have 1 currently that all activities access, but started getting an exception illegal state exception SQLiteDatabase created and never closed on simple a simple query and I can't seem to figure out why this is happening. I read online about this, and wanted to try to understand why the SQLiteOpenHelper was dependent on an Activity. Is there a way to just have open SQLiteDatabase object without the Helper and have it just exist within all activities? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-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] AndroidHttpTransport.call() blocking too much time when using KSOAP in Android
Hi All, I am trying to use the KSOAP in Android, i have the function as below. Sometimes the calling of androidHttp.call(GETVERSION_ACTION, envelope); will return the reponse very fast. But some times it take me almost one minutes for this AndroidHttpTransport.call get return. That means AndroidHttpTransport.call() may block for almost one minutes. I have checked the http package deliver between my client and server. The HTTP post package send almost one minutes after the time AndroidHttpTransport.call() be scheduled. So the block time should be no relationship with network or http server. It blocks the most part of time before it start to sent the HTTP post package. Also getVersion() will be called in multi-thread. Does this will effect the AndroidHttpTransport.call() function a lot? Any one comment will be very appreciated. public static String getVersion(){ String version; Log.i(TAG,getVersion); AndroidHttpTransport androidHttp = new AndroidHttpTransport(URL); //androidHttp.debug = true; androidHttp.setXmlVersionTag(?xml version=\1.0\ encoding= \UTF-8\?); Log.i(TAG,new SoapObject()); SoapObject request = new SoapObject(NAMESPACE, GETVERSION_METHOD); Log.i(TAG,addProperty); request.addProperty(v, 1,2); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.dotNet = true; envelope.implicitTypes = true; envelope.setOutputSoapObject(request); try { Log.i(TAG,androidHttp.call()); androidHttp.call(GETVERSION_ACTION, envelope); SoapPrimitive result = (SoapPrimitive)envelope.getResponse(); //Log.i(TAG,Reponse dump:+androidHttp.responseDump); //to get the data version = result.toString(); Log.i(TAG,***envelope.getResponse():+version); }catch (Exception e) { e.printStackTrace(); return null; } return version; } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 2d canvas game: FPS Jitter problem
Robert I sent you an email with the APK =) On Jul 22, 3:43 pm, Robert Green rbgrn@gmail.com wrote: Cameron, Are you using time-based movement or frame-based? Would you mind sending me an APK? I can check it out for you and maybe help out a little with some suggestions. On Jul 22, 3:16 pm, Cameron cameron.m.john...@gmail.com wrote: Thanks for the reply Matt, I have used the DDMS in Eclipse to see if there is any GC that happens and nothing that belongs to my thread. There are some but those are by the Android system itself. I have also optimized the hell out of this game following all of the examples from google and other forums. I do exaclty what you said with the adding new monsters example on the go but it doesn't seem to great any GC events. I will preload them like you suggested and see what happens. Also I will try to use the uptimeMillis(). Right now im using now = System.currentTimeMillis(); On Jul 22, 1:07 pm, Matt matthew.quig...@gmail.com wrote: Well, it sounds like the frame rate goes down intermittently because of the garbage collector. First of all, you should not be doing any object creation during your game loop. This way there is never any need for a GC. 1. Create all of your objects before hand. For example, Monster[] mMonsters = new Monster[Monster.MAX]; setup() { for (int i = 0; i mMonsters.length; i++) { mMonsters[i] = new Monster(); mMonsters[i].used = false; } ...} Instead of creating a new monster every time one comes into play, just set its used flag to true (and set it to false, instead of deleting it, when the monster is done). 2. Use android.os.SystemClock.uptimeMillis() when limiting your FPS. Basically what you want to do is keep track of each game tick, and if it hasn't been 1/30 seconds yet, sleep for the remaining time. 3. Google java game optimization. -Matt On Jul 22, 3:46 pm, Cameron cameron.m.john...@gmail.com wrote: I based my game off of the lunar lander demo, although heavily modified, and I can get around 40-50fps but the problem is it fluctuates between 40-50fps so much that it causes the moving graphics to jitter! Its very annoying and makes my game look really shitty when in fact its running at a good frame rate. I tried setting the thread priority higher but that just made it worse... now it will fluctuate between 40-60fps... I was thinking of limiting the FPS to about 30 so that it will be constant. Is this a good idea and does anyone else have experience or a different solution? Thanks! PS: If you have an example of limiting or creating constant FPS that would be helpful. I've tried it before but never got it quite right. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: Resolution Problem in Nexus One
Dianne, thanks for your help, however, is there any possible way to specify application language rather than setting locale manually? On Jul 23, 9:03 am, Dianne Hackborn hack...@android.com wrote: This has nothing to do with your manifest. You are blowing away the current configuration in the resources with your own you have created that is not initialized. Things aren't going to work when you do that. You could improve that by giving it a properly created Configuration, but I don't want to help with doing that because what you are trying to do is never going to work quite right because you will be fighting with the platform over what configuration is being used in the resources. On Thu, Jul 22, 2010 at 10:57 PM, Engin Arslan enginarsla...@gmail.comwrote: Webnet, As I said in my question I tried following in my androidmanfest.xml but it did not work. supports-screens android:smallScreens=true android:normalScreens=true android:largeScreens=true android:anyDensity=true / I think problem is updating configuration as Dianne said however I do not alternative way of specifiying application language Can anyone suggest me better way? On Jul 21, 2:46 pm, Webnet Android webnet.andr...@gmail.com wrote: On 21 July 2010 13:24, Engin Arslan enginarsla...@gmail.com wrote: any suggestions?? http://adrianvintu.com/blogengine/post/Force-Locale-on-Android.aspx -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] need help in selection of text in TextView
Hello Everyone, I have a Text View in my application and I want to select text from that text view and i want the starting ending position of that selected text so can anyone please help me. Regards, Brijesh Masrani -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Youtube API : SAXParser error
Hi, I am fairly new to working on the android platform. I did put in a comment over the issue. Also, here's my LogCat: 07-23 07:19:01.890: ERROR/dalvikvm(353): Could not find method javax.xml.parsers.SAXParserFactory.getSchema, referenced from method com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory $SecureSAXParserFactory.getSchema 07-23 07:19:01.900: WARN/dalvikvm(353): VFY: unable to resolve virtual method 24379: Ljavax/xml/parsers/SAXParserFactory;.getSchema ()Ljavax/ xml/validation/Schema; 07-23 07:19:01.900: WARN/dalvikvm(353): VFY: rejecting opcode 0x6e at 0x0002 07-23 07:19:01.900: WARN/dalvikvm(353): VFY: rejected Lcom/google/ gdata/util/common/xml/parsing/SecureGenericXMLFactory $SecureSAXParserFactory;.getSchema ()Ljavax/xml/validation/Schema; 07-23 07:19:01.900: WARN/dalvikvm(353): Verifier rejected class Lcom/ google/gdata/util/common/xml/parsing/SecureGenericXMLFactory $SecureSAXParserFactory; On Jul 23, 10:38 am, Kumar Bibek coomar@gmail.com wrote: This error would mean that you are missing some dependencies. The patch that you are using might be dependent on some other classes which you do not have already. You can comment on the issue and see if you get any response. Thanks and Regards, Kumar Bibekhttp://tech-droid.blogspot.com On Jul 22, 8:30 pm, Ashish ashish1...@gmail.com wrote: Hi, I have been trying to use the youtube APIs on the Android Platform (version 1.6) and have been stuck with the SAXParser whenever I send out a query from the following line of code: VideoFeed videoFeed = service.query(query, VideoFeed.class); I initially had errors with the SAXParser for which I applied the patch suggested here :https://code.google.com/p/android/issues/detail?id=9493 After this, the previous error that I had which called an ExternalParametersEntities exception was resolved but I now get a Verify Error : com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory $SecureSAXParserFactory Would anyone know how to get around this error? Is there any other way to use the youtube api query on an android platform? Regards, Ashish Mody -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: Speech to Text (STT) Support on Android Keyboard
Hi Niral, I'm also currently researching on STT. Here's the required link on android's official website: http://developer.android.com/resources/articles/speech-input.html There is a sample available in the latest sdk for API level 8 as well. Have you tried that out? Maqsood http://www.twitter.com/maxood On Jul 22, 11:33 am, Niral Shah niralhs...@gmail.com wrote: We have a 2.1 sdk(eclair) version Samsung device, which has virtual keyboard with a microphone indicator to support speech to text (STT). Our application is mostly a text entry application and uses Inputconnection class and committext method to recognize the inputs and put all the entered text on display. In swype input mode, if we press the microphone, the voice recognition automatically runs(shows recording interface, records, synthesizes and sends text to commit text, and hence it is working. However, for Android keyboard input , the recording interface automatically shows up, however, we do not receive committext callback, so nothing is updated on our text box after the recording. So, seems we have 2 options: 1. Disable only the mike/microphone keys visibility on the Android keypad. How can this be done? 2. Have the STT to work on the Android keyboard. Seems that the keypad is automatically starting a recording interface - hence we do not know how to even integrate the voice recognition program given in the sdk 2.1 examples VoiceRecognition.java file. How can we detect the microphone/mike key was pressed? Or how can we do this? Please suggest/provide feedback on any of the options above. Any information will be very helpful. Best Regards, Niral -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 dialog only deactivate part of screen
Dear All, Here is my question- I have an activity that shows data fetched data from internet. While the data is being fetched currently i am showing a dialog. My problem is that while dialog is being shown it puts entire activity (i mean the whole screen) to background. Is there a possibility in android where my dialog only disables some part of the screen and rest of the screen remains active and can handle actions done on it. Thanks in advance Amit -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 dialog only deactivate part of screen
No, not possible. -Kumar Bibek On Jul 23, 12:35 pm, Amit amitmishr...@gmail.com wrote: Dear All, Here is my question- I have an activity that shows data fetched data from internet. While the data is being fetched currently i am showing a dialog. My problem is that while dialog is being shown it puts entire activity (i mean the whole screen) to background. Is there a possibility in android where my dialog only disables some part of the screen and rest of the screen remains active and can handle actions done on it. Thanks in advance Amit -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: broadcast receiver issue
You have to register the receivers in each of the activities. -Kumar Bibek http://tech-droid.blogspot.com On Jul 23, 11:12 am, Sandeep sandeep.phanse...@gmail.com wrote: Hi All, I am working on one project where i am using broadcast receiver in one of my activity to capture the incomming call and its works fine. when one of my other activity is open and that time if call is come then my broadcast receiver is fail to respond. can any one help me for this ? or its nessesorry to declare broadcast receiver in all my activity to do some comman task. thanks regards sandeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: broadcast receiver issue
no, just declare your receiver in the manifest. On Fri, Jul 23, 2010 at 12:40 AM, Kumar Bibek coomar@gmail.com wrote: You have to register the receivers in each of the activities. -Kumar Bibek http://tech-droid.blogspot.com On Jul 23, 11:12 am, Sandeep sandeep.phanse...@gmail.com wrote: Hi All, I am working on one project where i am using broadcast receiver in one of my activity to capture the incomming call and its works fine. when one of my other activity is open and that time if call is come then my broadcast receiver is fail to respond. can any one help me for this ? or its nessesorry to declare broadcast receiver in all my activity to do some comman task. thanks regards sandeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] MediaPlayer RTSP Playback Issue
We are developing a RTSP player on Android. Our server will stream the RTP packets and MediaPlayer will play the video. The problem we are facing is as follows: Whenever the media player starts playing video, it will play only for 5-6 seconds and then it will spend the next 10-12 seconds to buffer to 100% before playing for next 5-6 seconds. So this indicates that buffering and playback are mutually exclusive processes. I do see the following line in the log file WARN/AudioFlinger: Write blocked for nn ms The number nn ranges for 40 to 80. Is there anyway we can make the buffering and playback parallel (Ideally it should be parallel). Am I missing something very obvious? Has anyone faced such issue before? Thanks in advance for any help. - Sanjay -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: Id values for AlertDialog.Builder created buttons
Hi again, Ive now found the solution I was after which was there all the time. Was just looking in the wrong place. AlertDialog has a method getButton() which returns the requested Button View object. Interestingly though this method only works when onCreateDialog() and showDialog() have returned otherwise it returns null. Regards, A On Jul 22, 1:17 pm, Andy a...@fendley.com wrote: Many thanks for that. Ive already thought of those solutions but with regard to accessing via debugger inspection the id value may not be constant in future implementations of android. I was looking for a programmatic method of accessing them or by use of an android specified id value. Like the TreKing app by the way...very powerful. Im working with a wayfinding company looking at map creation technologies, mobile mapping apps around other cities such as London. A On Jul 22, 5:31 am, TreKing treking...@gmail.com wrote: On Wed, Jul 21, 2010 at 1:19 AM, Andy a...@fendley.com wrote: I want to access the buttons for validation purposes so I can enable the 'save' button but only when correct input has been entered in EditText View. Ah. Well, you could step through the debugger and navigate the view of the dialog to see if you can find the button ids that way. If that doesn't work, you can always create your own view with your own ID'ed buttons that you can control as you wish. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Play Sound File
Look up in the documentation for android.media.MediaPlayer on the android website. Also go through this documentation as well: http://developer.android.com/reference/android/media/MediaPlayer.html Maqsood http://twitter.com/maxood On Jul 21, 11:57 pm, Monali jain.mon...@gmail.com wrote: Hi, can we play sound file in phone line (in background)?? Please help me Thanks in Advance Monali -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 use repaint() method in Android...
I'm not sure but I think that if you use invalidate(), onDraw function will be called. On 22 jul, 10:18, blessu76 bless...@gmail.com wrote: Hi If i use repaint() method.I got error message. What is the solution for that.Can we use repaint() in android.If not what is the alternate solution for it? 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
Re: [android-developers] Re: Video cannot be played (but Audio is?!) - Video Track fell behind?
so it should work with a quad core?? Well, too bad that I got one with 6GB RAM and it still doesn't...if this is still not strong enough, that would be really really bad :( Well I guess then it is more of a performance and efficiency question in the app itself On Fri, Jul 23, 2010 at 7:48 AM, Indicator Veritatis mej1...@yahoo.comwrote: I believe you, Mark, but I must profess this is a little counter- intuitive. After all, the same PC will play much more demanding video (higher resolution, fancier codes, etc.) running Windows Media Player or Linux's Totem, so why can't the emulator handle it? Is there really that much overhead in the emulation process? The Wikipedia page on QEMU makes it sound like their method of emulating the ARM should be very efficient, even on Intel CPUs. But as I said, it is only a -little- counter-intuitive: it only takes a little thought to see how much work might be going on in that emulation, even though the bulk of the MediaPlayer is native code. On Jul 22, 6:42 pm, Mark Murphy mmur...@commonsware.com wrote: Unless you have a rather fast PC (like, oh, a quad-core), the emulator will not play back video very well. On Thu, Jul 22, 2010 at 9:17 PM, Victoria Busse victoriasarabu...@gmail.com wrote: No device yet, only emulator (although tomorrow or at the beginning of next I will have an HTC Wildfire, so my app should be running on that) The file format is .mp4 -- Mark Murphy (a Commons Guy)http://commonsware.com| http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.1 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.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Reflection of class members
Hello all, If I have a class like below: class A{ private ArrayListB mList; } How do I to invoke the methods of mList member? Such as add, remove, clear and so forth. Thanks in advance. NightGospel -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: hi
I agree with Frank to read the android official documentation first. After finishing it, you will be familiar with android main concepts and android application design guidelines. It's much helpful. NightGospel On 7月23日, 上午7時01分, Frank Weiss fewe...@gmail.com wrote: Then go to the documentationhttp://developer.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] How to update pre-installed apps
Hi all, I am working on an app that will be shipped on some phones. I have been thinking about how to update them once a new version is ready. How that would work for a pre-installed app? As an initial thought I think I could pop up a message letting the user know there is a new version ready, but if I could avoid unnecessary request to the server it would be better. If a google engineer comes across this please give me a hint as you do this for Google Maps... 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: To display the soft keyboard during the launch itself
no it didnot work :( am working in android sdk 2.2 my manifest is ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.android.keyboard android:versionCode=1 android:versionName=1.0 application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.sample android:label=@string/app_name android:windowSoftInputMode=stateAlwaysVisible intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity /application /manifest please help me .. Thanks Harshe On Jul 23, 5:51 am, Matt matthew.quig...@gmail.com wrote: http://developer.android.com/guide/topics/manifest/activity-element.h... On Jul 22, 8:54 am, harshe hars...@gmail.com wrote: i have an activity with few edit text views and a button. TheSoft Keyboardis visible when I click the edit text view. But i want the softkeyboardto be visible during the launch itself , without clicking the edit text itself i must get thesoftkeyboardon the screen. Can anyone plzzz help me out in 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] external jar problem --java.lang.verifyerror
Hi, I have a build a android application which works fine. After that, I create a jar file from that project for other applications to use. I added the jar as external jar for other application. It can compile correctly. However, when it runs, I always get the error Jave.lang.verifyError. What might be the problem. I have struggled for days. Thank you for the help. Cindy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: broadcast receiver issue
thanks All [?] @Agus : can u plz expalin me how to do that in my project there are 5 classes -- 4 class file extend *Activity* -- mainly they display user interaction screen -- 1 class file extends *BroadcastReceiver -- *capture the incomming call and display/ launch the one of the activity. -- if one of the Activity class Screen is open and call is come then at that point BroadcastReceiver* *is fail to launch the activity so how i do this ? thanks sandeep On Fri, Jul 23, 2010 at 1:13 PM, Agus agus.sant...@gmail.com wrote: no, just declare your receiver in the manifest. On Fri, Jul 23, 2010 at 12:40 AM, Kumar Bibek coomar@gmail.com wrote: You have to register the receivers in each of the activities. -Kumar Bibek http://tech-droid.blogspot.com On Jul 23, 11:12 am, Sandeep sandeep.phanse...@gmail.com wrote: Hi All, I am working on one project where i am using broadcast receiver in one of my activity to capture the incomming call and its works fine. when one of my other activity is open and that time if call is come then my broadcast receiver is fail to respond. can any one help me for this ? or its nessesorry to declare broadcast receiver in all my activity to do some comman task. thanks regards sandeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en330.gif
Re: [android-developers] Mount USB Drive
u can use linux mount command directly avail in /system/etc regards On Tue, Jul 13, 2010 at 2:39 PM, perumal316 perumal...@gmail.com wrote: Hi All, I want my application to automatically mount the phone into USB storage drive if USB cable is connected. Is there code to do it? I tried searching but couldn't find any info on it. Thanks In Advance, Perumal -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Strange or blank emails from users emailing from market
Hi, I am getting several weird emails a day from users who have clicked on the 'send email to developer' link in the Market app where either the mail has not contents or is just rubbish such as zbxnbcvnxbnb Are other devs getting similar and is this just users typing rubbish accidentally or is this another problem with the market interface? PuzzleQube - the 3D picture puzzle Grey Knotts Software - www.greyknotts.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: Change Menu on the fly
Thanks to all your suggestions. but i took Kumars version, this is really easy to implement and is working very smoothly :) On Jul 23, 8:05 am, Kumar Bibek coomar@gmail.com wrote: If it's an Options menu, from the docs it is clear that onCreate will only be called the first time. But if you want to control the items in the runtime, you should also override the onPrepareOptionsMenu. In this method, you can add or remove any items when the menu is triggered. -Kumar Bibekhttp://tech-droid.blogspot.com On Jul 22, 11:15 pm, Joseph Earl joseph.w.e...@gmail.com wrote: What kind of menu do you mean? An options menu, context menu, gridview etc On Jul 22, 4:05 pm, drill sebastianar...@hotmail.com wrote: Hi, I have a Gallery with a couple of photos, which is working really great. but now i like to have a menu which is sensetive for the picture which is shown currently. So for pic1 i like to have menu1 for pic2 i wanna have menu2, etc . How would I achive this goal? Anyone had similar issues? Thanks a lot. ragrds -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: broadcast receiver issue
Even if you declare the receiver in the manifest, you have to register that receiver in each of your activities if you want to receive specific intents. Declaring only in the manifest just ensures that your receiver gets called, but it wont pass on that broadcast to your Activities unless you register for those events. -Kumar Bibek http://tech-droid.blogspot.com On Jul 23, 2:26 pm, Sandeep Phansekar sandeep.phanse...@gmail.com wrote: thanks All [?] @Agus : can u plz expalin me how to do that in my project there are 5 classes -- 4 class file extend *Activity* -- mainly they display user interaction screen -- 1 class file extends *BroadcastReceiver -- *capture the incomming call and display/ launch the one of the activity. -- if one of the Activity class Screen is open and call is come then at that point BroadcastReceiver* *is fail to launch the activity so how i do this ? thanks sandeep On Fri, Jul 23, 2010 at 1:13 PM, Agus agus.sant...@gmail.com wrote: no, just declare your receiver in the manifest. On Fri, Jul 23, 2010 at 12:40 AM, Kumar Bibek coomar@gmail.com wrote: You have to register the receivers in each of the activities. -Kumar Bibek http://tech-droid.blogspot.com On Jul 23, 11:12 am, Sandeep sandeep.phanse...@gmail.com wrote: Hi All, I am working on one project where i am using broadcast receiver in one of my activity to capture the incomming call and its works fine. when one of my other activity is open and that time if call is come then my broadcast receiver is fail to respond. can any one help me for this ? or its nessesorry to declare broadcast receiver in all my activity to do some comman task. thanks regards sandeep -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en 330.gif 1KViewDownload -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: Charts in Android
Thanks for the reply. The Pie chart that i want is implement is of 50*50 PX size. The aChartEngine is fine, but was not able to customize its size, labels copy write logo. So just meet my req. using drawArc and drawCircle. On Jul 22, 10:59 am, Paul Turchenko paul.turche...@gmail.com wrote: Yeah. If you need to draw just a siple chart you're good with aChart, But as soon as you plan to support multiplecharts, user interaction, styling, etc., you're better off with aiCharts. On Jul 22, 1:59 am, Zsolt Vasvari zvasv...@gmail.com wrote: I use aChartEngine. It's not too full featured, but it is lightweight (39K .jar), free (upfront and royalty) and it's easy to use. Depending on your requirement, it might be suitable. On Jul 22, 5:07 am, Paul Turchenko paul.turche...@gmail.com wrote: Visithttp://www.artfulbits.com/Android/aiCharts.aspxforaiCharts. Right now aiCharts is the only one professional solution forAndroid. aiCharts is optimized for use on mobile devices. Low memory and CPU consumption allow long phone battery life. aiCharts aware of all mobile platform limitations and makes you forget about them. aiCharts does not use any low level native libraries and is 100% safe forAndroidOS users, as it runs in completely safe managed environment of Dalvik Java VM. On Jul 21, 4:40 pm, veradis veradism...@gmail.com wrote: Hi, I want display pie chart inandroid. Is there is any chart API or JARs available. Regards Veradis- 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] ACTION_DATE_CHANGED broadcast delayed
Hi, In our app we rely on ACTION_DATE_CHANGED broadcast to update some app elements (we register receiver in service). However we observed that ACTION_DATE_CHANGED is not broadcasted (or received by our app) immediately after date change and experiment shown even 5 minutes delay after either manual date change (via system prefs) or automatic (on midnights). Anyone aware of such problem? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Reflection of class members
1) You should never need reflect for your own classes, just add getter and setter methods 2) If you need reflect for the APIs to enable a feature a non-critical feature on newer devices see http://android-developers.blogspot.com/2009/04/backward-compatibility-for-android.html On Jul 23, 9:37 am, NightGospel wutie...@gmail.com wrote: Hello all, If I have a class like below: class A{ private ArrayListB mList; } How do I to invoke the methods of mList member? Such as add, remove, clear and so forth. Thanks in advance. NightGospel -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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] locale change does not affect menu
Hi all, I am developing application in which user can choose application language. To achieve this, I am changing Locale as follows: Locale locale = new Locale(language code here); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale = locale; getBaseContext().getResources().updateConfiguration(config, getResources().getDisplayMetrics()); and restart activity in following way: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); . This helps to change languagein runtime. However , option menu language does not change , in fact menu changes if I close app completely and start again but does not change in runtime. I even have tried onPrepareOptionsMenu but it did not work? What is the reason of this? or can you suggest me another possible way? Bests, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: Necessary to close SQLite database?
1) You can restrict access to your ContentProvider to only your application or suite of applications by setting the authority 2) I thought it was overkill myself when first reading about it. However after following this pattern I must say its much neater (especially when loading cursors in threads) and had the handy side effect getting rid of any errors about closing/opening databases I had. From what I can tell, when you open a database from within an Activity Android expects you to close it. However this can become very difficult if you have more than one activity that uses the database, especially if you need to perform re-queries every time onResume is called to update the data. On Jul 23, 1:29 am, Zsolt Vasvari zvasv...@gmail.com wrote: I think that's an overkill for a simple database. I thought the main reason for a ContentProvider was to make your data available to an external entity. You need to close the database as you cannot pass an open database connection between activities, as far as I can tell. On Jul 23, 6:32 am, Joseph Earl joseph.w.e...@gmail.com wrote: I agree it's not well documented what to do when opening/closing the DB from within an activity. Instead implement a ContentProvider which opens your database and provides access to it. Your activities will then never need to worry about opening/closing the DB. On Jul 22, 3:54 pm, Doug Gordon gordo...@gmail.com wrote: I've seem some conflicting posts on this, so will ask it simply here. Is it really necessary to close an SQLite database that your activity has opened (database is in local memory or on SD card)? I would think it would be good practice, but I noticed that the Android samples such as the Notepad tutorial and SearchableDictionary sample do not do this. I've also seen sample code where the database is consistently opened, read from, and closed, but that would seem to add unnecessary overhead. Doug Gordon GHCS Systems- 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: Android 2d canvas game: FPS Jitter problem
Just what I was thinking. For games you should never use frame-based animation, and for time-based animation FPS changes shouldn't matter too match since you just draw more or less frames depending on how much the device can handle. On Jul 22, 11:43 pm, Robert Green rbgrn@gmail.com wrote: Cameron, Are you using time-based movement or frame-based? Would you mind sending me an APK? I can check it out for you and maybe help out a little with some suggestions. On Jul 22, 3:16 pm, Cameron cameron.m.john...@gmail.com wrote: Thanks for the reply Matt, I have used the DDMS in Eclipse to see if there is any GC that happens and nothing that belongs to my thread. There are some but those are by the Android system itself. I have also optimized the hell out of this game following all of the examples from google and other forums. I do exaclty what you said with the adding new monsters example on the go but it doesn't seem to great any GC events. I will preload them like you suggested and see what happens. Also I will try to use the uptimeMillis(). Right now im using now = System.currentTimeMillis(); On Jul 22, 1:07 pm, Matt matthew.quig...@gmail.com wrote: Well, it sounds like the frame rate goes down intermittently because of the garbage collector. First of all, you should not be doing any object creation during your game loop. This way there is never any need for a GC. 1. Create all of your objects before hand. For example, Monster[] mMonsters = new Monster[Monster.MAX]; setup() { for (int i = 0; i mMonsters.length; i++) { mMonsters[i] = new Monster(); mMonsters[i].used = false; } ...} Instead of creating a new monster every time one comes into play, just set its used flag to true (and set it to false, instead of deleting it, when the monster is done). 2. Use android.os.SystemClock.uptimeMillis() when limiting your FPS. Basically what you want to do is keep track of each game tick, and if it hasn't been 1/30 seconds yet, sleep for the remaining time. 3. Google java game optimization. -Matt On Jul 22, 3:46 pm, Cameron cameron.m.john...@gmail.com wrote: I based my game off of the lunar lander demo, although heavily modified, and I can get around 40-50fps but the problem is it fluctuates between 40-50fps so much that it causes the moving graphics to jitter! Its very annoying and makes my game look really shitty when in fact its running at a good frame rate. I tried setting the thread priority higher but that just made it worse... now it will fluctuate between 40-60fps... I was thinking of limiting the FPS to about 30 so that it will be constant. Is this a good idea and does anyone else have experience or a different solution? Thanks! PS: If you have an example of limiting or creating constant FPS that would be helpful. I've tried it before but never got it quite right. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: WebView in ListView
Yup. Just don't do it. You can parse HTML into a TextView using Html.fromHtml(String string) if you are loading data from HTML content, or use a RelativeLayout to layout a bunch of Text/ImageViews etc. On Jul 23, 6:36 am, Kumar Bibek coomar@gmail.com wrote: WebViews are pretty heavy components. I don't see a situation where a WebView cannot be replaced by a text view or a combination of other compoenents. I still think this is a bad idea. I am sure, you wouldn't be running scripts inside those web view items in your list, or do you? Thanks and Regards, Kumar Bibekhttp://tech-droid.blogspot.com On Jul 23, 8:59 am, Ken ken0624...@gmail.com wrote: I've implemented a list with each item as a WebView. The WebViews are loaded in their own threads so the UI doesn't have to wait. The problem I've ran into is after the list is loaded, some webview items disappears or repeat after the list is scrolled. I've read posts from Romain Guy and others about how this is a bad idea. Just wondering if it's still a bad idea or a solution has been found since Cupcake. Thanks! Ken -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: TouchEvent... A BIG problem
Thanks for the clarification. Not sure where I picked up that misinformation on distinguishable points. On Jul 22, 11:01 pm, Dianne Hackborn hack...@android.com wrote: Full multitouch is supported from when the APIs appeared -- API 5. multiple distinguishable touch points is a hardware limitations (some screen sensors don't support two completely separate touches at the same time). You can determine this based on the feature defined in PackageManager. On Thu, Jul 22, 2010 at 1:41 PM, Joseph Earl joseph.w.e...@gmail.comwrote: API Level 4 and below support only a single touch pointer officially. API Level 5 - 7 support multiple indistinguishable touch points (for instance if you place one finger down, then a second one, then raise one of your fingers Android can detect a finger has been raised, but does not know which one) API Level 8 supports multiple distinguishable touch points (up to 256 I believe) So yes from API level 5 onwards you can implement a Multi-Touch application on Android. On Jul 21, 9:16 pm, gizmor gilam...@gmail.com wrote: Hi, I'm new to Android, and I love it! I was wondering how many touch are possible at the same time? The user click and drag (move) and while he's dragging he clicks again (Other finger) and drag it too.. mmm, piano (multi touched) app... (with dragging)... is that possible? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: TouchEvent... A BIG problem
Also you might want to note that actually Android 1.5 does support multiple (well 2) touch points (it's not documented though) Sadly as far as I can tell Android 1.6 is the only version (post 1.1) that multi-touch won't work on. On Jul 22, 11:01 pm, Dianne Hackborn hack...@android.com wrote: Full multitouch is supported from when the APIs appeared -- API 5. multiple distinguishable touch points is a hardware limitations (some screen sensors don't support two completely separate touches at the same time). You can determine this based on the feature defined in PackageManager. On Thu, Jul 22, 2010 at 1:41 PM, Joseph Earl joseph.w.e...@gmail.comwrote: API Level 4 and below support only a single touch pointer officially. API Level 5 - 7 support multiple indistinguishable touch points (for instance if you place one finger down, then a second one, then raise one of your fingers Android can detect a finger has been raised, but does not know which one) API Level 8 supports multiple distinguishable touch points (up to 256 I believe) So yes from API level 5 onwards you can implement a Multi-Touch application on Android. On Jul 21, 9:16 pm, gizmor gilam...@gmail.com wrote: Hi, I'm new to Android, and I love it! I was wondering how many touch are possible at the same time? The user click and drag (move) and while he's dragging he clicks again (Other finger) and drag it too.. mmm, piano (multi touched) app... (with dragging)... is that possible? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] HTTP Live Streaming / playing .M3U8 or .TS files on Android
Hi! Does anybody know if and how it is possible to play .M3U8 video content on Android devices? According to the documentation at http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/HTTPStreamingArchitecture/HTTPStreamingArchitecture.html#//apple_ref/doc/uid/TP40008332-CH101-SW2 the video files usually contain H264 and AAC content, and both are supported by Android - but I don't get the samples on http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html#//apple_ref/doc/uid/TP40008332-CH102-DontLinkElementID_22 to run. Do you have an idea? Thanks in advance Marc Reichelt || http://www.marcreichelt.de/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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] dithering gradient on different devices
Hi all, In my activity i have simple grey gradient ?xml version=1.0 encoding=utf-8? shape xmlns:android=http://schemas.android.com/apk/res/android; android:shape=rectangle gradient android:startColor=#323232 android:endColor=#909090 android:angle=270 / /shape and i use as background of some view. The problem is that the gradient looks pretty banding. After searching i found some solutions and posts about this problem but none of them works the way i want. http://stackoverflow.com/questions/2928101/android-using-linear-gradient-as-background-looks-banded http://stackoverflow.com/questions/2791045/is-it-possible-to-dither-a-gradient-drawable/3316793#3316793 http://stuffthathappens.com/blog/2010/06/04/android-color-banding/ http://android.amberfog.com/?p=247 The only i could smooth the gradient on htc tatoo was to set getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER) which dithers the whole window not only the gradient which is not what i want. Setting android:dither=true and calling from Java GradientDrawable.setDither(true) has no effect. On nexus one getWindow().setFormat(PixelFormat.RGBA_) but on devices that don't have 8-bits per color i have to set FLAG_DITHER so what is the correct way to smooth gradient. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: Launching an activity using Linkify
Top answer. Thanks for that. Now just need a neat and tidy way of passing arguments into the activity being called. On Jul 22, 9:21 pm, Matt matthew.quig...@gmail.com wrote: Yes. 1. Create a class which inherits ClickableSpan. See URLSpan for an example. 2. Your action will go into onClick() of this class. 3. Set the text with setSpan(). I have an example here, although this is using a URLSpan, you would need to change URLSpan to your custom ClickableSpan class. /** * Adapted from the {...@link android.text.util.Linkify} class. Changes the * first instance of {...@code link} into a HTTP link with the given {...@code * url}. */ public static void linkify(TextView view, final String link, final String url) { CharSequence text = view.getText(); String string = text.toString(); URLSpan span = new URLSpan(url); int start = string.indexOf(link); int end = start + link.length(); if (start == -1) return; if (text instanceof Spannable) { ((Spannable) text).setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } else { SpannableString s = SpannableString.valueOf(text); s.setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); view.setText(s); } // Adapted from Linkify.addLinkMovementMethod(), to make links clickable // MovementMethod m = view.getMovementMethod(); if ((m == null) || !(m instanceof LinkMovementMethod)) { view.setMovementMethod(LinkMovementMethod.getInstance()); } } On Jul 22, 3:13 pm, angushir...@googlemail.com angushir...@yahoo.co.uk wrote: Dear all, I'm not sure if this can be done, but is it possible to launch an activity from text that has been Linkified? I'm basically providing an illustrated glossary, and when the user clicks on a highlighted term, I want the activity that handles display of the image and associated text to fire up. I also need to pass in some parameters to the activity being launched. Thanks for any help Angus -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 Socket Communication
I like to make a multi-player game on android like chess, checkers,etc. and shall look forward to updates on this thread. Looking for feedback on multi-player games. Thanks On Jul 20, 9:37 am, stephan dkn...@googlemail.com wrote: First question: Generally you could distinguish the applications by using different port numbers of each end of the communication. BUT: Whouldn't it be better to use the Android inter-process communication like Serializable objects and intents? Second question: Implemet a service in one of the appllications. The service will be available even if any UI activity is in the backgground. BUT: you have to take care that the system knows that the service is still in use / not in use any more... On 19 Jul., 19:50, Arjun arjunf...@gmail.com wrote: Please clarify me on the following issues. How to assign a IP address to the emulator ? I have two application packages which communicate through sockets. Apk1 implements a server socket and apk2 listens to the server content and read the responses. How can I run two different apk's simultaneously so that android does not kill any one of those app's ? Thanks, Arjun. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: external jar problem --java.lang.verifyerror
Most likely would be a mismatch between the jars used in the compile and those on the system that's loading the application. Very common with XML classes, among others. Another vague possibility is that the compiler being used is producing bytecodes that Android doesn't implement. This might happen if you're using a very early version of Java, or a very recent one. (But then you'd expect the application to not work at all on Android, vs not working when combined with others.) On Jul 23, 4:08 am, cindy ypu01...@yahoo.com wrote: Hi, I have a build a android application which works fine. After that, I create a jar file from that project for other applications to use. I added the jar as external jar for other application. It can compile correctly. However, when it runs, I always get the error Jave.lang.verifyError. What might be the problem. I have struggled for days. Thank you for the help. Cindy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: locale change does not affect menu
Specifically, menu language changes to English (which is default language) when I try to change locale. And then it does not change any other language On Jul 23, 2:18 pm, Engin Arslan enginarsla...@gmail.com wrote: Hi all, I am developing application in which user can choose application language. To achieve this, I am changing Locale as follows: Localelocale= newLocale(language code here); Locale.setDefault(locale); Configuration config = new Configuration(); config.locale=locale; getBaseContext().getResources().updateConfiguration(config, getResources().getDisplayMetrics()); and restart activity in following way: setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); . This helps to change languagein runtime. However , optionmenulanguage does not change , in factmenuchanges if I close app completely and start again but does not change in runtime. I even have tried onPrepareOptionsMenu but it did not work? What is the reason of this? or can you suggest me another possible way? Bests, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 is a WeakReference?
Yes, you must guard any use of the WeakReference by taking the ref() of it, testing that for null, and then proceeding to use the result of the ref() if not null. The size of the guarded sections is up to the programmer -- if too large then the object will never get deleted, if too small then the code gets chopped up. On Jul 23, 1:37 am, Indicator Veritatis mej1...@yahoo.com wrote: You left out something very important: the code hidden under // reload the image must not assume that it is not itself interrupted by yet another call to the garbage collector. That is, instead of simply continuing to use the soft/weak reference, it should make a strong reference to the same object, allowing this latter reference to either go out of scope or be set to null when it is done. But if we are making this strong reference, what was the point of using the weak/soft reference in the first place? Ah, that is the tricky thing about using them. Depending on when you can make and release the strong reference, they might not buy you much; they might not buy you anything at all. That is why they are not recommended for much outside of caches and normalized mappings. On Jul 22, 11:07 am, Joseph Earl joseph.w.e...@gmail.com wrote: Suppose you had a long list of images. As the user scrolled down you load the images from the net, and then display them. To avoid having to reload the images again if the user scrolls back up, you put the images in a cache (probably something like a MapString, Drawable) However because it is a long list you don't want to run into an out of memory situation if the user scrolls very far down and lots of images are put in the cache. So instead of storing the Drawables directly in the map, you create a MapString, WeakReferenceType (although I would use SoftReference for the purpose described here). This means that if Android is going to encounter an out of memory situation it will clear all of the Soft/Weak references (and thus hopefully avoid running out of memory). You will have to load the images again since your cache has been cleared, but this is far better than your application running out of memory and crashing. So you do something like: // caching an image MapString, SoftReference cache = new HashMapString, SoftReferenceDrawable(); cache.put(http://mysite.com/images/1.jpg;, new SoftReferenceDrawable.put(myDrawable)); // retrieve an image if (cache.containsKey(url)) { // looks like we have this image cached Drawable drawable = cache.get(url).get(); if (drawable == null) { // the softreference has been cleared by the GC, reload the image } else { // softreference is still valid, got our image } } Essentially a weak reference is a weaker reference than a soft reference - the GC should free weak references to regain memory before soft references. I think that's (mostly) correct, hope it helps. On Jul 22, 6:48 pm, GodsMoon godsm...@gmail.com wrote: Google just posted a new blog post onhttp://android-developers.blogspot.com/2010/07/multithreading-for-per I understand the AsyncTask and I'm even using one in a list with images already. But I don't understand what a WeakReference is. I gather is is a garbage collector directive, but I thought I didn't need to manage garbage collection on Android. http://developer.android.com/reference/java/lang/ref/WeakReference.html isn't as helpful as I was hoping it would be. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: OutOfMemoryError with Bitmap
Hi again, I'm trying to put a message when the image is so big. For this I think to obtain the size of the file and compare it with the free memory Runtime.getRuntime().getFreeMemory()). It works well but I have a new problem. The application show an error message with some images because they are so big and the application dont't detect the problem. I research in other posts and the problem is that the file size is different from the size of the image in memory. To get the size of the image in memory I use the product getHeight () * getRowBytes () of the Bitmap class, but with some images not previously had problems, I get very large sizes, so often I get the message erroneously. Does anyone know how could solve this problem? Thank you very much 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: Regarding the new BackupManager
If the backup transport is not available on the device, then is it possible to provide a backup transport by the Android Backup Service? If the service is not providing any backup Transport then the backup operation is not happened on the device?? To do this operation is it necessary to login into google account on the device?? On Jul 20, 12:56 am, Mark Murphy mmur...@commonsware.com wrote: Agreed -- this appears to be a firmware-level change, not an SDK-level change. On Mon, Jul 19, 2010 at 2:42 PM, Al alcapw...@googlemail.com wrote: I would like to know this also. There doesn't seem to be any api for this that I can find. david wrote: Is it possible to create my own backup transport for my own cloud service I offer? -- Mark Murphy (a Commons Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.1 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: dithering gradient on different devices
I generally use a 'proxy' XML drawable to add dithering. Suppose your drawable above was named grad.xml, I'd then create something like: ?xml version=1.0 encoding=utf-8? shape xmlns:android=http://schemas.android.com/apk/res/android; android:src=@drawable/grad android:dither=true / and name it grad_proxy.xml. Then use @drawable/grad_proxy in place of @drawable/grad. You shouldn't need to use any extra Java code, the XML above should work as is. On Jul 23, 12:59 pm, manigault manig...@gmail.com wrote: Hi all, In my activity i have simple grey gradient ?xml version=1.0 encoding=utf-8? shape xmlns:android=http://schemas.android.com/apk/res/android; android:shape=rectangle gradient android:startColor=#323232 android:endColor=#909090 android:angle=270 / /shape and i use as background of some view. The problem is that the gradient looks pretty banding. After searching i found some solutions and posts about this problem but none of them works the way i want.http://stackoverflow.com/questions/2928101/android-using-linear-gradi...http://stackoverflow.com/questions/2791045/is-it-possible-to-dither-a...http://stuffthathappens.com/blog/2010/06/04/android-color-banding/http://android.amberfog.com/?p=247 The only i could smooth the gradient on htc tatoo was to set getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER) which dithers the whole window not only the gradient which is not what i want. Setting android:dither=true and calling from Java GradientDrawable.setDither(true) has no effect. On nexus one getWindow().setFormat(PixelFormat.RGBA_) but on devices that don't have 8-bits per color i have to set FLAG_DITHER so what is the correct way to smooth gradient. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 could I avoid others to get my used pictures in my application?
1) If you store your images in your drawable folder, then they shouldn't be accessible outside of your application 2) If you store images on the SD card then they will be available to all applications that know where they are On Jul 23, 12:04 am, Frank Weiss fewe...@gmail.com wrote: The way I look at it is that if you are going to use some pictures in your application, then the people using your application are going to have to get those pictures -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 function call trace on android phones?
Do we need the source code of the apps to do this tracing? If I don't have the source code, will it work? On Jul 23, 4:49 am, fadden fad...@android.com wrote: On Jul 21, 5:53 am, Shuo Deng dengshuoama...@gmail.com wrote: Is there any tool that can get longer trace? Do you think we can write a debugger by ourselves and attach it to the VM? The JDK includes a sample JDI program called trace that might do what you want: http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/technotes/... You might need to add the remote-attach feature. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 Material
Thank you both very much for your suggestions and help. I went through this tutorial: http://code.google.com/p/android-gl/downloads/detail?name=AndroidGL-0.4.zipcan=2q= And it seems my problem has been enabling GL_COLOR_MATERIAL. I had enabled this because I was using textures at one point, but apparently this interferes with materialfv. I suppose I need to enable it just for the triangles that use a texture, draw them, then disable it so it doesn't interfere with the other non-textured triangles. I guess I'll be back when that doesn't work :). Cheers, David On Jul 23, 9:47 am, Indicator Veritatis mej1...@yahoo.com wrote: And having reviewed ch. 5 myself, I see you did remember to set and use the normals after all. Good! But two things stand out: 1) your emissivity values are the default, so you should be able to omit that call completely 2) your R, G, B values (for the material) are all quite close to each other. No wonder it looks gray. Try using an R value about half G and B and you should see a genuine color. On Jul 22, 12:13 pm, Indicator Veritatis mej1...@yahoo.com wrote: I don't know the complete answer to your predicament off the top of my head, but it sounds like you are leaving out some steps for deciding the final color: a review of the famous Red Book, chapter 4 5, the latter of which makes the highly relevant observation, Part of this computation [final pixel color] depends on what lighting is used in the scene and on how objects in the scene reflect or absorb that light Note the word 'part'; it takes more than just the combination of Lightfy and Materialfy to set the final color. The Red Book is athttp://www.glprogramming.com/red/. I know the edition is quite old, but it turns out to be quite up to date for the version of Open GL (1.3) assumed by OpenGL ES 1.x. On Jul 22, 1:16 am, dsl dsl...@gmail.com wrote: Thanks for the link. I've used glColorf and that seems to work, but it was my understanding that a combination of glLightfv and glMaterialfv would also set the color. Cheers, David On Jul 21, 5:53 pm, jojoma thanat...@gmail.com wrote: I don't know much of OpenGL too, but I think your triangle is getting the color gray because it has no color itself, and your lights are gray. check this tutorial, might help you get some pointers:http://blog.jayway.com/2010/01/14/opengl-es-tutorial-for-android-%E2%... On Jul 21, 12:55 am, dsl dsl...@gmail.com wrote: Hello all, I'm fairly new to OpenGL ES and am having a heck of a time trying to get my material to show up. Right now all I'm looking at is a shaded gray rotating triangle. At least it looks shaded (light and dark parts), but now color other than gray. I've posted my code here: The triangle coordinates, normals, and material:http://code.google.com/p/davidslamb/downloads/detail?name=Manual.java The renderer:http://code.google.com/p/davidslamb/downloads/detail?name=regularRend... I'm using ambient, diffuse, and emission to create the material. And ambient and diffuse for the light. I'm testing on a G1 running Android 1.6. Any insight will be helpful. Cheers, David -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 Material
Scratch that, I don't remember why I was enabling GL_COLOR_MATERIAL. I think it was from a different example I was looking at that used color arrays. Teach myself not to leave code laying around. On Jul 23, 9:54 pm, dsl dsl...@gmail.com wrote: Thank you both very much for your suggestions and help. I went through this tutorial:http://code.google.com/p/android-gl/downloads/detail?name=AndroidGL-0... And it seems my problem has been enabling GL_COLOR_MATERIAL. I had enabled this because I was using textures at one point, but apparently this interferes with materialfv. I suppose I need to enable it just for the triangles that use a texture, draw them, then disable it so it doesn't interfere with the other non-textured triangles. I guess I'll be back when that doesn't work :). Cheers, David On Jul 23, 9:47 am, Indicator Veritatis mej1...@yahoo.com wrote: And having reviewed ch. 5 myself, I see you did remember to set and use the normals after all. Good! But two things stand out: 1) your emissivity values are the default, so you should be able to omit that call completely 2) your R, G, B values (for the material) are all quite close to each other. No wonder it looks gray. Try using an R value about half G and B and you should see a genuine color. On Jul 22, 12:13 pm, Indicator Veritatis mej1...@yahoo.com wrote: I don't know the complete answer to your predicament off the top of my head, but it sounds like you are leaving out some steps for deciding the final color: a review of the famous Red Book, chapter 4 5, the latter of which makes the highly relevant observation, Part of this computation [final pixel color] depends on what lighting is used in the scene and on how objects in the scene reflect or absorb that light Note the word 'part'; it takes more than just the combination of Lightfy and Materialfy to set the final color. The Red Book is athttp://www.glprogramming.com/red/. I know the edition is quite old, but it turns out to be quite up to date for the version of Open GL (1.3) assumed by OpenGL ES 1.x. On Jul 22, 1:16 am, dsl dsl...@gmail.com wrote: Thanks for the link. I've used glColorf and that seems to work, but it was my understanding that a combination of glLightfv and glMaterialfv would also set the color. Cheers, David On Jul 21, 5:53 pm, jojoma thanat...@gmail.com wrote: I don't know much of OpenGL too, but I think your triangle is getting the color gray because it has no color itself, and your lights are gray. check this tutorial, might help you get some pointers:http://blog.jayway.com/2010/01/14/opengl-es-tutorial-for-android-%E2%... On Jul 21, 12:55 am, dsl dsl...@gmail.com wrote: Hello all, I'm fairly new to OpenGL ES and am having a heck of a time trying to get my material to show up. Right now all I'm looking at is a shaded gray rotating triangle. At least it looks shaded (light and dark parts), but now color other than gray. I've posted my code here: The triangle coordinates, normals, and material:http://code.google.com/p/davidslamb/downloads/detail?name=Manual.java The renderer:http://code.google.com/p/davidslamb/downloads/detail?name=regularRend... I'm using ambient, diffuse, and emission to create the material. And ambient and diffuse for the light. I'm testing on a G1 running Android 1.6. Any insight will be helpful. Cheers, David -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: dithering gradient on different devices
Thanks for the reply :). But when i create grad_proxy.xml like this and use it as android:background nothing is shown android can't load grad_proxy and shows default background. On Fri, Jul 23, 2010 at 3:33 PM, Joseph Earl joseph.w.e...@gmail.comwrote: I generally use a 'proxy' XML drawable to add dithering. Suppose your drawable above was named grad.xml, I'd then create something like: ?xml version=1.0 encoding=utf-8? shape xmlns:android=http://schemas.android.com/apk/res/android; android:src=@drawable/grad android:dither=true / and name it grad_proxy.xml. Then use @drawable/grad_proxy in place of @drawable/grad. You shouldn't need to use any extra Java code, the XML above should work as is. On Jul 23, 12:59 pm, manigault manig...@gmail.com wrote: Hi all, In my activity i have simple grey gradient ?xml version=1.0 encoding=utf-8? shape xmlns:android=http://schemas.android.com/apk/res/android; android:shape=rectangle gradient android:startColor=#323232 android:endColor=#909090 android:angle=270 / /shape and i use as background of some view. The problem is that the gradient looks pretty banding. After searching i found some solutions and posts about this problem but none of them works the way i want. http://stackoverflow.com/questions/2928101/android-using-linear-gradi...http://stackoverflow.com/questions/2791045/is-it-possible-to-dither-a...http://stuffthathappens.com/blog/2010/06/04/android-color-banding/http://android.amberfog.com/?p=247 The only i could smooth the gradient on htc tatoo was to set getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER) which dithers the whole window not only the gradient which is not what i want. Setting android:dither=true and calling from Java GradientDrawable.setDither(true) has no effect. On nexus one getWindow().setFormat(PixelFormat.RGBA_) but on devices that don't have 8-bits per color i have to set FLAG_DITHER so what is the correct way to smooth gradient. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- When I raise my flashing sword, and my hand takes hold on judgment, I will take vengeance upon mine enemies, and I will repay those who haze me. Oh, Lord, raise me to Thy right hand and count me among Thy saints. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: Have a problem in ListView please help ?
It doesn't really make sense for a ListView to have it's height to wrap_content since a ListView allows you to put in more items than will fit on-screen. It can have a height set to a fixed value, e.g. 300px or 200dip, but not wrap_content. You should never really need to stack lists vertically on-top of or within each other (there are a few exceptions to this, but as a general rule). You should read up more on the ListView component and layout params. Just use different types of list items (a ListView can have many different types of items) and different levels (in theory you could extend ExpandableListView to have as many tiers/levels as you wanted). If you stack ListViews on top of each other (with a fixed height), you'll only be able to fit 5-7 in on a normal device, and each one will only be able to show about one item at a time. What you probably want is an Expandable ListView, with the group items showing the Album/Artist name, and then when these are expanded they will reveal all of the songs in that album. On Jul 23, 6:36 am, sagare sagar.ekb...@gmail.com wrote: Hi Joseph, thanks for your reply but u mean to say i cant have multiple ListViews in an activity with height wrap_content i think that should be possile right ? Also i dont want to have an expanded List i want a have a list of albums and each album displaying songs without needing for the user to expand a node also i want a gap / space between 2 albums List. Please help me with this Thanks, Sagar On Jul 22, 11:11 pm, Joseph Earl joseph.w.e...@gmail.com wrote: Okay: A ListView must have it's height set to fill_parent - the only way to have multiple ListViews in a single activity is to use something like Tabs, a ViewFlipper etc, and even then this only really deals with one visible ListView at a time (or possibly two horizontally). What you probably want to do is implement a two-tier ExpandableListView in a similar fashion to the default Android music player (at least on 2.0+) this lets you have a group item for e.g. for an album, which when expanded shows all songs in that album. On Jul 22, 4:11 pm, sagare sagar.ekb...@gmail.com wrote: Hi All, I am creating a list of albums and each album can have multiple songs. So I wanted to is having multiple listviews on a screen ok (around 30-35 albums each having their songs) performance wise and wont create a problem ? Or i should implement a single list of albums where each item in the list displays entire contents of that album including its songs? Not sure how much good it is performance wise and from user experience point of view ? Also if i go by this approach would each songs in the album clickable because as far as i know a complete row in a ListView can be clickable and not individual components in a ListRow ? How can i go about implementing this ? Please let me know the best possible solution to implement this. and the approach for this. Thanks and regards, Sagar -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: SQLiteOpenHelper per activity??
Does anyone have a easy example to setup the ContentProvider and a psuedo helper object for use with a ListView? I would be interested in seeing that. Thank you in advance On Jul 23, 1:50 am, Indicator Veritatis mej1...@yahoo.com wrote: Passing data from Activity to Activity is what ContentProviders are good at; they even let you pass from application to application. On Jul 22, 5:24 pm, Zsolt Vasvari zvasv...@gmail.com wrote: You cannot pass a SQLiteDatabase object from activity to activity. Perhaps you could store it in a global static, but I think that's not a good idea. On Jul 22, 11:18 pm, ecforu ecforus...@gmail.com wrote: But what's the reason for not keeping it open? Or actually a better question is why do is my database dependent on an activity at all? These are two totally different pieces to the puzzle (i.e. as in an MVC pattern or similar design). On Wed, Jul 21, 2010 at 8:29 PM, Zsolt Vasvari zvasv...@gmail.com wrote: I never keep an actualy SQLiteDatabase object around ever. In all my activities, I create a helper object and obtain the SQLDatabase object which I keep around throwing away the helper object. And I make sure that I close the database in my activities' onDestroy method. On Jul 22, 4:07 am, ecforu ecforus...@gmail.com wrote: Do I need an instance of my SQLiteOpenHelper class for each Activity I have? I have 1 currently that all activities access, but started getting an exception illegal state exception SQLiteDatabase created and never closed on simple a simple query and I can't seem to figure out why this is happening. I read online about this, and wanted to try to understand why the SQLiteOpenHelper was dependent on an Activity. Is there a way to just have open SQLiteDatabase object without the Helper and have it just exist within all activities? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-Hidequoted 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] How to detect whether my code is being executed on the UI thread?
I have an AIDL service that is intended to be used by both out-of- process remote users and in-process local users. As a result, my common interface methods will either be invoked on the UI thread or in a binder background thread. The logic between the two is not the same. How do I distinguish between these two cases? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: Routing audio input to bluetooth headset
Thanks a lot. That worked. On Jul 22, 8:40 pm, Phil pds...@gmail.com wrote: In 2.2, check out android.media.AudioManager: startBluetoothSco() and setBluetoothScoOn() One thing to watch out for, however, is: If you pair up a bluetooth headset, and start the SCO connection to record the bluetooth input, any phone calls you take will now control the bluetooth connection. On Jul 22, 10:58 am, Garima garimasrivastava.gar...@gmail.com wrote: Is it possible to record an audio (not a phone call) using the bluetooth input and not the device microphone? I am able to playback whatever am saying through device's mic but am not able to figure out how to use the bluetooth mic instead. Any assistance would be greatly 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
Re: [android-developers] How to detect whether my code is being executed on the UI thread?
On Fri, Jul 23, 2010 at 8:18 AM, Jin Chiu live2drea...@gmail.com wrote: How do I distinguish between these two cases? http://groups.google.com/group/android-developers/browse_thread/thread/ccc923ae7783e51/5a0d0cf105b68127 http://groups.google.com/group/android-developers/browse_thread/thread/ccc923ae7783e51/5a0d0cf105b68127 - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Reflection of class members
On Fri, Jul 23, 2010 at 3:37 AM, NightGospel wutie...@gmail.com wrote: How do I to invoke the methods of mList member? mList.add(...); mList.remove(...); mList.clear(); And so forth. What does this have to do with reflection? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: ItemizedOverlay using both onTap methods
Hello MArk, I used your NooYawk example to help build my code. I'm just having some issues changing the appearance of the onTap overlay. Is it possible to change it from a TableLayout to a RelativeLayout? This XML is sometimes complicated. I just wanted to appear some sort of box in the center with information and buttons, and when Tap outside the box the box disappears, and if tapped in another item another box and so on. At this point I have the information appearing on the screen and being overlaid with each other, its a little bit confusing. On Jul 10, 7:02 pm, Brad Gies rbg...@gmail.com wrote: Hi Pedro, There are several ways to do it, but you probably want to do it when you create the overlay. If you are not using the overlayItem tag for anything else, just set the tag to the Geopoint, and then you can access it by casting the tag to a Geopoint after you get the item in the code below. As I said, there are lots of other ways.. but that is normally my preferred way, because it keeps the information you want with the item. On 08/07/2010 9:28 AM, Pedro Teixeira wrote: Is there anyway to get the values that created this overlay and compare them with the values of GeoPoint geo ? My code is aproximmating values so I never get the numbers right... I don't know which values can I use from the onTap method to compare with the ones that created the overlay itself besides the latitude and longitude values... protected boolean onTap(int i) { OverlayItem item=getItem(i); GeoPoint geo=item.getPoint(); Point pt=map.getProjection().toPixels(geo, null); View view=panel.getView(); ((TextView)view.findViewById(R.id.latitude)) .setText(String.valueOf(geo.getLatitudeE6()/100.0)); ((TextView)view.findViewById(R.id.longitude)) .setText(String.valueOf(geo.getLongitudeE6()/100.0)); ((TextView)view.findViewById(R.id.x)) .setText(String.valueOf(pt.x)); ((TextView)view.findViewById(R.id.y)) .setText(String.valueOf(pt.y)); panel.show(pt.y*2map.getHeight()); return(true); } On Jul 5, 2010, at 11:03 PM, Mark Murphy wrote: On Mon, Jul 5, 2010 at 5:58 PM, Pedro Teixeira pedroteixeir...@gmail.com mailto:pedroteixeir...@gmail.com wrote: Any news on how to implement this ? Is overriding the class that extends itemizedOverlay on the onTap method enough? I need to show information when the user clicks a marker and cant seem to find possibilities Here are examples of how I've done it: http://github.com/commonsguy/cw-android/tree/master/Maps/NooYawk/ http://github.com/commonsguy/cw-advandroid/tree/master/Maps/EvenNooer... -- Mark Murphy (a Commons Guy) http://commonsware.com|http://github.com/commonsguy http://commonsware.com/blog|http://twitter.com/commonsguy Android Consulting:http://commonsware.com/consulting -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 Pedro Teixeira www.pedroteixeira.orghttp://www.pedroteixeira.org -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Sincerely, Brad Gies --- Bistro Bot - Bistro Blurbhttp://www.bgies.comhttp://www.bistroblurb.comhttp://www.ihottonight.com --- Never doubt that a small group of thoughtful, committed people can change the world. Indeed. It is the only thing that ever has - Margaret Mead -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: Charts in Android
You can definitely customize the size, labels in AChartEngine. There is no copyright logo in AChartEngine. Regards, Dan On Jul 23, 1:33 pm, veradis veradism...@gmail.com wrote: Thanks for the reply. The Pie chart that i want is implement is of 50*50 PX size. The aChartEngine is fine, but was not able to customize its size, labels copy write logo. So just meet my req. using drawArc and drawCircle. On Jul 22, 10:59 am, Paul Turchenko paul.turche...@gmail.com wrote: Yeah. If you need to draw just a siple chart you're good with aChart, But as soon as you plan to support multiplecharts, user interaction, styling, etc., you're better off with aiCharts. On Jul 22, 1:59 am, Zsolt Vasvari zvasv...@gmail.com wrote: I use aChartEngine. It's not too full featured, but it is lightweight (39K .jar), free (upfront and royalty) and it's easy to use. Depending on your requirement, it might be suitable. On Jul 22, 5:07 am, Paul Turchenko paul.turche...@gmail.com wrote: Visithttp://www.artfulbits.com/Android/aiCharts.aspxforaiCharts. Right now aiCharts is the only one professional solution forAndroid. aiCharts is optimized for use on mobile devices. Low memory and CPU consumption allow long phone battery life. aiCharts aware of all mobile platform limitations and makes you forget about them. aiCharts does not use any low level native libraries and is 100% safe forAndroidOS users, as it runs in completely safe managed environment of Dalvik Java VM. On Jul 21, 4:40 pm, veradis veradism...@gmail.com wrote: Hi, I want display pie chart inandroid. Is there is any chart API or JARs available. Regards Veradis- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: ItemizedOverlay using both onTap methods
On Fri, Jul 23, 2010 at 10:25 AM, Pedro Teixeira pedroteixeir...@gmail.com wrote: I used your NooYawk example to help build my code. I'm just having some issues changing the appearance of the onTap overlay. Is it possible to change it from a TableLayout to a RelativeLayout? NooYawk does not use a TableLayout. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.9 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
Re: [android-developers] Re: ItemizedOverlay using both onTap methods
On Fri, Jul 23, 2010 at 15:25, Pedro Teixeira pedroteixeir...@gmail.comwrote: Hello MArk, I used your NooYawk example to help build my code. I'm just having some issues changing the appearance of the onTap overlay. Is it possible to change it from a TableLayout to a RelativeLayout? This XML is sometimes complicated. I just wanted to appear some sort of box in the center with information and buttons, and when Tap outside the box the box disappears, and if tapped in another item another box and so on. At this point I have the information appearing on the screen and being overlaid with each other, its a little bit confusing. That's what I have on Farmácias. Check http://github.com/r3pek/Farmacias/blob/master/src/org/r3pek/pharmacies/PharmaciesOverlay.java to see if it helps you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: ItemizedOverlay using both onTap methods
On Fri, Jul 23, 2010 at 9:25 AM, Pedro Teixeira pedroteixeir...@gmail.comwrote: Is it possible to change it from a TableLayout to a RelativeLayout? Sure, why not? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: ItemizedOverlay using both onTap methods
The popup.xml isn't a table layout? On Jul 23, 2010, at 3:31 PM, Mark Murphy wrote: On Fri, Jul 23, 2010 at 10:25 AM, Pedro Teixeira pedroteixeir...@gmail.com wrote: I used your NooYawk example to help build my code. I'm just having some issues changing the appearance of the onTap overlay. Is it possible to change it from a TableLayout to a RelativeLayout? NooYawk does not use a TableLayout. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.9 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 Pedro Teixeira www.pedroteixeira.org -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: ItemizedOverlay using both onTap methods
Thanks Carlos, I'll take a look just now ;) On Jul 23, 2010, at 3:32 PM, Carlos Silva wrote: On Fri, Jul 23, 2010 at 15:25, Pedro Teixeira pedroteixeir...@gmail.com wrote: Hello MArk, I used your NooYawk example to help build my code. I'm just having some issues changing the appearance of the onTap overlay. Is it possible to change it from a TableLayout to a RelativeLayout? This XML is sometimes complicated. I just wanted to appear some sort of box in the center with information and buttons, and when Tap outside the box the box disappears, and if tapped in another item another box and so on. At this point I have the information appearing on the screen and being overlaid with each other, its a little bit confusing. That's what I have on Farmácias. Check http://github.com/r3pek/Farmacias/blob/master/src/org/r3pek/pharmacies/PharmaciesOverlay.java to see if it helps you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en Pedro Teixeira www.pedroteixeira.org -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: WebView in ListView
If those html pages you want to display contain JavaScript, you might want to use one webview and then iFrames, which would give you the same effect without overloading the system with multiple instances of webview. Kind of web-appy, but if that's the effect you're looking for, this method might work for you. -John Coryat -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 is a WeakReference?
I think the difference in the code I've written in the past was I was referring to a window progress bar and not an independent view in the onPostExecute. That's why I was getting a Null Pointer when the activity was killed. I'm starting to get a grasp on this stuff. Clearly I don't know how the GC works. Thanks for the links guys. I'll keep reading. David Shellabarger www.nightshadelabs.com On Jul 22, 5:26 pm, GodsMoon godsm...@gmail.com wrote: Perhaps the difference was because I was declaring my view in the onCreate method instead of in the onPostExecute method of the AsyncTask? If I declare the view in my activity, maybe it gets GCed when my activity is killed, but in the blog post example he tries to declare it in the AsyncTask even though the activity is long gone. Am I on the right track here? David Shellabargerwww.nightshadelabs.com On Jul 22, 4:09 pm, Joseph Earl joseph.w.e...@gmail.com wrote: I am confused somewhat about the issue myself now. Hopefully someone else it will clear it up once and for all. On Jul 22, 9:01 pm, GodsMoon godsm...@gmail.com wrote: I have done something like that and got a null pointer reference. I was starting a AsyncTask and if you backed out of the activity before the AsyncTask was finished I would get a null pointer when I tried to refer to the activities elements (force close). So I just check to see if the views are null first. I thought that if it returned null then it must have been GCed. But that's not the case? David Shellabargerwww.nightshadelabs.com On Jul 22, 3:49 pm, Joseph Earl joseph.w.e...@gmail.com wrote: When your UI activity is killed as far as I am aware the GC will collect your Views. The problem is (I think) if the GC closes your UI thread while the downloader is still running - in this case your downloader thread maintains a reference to the ImageView so the GC cannot collect it - hence memory leak - the downloader thread cannot actually do anything to the ImageView since the UI thread no longer exists. Thus the downloader thread should only store a weak reference to the ImageView so that if the UI thread is killed the GC may reclaim the memory associated with the ImageView. On Jul 22, 8:34 pm, GodsMoon godsm...@gmail.com wrote: The blog post is confusing. Note that this ImageView is stored as a WeakReference, so that a download in progress does not prevent a killed activity's ImageView from being garbage collected. I didn't know that would cause a memory leak. I thought the garbage collector would clean up ImageView if its activity gets killed. Am I wrong? David Shellabargerwww.nightshadelabs.com On Jul 22, 3:06 pm, Joseph Earl joseph.w.e...@gmail.com wrote: No. I'm unsure as to what to use a WeakReference for exactly - as Romain Guy said above it is too weak for this purpose, but I think (hopefully Romain will correct me if I'm wrong) that a SoftReference could be suitable for this purpose. A ListView already does efficient management of your Views by recycling. This means that you must ensure the correct details are set in the view each time getView is called, even if you do not inflate a view or call findViewById that time. Recycling does not mean that the ListView caches all your items or their content. Suppose you had a list of 10 items, all of the same type but only 5 will fit on the screen at a time. The ListView only really needs 5 views to show the rows since the other 5 won't be visible. Thus at the top of the list the ListView might use 'View 1' for the first item, but scroll down to the bottom and 'View 1' would now contain item 6. As far as I understand it this is recycling. Recycling does not take care of the amount time of it takes to get content and set it to the view - thus if it takes a long time to get a piece of information and display it in a list item (such as downloading an image from the web), you will want to cache the result in a way that does not adversely affect memory usage (as much as possible). In this case you will also want to use a Thread or Async task to download/get the info off the UI thread. On Jul 22, 7:36 pm, GodsMoon godsm...@gmail.com wrote: So you'd only want to use WeakReference when you think your activity might run out of memory? But a list view already does efficient memory management for you right? You'd saying if I were create a large array or something like that then it would be good to use WeakReference. right? Thanks for the help guys, David Shellabargerwww.nightshadelabs.com On Jul 22, 2:26 pm, Romain Guy romain...@android.com wrote: You definitely do NOT want to use a WeakReference to
[android-developers] Re: Strange or blank emails from users emailing from market
I thought it was just odd users who like to press random keys, or perhaps monkeys trying to write the complete works in the Library of Congress. I get a few a day as well. Didn't know the source, it could be the market. -John Coryat -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: SQLiteOpenHelper per activity??
The Notebook sample application contains a simple ContentProvider and a list of Notes. That lives here: http://developer.android.com/resources/samples/NotePad/index.html On Jul 23, 9:09 am, gcstang gcst...@gmail.com wrote: Does anyone have a easy example to setup the ContentProvider and a psuedo helper object for use with a ListView? I would be interested in seeing that. Thank you in advance On Jul 23, 1:50 am, Indicator Veritatis mej1...@yahoo.com wrote: Passing data from Activity to Activity is what ContentProviders are good at; they even let you pass from application to application. On Jul 22, 5:24 pm, Zsolt Vasvari zvasv...@gmail.com wrote: You cannot pass a SQLiteDatabase object from activity to activity. Perhaps you could store it in a global static, but I think that's not a good idea. On Jul 22, 11:18 pm, ecforu ecforus...@gmail.com wrote: But what's the reason for not keeping it open? Or actually a better question is why do is my database dependent on an activity at all? These are two totally different pieces to the puzzle (i.e. as in an MVC pattern or similar design). On Wed, Jul 21, 2010 at 8:29 PM, Zsolt Vasvari zvasv...@gmail.com wrote: I never keep an actualy SQLiteDatabase object around ever. In all my activities, I create a helper object and obtain the SQLDatabase object which I keep around throwing away the helper object. And I make sure that I close the database in my activities' onDestroy method. On Jul 22, 4:07 am, ecforu ecforus...@gmail.com wrote: Do I need an instance of my SQLiteOpenHelper class for each Activity I have? I have 1 currently that all activities access, but started getting an exception illegal state exception SQLiteDatabase created and never closed on simple a simple query and I can't seem to figure out why this is happening. I read online about this, and wanted to try to understand why the SQLiteOpenHelper was dependent on an Activity. Is there a way to just have open SQLiteDatabase object without the Helper and have it just exist within all activities? Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en-Hidequotedtext - - Show quoted text -- Hide quoted text - - Show quoted text - -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to detect whether my code is being executed on the UI thread?
Unfortunately, that post does not address my question. If my service is getting called out-proc, runOnUIThread() will post an asynchronous message on the UI thread's message queue, which is not want I want. If my code is being invoked on a background thread, I need additional logic to post the message, wait, and wakeup once the that message is serviced. Essentially, 2 completely different code paths that cannot be wrapped by a single Runnable object. I really need something that returns a boolean flag indicating whether we're on the UI thread. On Jul 23, 10:12 am, TreKing treking...@gmail.com wrote: On Fri, Jul 23, 2010 at 8:18 AM, Jin Chiu live2drea...@gmail.com wrote: How do I distinguish between these two cases? http://groups.google.com/group/android-developers/browse_thread/threa... http://groups.google.com/group/android-developers/browse_thread/threa... --- -- TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Draw rectangle.
On Fri, Jul 23, 2010 at 9:44 AM, ranjan ar ranjan@gmail.com wrote: I want to draw a rectangle, simple rectangle . And then I want to start drawing series of rectangles on the x axis (which can be imaginary). Please reply to the whole group. Look at the various draw() functions in View and look at the Canvas class. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: What is a WeakReference?
On Jul 23, 2:37 am, Indicator Veritatis mej1...@yahoo.com wrote: You left out something very important: the code hidden under // reload the image must not assume that it is not itself interrupted by yet another call to the garbage collector. That is, instead of simply continuing to use the soft/weak reference, it should make a strong reference to the same object, allowing this latter reference to either go out of scope or be set to null when it is done. You are referring to the code that Joseph Earl wrote above. That code snippet is NOT a proper way to use weak references; that cache should be using soft references. On the other hand, in the example blog post referred to by the OP, which uses weak references, that IS a proper way to use weak references. The main Activity already has a strong reference to the objects. The secondary thread does not need to create a strong reference; in fact, that would make the weak reference useless. But if we are making this strong reference, what was the point of using the weak/soft reference in the first place? Ah, that is the tricky thing about using them. Depending on when you can make and release the strong reference, they might not buy you much; they might not buy you anything at all. That is why they are not recommended for much outside of caches and normalized mappings. You are referring to a soft reference, not a weak reference. Soft references are good for caches. Weak references are definitely recommended for the idea given in the article, where the main thread has a strong reference, and the background thread has a weak reference. That way if the main thread is killed (i.e. the app is finished), if the background thread is still running then it won't prevent the weakly referenced objects from being destroyed. I also hate to throw this bit of information into the mix, but it should be known that Android will kill your process, and hence background threads anyways, when all your main threads have been destroyed (i.e. all your activities are finished, and there aren't any services running). This means that, even if you did have a background thread running, it would be killed, implying that weak references wouldn't help because everything is going to get killed anyways. That being said, there are still circumstances where the weak references matter: just because one activity is finished, doesn't mean all of your app's activities are necessarily finished. So it would be good if you went from your main activity into another sub-activity which began a download. But then the user presses back, because they don't want to bother waiting on the download. In that case your main activity is still alive, but the background thread is working on the sub-activity that was already finished. If that background thread had weak references, then that background thread would no longer be holding on to the resources of the sub-activity with strong references, and the system could GC those resources already, before the background thread dies. -Matt -Matt -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: To display the soft keyboard during the launch itself
You might get it to work if you request the focus for EditText on creation. Either add editText.requestFocus() in your onCreate(), or add a requestFocus/ tag inside the EditText's XML layout. EditText requestFocus/ /EditText -Matt On Jul 23, 4:52 am, harshe hars...@gmail.com wrote: no it didnot work :( am working in android sdk 2.2 my manifest is ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.android.keyboard android:versionCode=1 android:versionName=1.0 application android:icon=@drawable/icon android:label=@string/ app_name activity android:name=.sample android:label=@string/app_name android:windowSoftInputMode=stateAlwaysVisible intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity /application /manifest please help me .. Thanks Harshe On Jul 23, 5:51 am, Matt matthew.quig...@gmail.com wrote: http://developer.android.com/guide/topics/manifest/activity-element.h... On Jul 22, 8:54 am, harshe hars...@gmail.com wrote: i have an activity with few edit text views and a button. TheSoft Keyboardis visible when I click the edit text view. But i want the softkeyboardto be visible during the launch itself , without clicking the edit text itself i must get thesoftkeyboardon the screen. Can anyone plzzz help me out in 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] Droid Motorola
I have an app, in which part of its job is to mute and unmute the microphone, for some reason this is working fine in all mobiles except for Motorola Droid, can some one help me? audioService.setMicrophoneMute(true); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android Rectangle
Hello all, can you help me explain how to draw a rectangle and bring it up in the middle of screen. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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] Possible to create a transparent, headless activity?
Is it possible for my ActivityA to launch a transparent, headless ActivityB in a way that it does not prevent user interaction with ActivityA? Currently, when I start ActivityB, Android pushes a blank screen that prevents the user from interacting with the underlying Activity. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] need help in selection of text in TextView
On Fri, Jul 23, 2010 at 2:21 AM, brijesh masrani.brij...@gmail.com wrote: I have a Text View in my application and I want to select text from that text view and i want the starting ending position of that selected text Have you looked at the TextView documentation? Have you tried anything so far? Because a quick look at TextView documentation shows several functions that probably do exactly what you want. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Sms hiding and deletion
I am working on the same topic. Actually I am not able to do it, but I found that a developer has already done it. Check for SMS Guard on the market. I tried to get in touch with the developer, but he hasn't answered yet. On 8 Lug, 20:08, Usama usama...@gmail.com wrote: i am currently making an application in which i require to delete ansms. How do i go about it. Also I may need to hide asmsi.e not visible in the inbox but i may choose to unhide it later. How do i do that ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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] a list of a different kind
I want a listview, first of all i dont want selectable, just as a table display i wanna use it. second, i want custom drawing in it, like some cell yellow background, some cell red i also want variable height row. means row 1 might have 3 items row 2 might have 7 items. please point me to some examples where i can do this kind of work regards -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to set priorities for multiple BroadcastReceivers when dealing with ordered intent broadcast?
On Thu, Jul 22, 2010 at 11:32 PM, Agus agus.sant...@gmail.com wrote: How do you set priority # for dynamically instantiated broadcast receivers? Call setPriority() on the IntentFilter. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.9 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: What is a WeakReference?
The main Activity already has a strong reference to the objects. The secondary thread does not need to create a strong reference; in fact, that would make the weak reference useless. It should be noted, though, that one shouldn't use weak references (or soft ones) willy-nilly. A weak/soft reference is more expensive in terms of both your program execution time and GC overhead than a normal reference (plus of course using them is more complicated), so they should only be used where the behavior of allowing an object to be deleted out from under you is the desired behavior. If, eg, you have a secondary thread that will be killed when the primary one goes away, using the weak reference between the two is just useless overhead. This is not like some C++ paradigms where there is only one owner pointer and multiple copies. On Jul 23, 10:25 am, Matt Quigley matthew.quig...@gmail.com wrote: On Jul 23, 2:37 am, Indicator Veritatis mej1...@yahoo.com wrote: You left out something very important: the code hidden under // reload the image must not assume that it is not itself interrupted by yet another call to the garbage collector. That is, instead of simply continuing to use the soft/weak reference, it should make a strong reference to the same object, allowing this latter reference to either go out of scope or be set to null when it is done. You are referring to the code that Joseph Earl wrote above. That code snippet is NOT a proper way to use weak references; that cache should be using soft references. On the other hand, in the example blog post referred to by the OP, which uses weak references, that IS a proper way to use weak references. The main Activity already has a strong reference to the objects. The secondary thread does not need to create a strong reference; in fact, that would make the weak reference useless. But if we are making this strong reference, what was the point of using the weak/soft reference in the first place? Ah, that is the tricky thing about using them. Depending on when you can make and release the strong reference, they might not buy you much; they might not buy you anything at all. That is why they are not recommended for much outside of caches and normalized mappings. You are referring to a soft reference, not a weak reference. Soft references are good for caches. Weak references are definitely recommended for the idea given in the article, where the main thread has a strong reference, and the background thread has a weak reference. That way if the main thread is killed (i.e. the app is finished), if the background thread is still running then it won't prevent the weakly referenced objects from being destroyed. I also hate to throw this bit of information into the mix, but it should be known that Android will kill your process, and hence background threads anyways, when all your main threads have been destroyed (i.e. all your activities are finished, and there aren't any services running). This means that, even if you did have a background thread running, it would be killed, implying that weak references wouldn't help because everything is going to get killed anyways. That being said, there are still circumstances where the weak references matter: just because one activity is finished, doesn't mean all of your app's activities are necessarily finished. So it would be good if you went from your main activity into another sub-activity which began a download. But then the user presses back, because they don't want to bother waiting on the download. In that case your main activity is still alive, but the background thread is working on the sub-activity that was already finished. If that background thread had weak references, then that background thread would no longer be holding on to the resources of the sub-activity with strong references, and the system could GC those resources already, before the background thread dies. -Matt -Matt -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Video cannot be played (but Audio is?!) - Video Track fell behind?
On Fri, Jul 23, 2010 at 2:48 AM, Indicator Veritatis mej1...@yahoo.com wrote: I believe you, Mark, but I must profess this is a little counter- intuitive. After all, the same PC will play much more demanding video (higher resolution, fancier codes, etc.) running Windows Media Player or Linux's Totem, so why can't the emulator handle it? Is there really that much overhead in the emulation process? The Wikipedia page on QEMU makes it sound like their method of emulating the ARM should be very efficient, even on Intel CPUs. First, from what I can tell, the ARM emulation isn't that efficient. I mean, it's not horrible, but it's not exactly like Intel code. Second, there is no hardware graphics acceleration (despite the qualifications of the host PC), so there's that much more work that the CPU has to do. Beyond that, I'm just speaking from personal experience. I have a dual-core 2.5GHz Dell Vostro notebook with a pretty good discrete graphics card, and it cannot play back videos. Before that, I had a Pentium M 2.0 HP notebook with a pretty good discrete graphics card, and it could not play back videos. I have a quad-core 2.66GHz desktop with a pretty good discrete graphics card, and it can *usually* play back videos. I have taught a number of courses and, based on student results, you gotta have pretty serious horsepower to play back video. Anyone serious about video playback needs hardware for testing, IMHO. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.9 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
Re: [android-developers] Possible to create a transparent, headless activity?
On Fri, Jul 23, 2010 at 11:45 AM, Jin Chiu live2drea...@gmail.com wrote: Is it possible for my ActivityA to launch a transparent, headless ActivityB in a way that it does not prevent user interaction with ActivityA? That is what services are for. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.9 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: OutOfMemoryError with Bitmap
The size of an image file depends greatly on the compression techniques used to create it. Virtually all image formats involve some sort of compression such that the total number of bits in the file is considerably less than the (width * height * depth) number that represents the raw image. On Jul 23, 7:27 am, ReyLith jesus...@gmail.com wrote: Hi again, I'm trying to put a message when the image is so big. For this I think to obtain the size of the file and compare it with the free memory Runtime.getRuntime().getFreeMemory()). It works well but I have a new problem. The application show an error message with some images because they are so big and the application dont't detect the problem. I research in other posts and the problem is that the file size is different from the size of the image in memory. To get the size of the image in memory I use the product getHeight () * getRowBytes () of the Bitmap class, but with some images not previously had problems, I get very large sizes, so often I get the message erroneously. Does anyone know how could solve this problem? Thank you very much in advance. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: How could I avoid others to get my used pictures in my application?
I don't think you are correct on 1. I believe all apps have access to the resources of any other app, though I'm not certain about this - I've certainly always assumed that the resources of my applications are public in this way. Tom. -- Tom Gibara email: m...@tomgibara.com web: http://www.tomgibara.com blog: http://blog.tomgibara.com twitter: tomgibara On 23 July 2010 13:40, Joseph Earl joseph.w.e...@gmail.com wrote: 1) If you store your images in your drawable folder, then they shouldn't be accessible outside of your application 2) If you store images on the SD card then they will be available to all applications that know where they are On Jul 23, 12:04 am, Frank Weiss fewe...@gmail.com wrote: The way I look at it is that if you are going to use some pictures in your application, then the people using your application are going to have to get those pictures -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] RemoteViews and setEnabled - when is it supported ?
I have a widget, working happily on 2.2, which includes this line: views.setBoolean(R.id.s_button, setEnabled, true); When I run it on 1.5, I get this: 07-23 17:11:59.643: WARN/AppWidgetHostView(158): android.widget.RemoteViews$ActionException: view: android.widget.ImageButton can't use method with RemoteViews: setEnabled(boolean) Unsuprisingly, the widget doesn't appear. But I'm not quite sure what is not supported here. RemoteViews.setBoolean is documented as supported since API level 3, and ImageButton.setEnabled has been there forever. Is there some separate question about which functions setEnabled is prepared to do business with ? Or, if not, what could possibly be wrong here ? Thanks, Richard -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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: OutOfMemoryError with Bitmap
So, how can I obtain the depth for know if I can work with the image? On 23 jul, 18:18, DanH danhi...@ieee.org wrote: The size of an image file depends greatly on the compression techniques used to create it. Virtually all image formats involve some sort of compression such that the total number of bits in the file is considerably less than the (width * height * depth) number that represents the raw image. On Jul 23, 7:27 am, ReyLith jesus...@gmail.com wrote: Hi again, I'm trying to put a message when the image is so big. For this I think to obtain the size of the file and compare it with the free memory Runtime.getRuntime().getFreeMemory()). It works well but I have a new problem. The application show an error message with some images because they are so big and the application dont't detect the problem. I research in other posts and the problem is that the file size is different from the size of the image in memory. To get the size of the image in memory I use the product getHeight () * getRowBytes () of the Bitmap class, but with some images not previously had problems, I get very large sizes, so often I get the message erroneously. Does anyone know how could solve this problem? Thank you very much in advance. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] RemoteViews and setEnabled - when is it supported ?
On Fri, Jul 23, 2010 at 12:26 PM, jarkman jark...@gmail.com wrote: I have a widget, working happily on 2.2, which includes this line: views.setBoolean(R.id.s_button, setEnabled, true); When I run it on 1.5, I get this: 07-23 17:11:59.643: WARN/AppWidgetHostView(158): android.widget.RemoteViews$ActionException: view: android.widget.ImageButton can't use method with RemoteViews: setEnabled(boolean) Unsuprisingly, the widget doesn't appear. But I'm not quite sure what is not supported here. RemoteViews.setBoolean is documented as supported since API level 3, and ImageButton.setEnabled has been there forever. Is there some separate question about which functions setEnabled is prepared to do business with ? Or, if not, what could possibly be wrong here ? Not every method on View is available via RemoteViews. It has to be flagged with @RemotableViewMethod inside the Android source code. View's setEnabled() has that annotation, for the current code visible via Google Code Search. Apparently, back in 1.5, that method did not have that annotation. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.9 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 do you approach the various devices your application runs on?
For my first application, the only testing I've really done to this point is on my Droid X. I want to think through the various hardware differences and come up with a testing plan that is representative of the Android landscape. My initial thought is to create a list of emulators that have unique qualities such as screen size and SDK levels. I've noticed very quickly how the UI of my application will need some adjustment when viewed on devices that don't carry a 4.3 screen. How have you approached this hurdle in your own development? Chris Stewart cstewart...@gmail.com http://www.androidsdkforum.com *Want to advertise your Android application for free? Email me for details!* -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email 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 is a WeakReference?
Thanks for clearing it up somewhat. On Jul 23, 4:25 pm, Matt Quigley matthew.quig...@gmail.com wrote: On Jul 23, 2:37 am, Indicator Veritatis mej1...@yahoo.com wrote: You left out something very important: the code hidden under // reload the image must not assume that it is not itself interrupted by yet another call to the garbage collector. That is, instead of simply continuing to use the soft/weak reference, it should make a strong reference to the same object, allowing this latter reference to either go out of scope or be set to null when it is done. You are referring to the code that Joseph Earl wrote above. That code snippet is NOT a proper way to use weak references; that cache should be using soft references. On the other hand, in the example blog post referred to by the OP, which uses weak references, that IS a proper way to use weak references. The main Activity already has a strong reference to the objects. The secondary thread does not need to create a strong reference; in fact, that would make the weak reference useless. But if we are making this strong reference, what was the point of using the weak/soft reference in the first place? Ah, that is the tricky thing about using them. Depending on when you can make and release the strong reference, they might not buy you much; they might not buy you anything at all. That is why they are not recommended for much outside of caches and normalized mappings. You are referring to a soft reference, not a weak reference. Soft references are good for caches. Weak references are definitely recommended for the idea given in the article, where the main thread has a strong reference, and the background thread has a weak reference. That way if the main thread is killed (i.e. the app is finished), if the background thread is still running then it won't prevent the weakly referenced objects from being destroyed. I also hate to throw this bit of information into the mix, but it should be known that Android will kill your process, and hence background threads anyways, when all your main threads have been destroyed (i.e. all your activities are finished, and there aren't any services running). This means that, even if you did have a background thread running, it would be killed, implying that weak references wouldn't help because everything is going to get killed anyways. That being said, there are still circumstances where the weak references matter: just because one activity is finished, doesn't mean all of your app's activities are necessarily finished. So it would be good if you went from your main activity into another sub-activity which began a download. But then the user presses back, because they don't want to bother waiting on the download. In that case your main activity is still alive, but the background thread is working on the sub-activity that was already finished. If that background thread had weak references, then that background thread would no longer be holding on to the resources of the sub-activity with strong references, and the system could GC those resources already, before the background thread dies. -Matt -Matt -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to update pre-installed apps
What happens if you upload a newer version to Android Market with same package name? Does the Market app get there's an update? On Jul 23, 9:45 am, Albert albert8...@googlemail.com wrote: Hi all, I am working on an app that will be shipped on some phones. I have been thinking about how to update them once a new version is ready. How that would work for a pre-installed app? As an initial thought I think I could pop up a message letting the user know there is a new version ready, but if I could avoid unnecessary request to the server it would be better. If a google engineer comes across this please give me a hint as you do this for Google Maps... 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