[android-developers] GPS on G1/G2
I am wondering if an application that uses GPS and was developed and tested on the emulator and G1 will work on G2? I have got a comment from a G2 user that GPS did not work.. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: SDK 1.5_r3 is available
Have I to upgrade My G1 also, mean I just download the SDK 1.5r3 without any modification to the system image of G1 it will work fine? On Sat, Jul 18, 2009 at 7:07 AM, dan raaka danra...@gmail.com wrote: as in dogfood ? -Dan On Fri, Jul 17, 2009 at 4:27 PM, MrChaz mrchazmob...@googlemail.comwrote: fyi, this just got pushed to my phone On Jul 17, 6:35 pm, Dan Morrill morri...@google.com wrote: Hi, all! I wanted to let you know that a new SDK has been released: 1.5_r3 is now available. This is a minor release, and includes a Japanese IME and fixes for a few bugs, including a permissions issue. You can read more about the permissions issue here: http://www.ocert.org/advisories/ocert-2009-011.htmlYou can download the SDK here:http://developer.android.com/sdk/1.5_r3/index.htmland find the release notes here:http://developer.android.com/sdk/RELEASENOTES.html#1.5_r3 Happy coding! - Dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: open context menu for a specific item of the list
Thanks again for the reply! I think you have misunderstood what I am trying to do though..I am using context menus in all my screens and they all work OK. The onCreateContextMenu does get called and then the context menu opens normally... However, my question is how do I prepare the context menu if I want to call the openContextMenu() and open the context menu programmatically myself. In this case the system does not call the onCreateContextMenu for you :) I really appreciate your replies Peli, if you know how to solve this please let me know..thanks again! On Sat, Jul 18, 2009 at 1:40 AM, Peli peli0...@googlemail.com wrote: No, you should not call onCreateContextMenu by yourself. It will be called by the system for you. You just need to override this function, and wait until it is called. Peli www.openintents.org On Jul 17, 10:41 pm, Georgios Galyfos yorg...@gmail.com wrote: Hi and thanks for the reply. To be honest I had this idea myself, but I didn't know what to pass as parameters to this method: onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) any ideas?? On Fri, Jul 17, 2009 at 6:31 PM, Peli peli0...@googlemail.com wrote: onCreateContextMenu() should be called before the context menu is displayed.. so this would be the place to set whatever you want to set. Peli www.openintents.org On Jul 17, 4:28 pm, Georgios Galyfos yorg...@gmail.com wrote: Hi, I am using openContextMenu() when someone clicks on an item of a list (not when they long press as usual). The context menu does appear, however, it shows the context menu for the last item that the context menu had appeared. For example, if I long press the item C of the list then the context menu for item C appears, and later if I click on item B, with openContextMenu() the context menu for item C will again appear, not for B that I was expecting. How can I set the current item for which the context menu will appear to be the item of the list the user clicks on? I do have the position from onListItemClick() and I was trying to find a call like setContextMenuItem() or something, but I can't find anything Any help would be appreciated!!! 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: how to use adb tool on SAMSUNG GALAXY?
How did you do that? Which OS do you use (XP,Vista,Windows7,Ubuntu,...)? I am anxious to get it running here as well :) Kitagua On 17 Jul., 23:58, dan raaka danra...@gmail.com wrote: adb in SDK r3 plays nice with Samsung Galaxy. -Dan On Thu, Jul 16, 2009 at 9:13 AM, dan raaka danra...@gmail.com wrote: in the short run, samsung may host the compatible adb on their site -Dan On Wed, Jul 15, 2009 at 7:38 AM, Kitagua m.wuerth...@googlemail.comwrote: That are quite good news. I always have the Samsung Galaxy phone and planned to do some development using it. I really hope it will not take too long to get this SDK update. On 14 Jul., 18:11, David Turner di...@android.com wrote: You need a different version of ADB to access this phone at the moment. A future release of the SDK will provide an ADB binary that should be able to do that, but this is not available yet as far as I know. You're quite on the bleeding edge, aren't you ;-) On Tue, Jul 14, 2009 at 6:05 PM, legerb drim...@gmail.com wrote: Hey, I just got this device too. Trying to figure out how to debug on device too. According this http://groups.google.com/group/android-beginners/browse_thread/thread. .. Samsung have their own adb. Please update the thread if you've got any progress :) thanks ahead! On Jul 11, 10:54 pm, da yang daboil...@googlemail.com wrote: Hi i got this new mobilephone this week in Germany, wanted to debug my program on the device. but it doesn't work, c:\adbdevices lists no device attached, though i have tried to change the android_usb.inf in order to install the usb driver from SDK. i added some entries as follows: under [Google.NTx86] ; HTC DREAM ... ; SAMSUNGGALAXY %USB\VID_04E8PID_6640. DeviceDescRelease%=androidusb.Dev, USB \VID_04E8PID_6640 %USB\VID_04E8PID_6640MI_01.DeviceDescRelease%=androidusb.Dev, USB \VID_04E8PID_6640MI_01 %USB\VID_04E8PID_6640.DeviceDescRelease%=androidusb.Dev, USB \VID_04E8PID_6640 and [Strings]: USB\VID_04E8PID_6640.DeviceDescRelease=SAMSUNGGALAXY USB\VID_04E8PID_6640MI_01.DeviceDescRelease=SAMSUNGGALAXY CompositeADBInterface USB\VID_04E8PID_6640.DeviceDescRelease=SAMSUNGGALAXYBootloader i got only one VID and one PID through USBVIEW, though for HTC DREAM there are different PIDs used. Theadbinterface got installed, butadbjust didn't work. later i also tried to use the device under linux, set up the device as in Dev guide: If you're developing on Ubuntu Linux, you need to add a rules file: 1. Login as root and create this file: /etc/udev/rules.d/51- android.rules. For Gusty/Hardy, edit the file to read: SUBSYSTEM==usb, SYSFS{idVendor}==0bb4, MODE=0666 For Dapper, edit the file to read: SUBSYSTEM==usb_device, SYSFS{idVendor}==0bb4, MODE=0666 2. Now execute: chmod a+rx /etc/udev/rules.d/51-android.rules adbdevices listed nothing as well. : ( open a terminal on the device, with ps, i guess theadbdaemon adbd is running. but theadbtool just doesn't work. Can someone help me? thanks da --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: SDK 1.5_r3 is available
Okay, so now I installed the usb_driver from the SDK R3 (which worked well after some messing around with Windows 7). But neither 'adb devices' nor DDMS recognize the Galaxy. Did I miss sth? On 18 Jul., 00:55, dan raaka danra...@gmail.com wrote: nothing magical .. added vendor ids .. // Samsung's USB Vendor ID #define VENDOR_ID_SAMSUNG 0x04e8http://android.git.kernel.org/?p=platform/system/core.git;a=blob_plai... can see a moto ID tooo :O that is good fodder for engadet folks :D -Dan On Fri, Jul 17, 2009 at 3:21 PM, f_heft delphik...@gmail.com wrote: After it seems like you figured it out: is there anything special to consider? I'm downloading it at the moment (thanks for your hint in the other thread) and will try it tomorrow ... On 17 Jul., 23:30, dan raaka danra...@gmail.com wrote: So what are the steps to use this SDK and adb into Samsung Galaxy -Dan On Fri, Jul 17, 2009 at 10:35 AM, Dan Morrill morri...@google.com wrote: Hi, all! I wanted to let you know that a new SDK has been released: 1.5_r3 is now available. This is a minor release, and includes a Japanese IME and fixes for a few bugs, including a permissions issue. You can read more about the permissions issue here: http://www.ocert.org/advisories/ocert-2009-011.htmlYou can download the SDK here:http://developer.android.com/sdk/1.5_r3/index.htmlandfind the release notes here: http://developer.android.com/sdk/RELEASENOTES.html#1.5_r3 Happy coding! - Dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: SDK 1.5_r3 is available
I also don't see the galaxy. I'm on ubuntu hardy 64 bit. My udev rule: SUBSYSTEM==usb, SYSFS{idVendor}==04e8, MODE=0666 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 adb tool on SAMSUNG GALAXY?
I also don't see the galaxy. I'm on ubuntu hardy 64 bit. My udev rule: SUBSYSTEM==usb, SYSFS{idVendor}==04e8, MODE=0666 Sorry for cross posting but I think this thread is better for this subject so I'll stick to this one now. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Drawing a dotted line
I had a look at the demos but i am not able to find out as to how to draw a dotted rectangle. Can someone help me out with some example? On Jul 17, 8:57 pm, Peli peli0...@googlemail.com wrote: Have you looked into the API demos? There are a couple of examples of lines with various patterns. Peliwww.openintents.org On Jul 17, 5:49 pm, karthikr karthik.scintill...@gmail.com wrote: Hi Guys, How do i draw a dotted rectangle on a bitmape. Currently i use the following code, to draw a rectangle, but i want the line to be a dotted one. Can someone help me out... Paint mPaint = new Paint(); mPath.addRect(left, top, right, bottom, Direction.CCW); mPaint.setAntiAlias(true); mPaint.setDither(true); mPaint.setColor(Color.GRAY); mPaint.setStrokeWidth(1); mCanvas.drawPath(mPath, mPaint); Regards, R.Karthik- 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: open context menu for a specific item of the list
sry i made a mistake in my P.S. @Override public boolean onContextItemSelected(MenuItem item) { return true; } onContextItemSelected() can be overriden in an activity only. On Sat, Jul 18, 2009 at 4:55 PM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: let me c if i can help u. @Override protected void onCreateContextMenu(ContextMenu menu) { super.onCreateContextMenu(menu); menu.setHeaderTitle(Message Menu); menu.add(Open ); menu.add(Reply); menu.add(Delete ); menu.add(Close Menu); } public void your function(){ your activity.registerForContextMenu(your view); your activity.openContextMenu(your view); } hope it helps. P.S. : openContextMenu(View view) can be overridden in an activity only On Sat, Jul 18, 2009 at 2:07 PM, Georgios Galyfos yorg...@gmail.comwrote: Thanks again for the reply! I think you have misunderstood what I am trying to do though..I am using context menus in all my screens and they all work OK. The onCreateContextMenu does get called and then the context menu opens normally... However, my question is how do I prepare the context menu if I want to call the openContextMenu() and open the context menu programmatically myself. In this case the system does not call the onCreateContextMenu for you :) I really appreciate your replies Peli, if you know how to solve this please let me know..thanks again! On Sat, Jul 18, 2009 at 1:40 AM, Peli peli0...@googlemail.com wrote: No, you should not call onCreateContextMenu by yourself. It will be called by the system for you. You just need to override this function, and wait until it is called. Peli www.openintents.org On Jul 17, 10:41 pm, Georgios Galyfos yorg...@gmail.com wrote: Hi and thanks for the reply. To be honest I had this idea myself, but I didn't know what to pass as parameters to this method: onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) any ideas?? On Fri, Jul 17, 2009 at 6:31 PM, Peli peli0...@googlemail.com wrote: onCreateContextMenu() should be called before the context menu is displayed.. so this would be the place to set whatever you want to set. Peli www.openintents.org On Jul 17, 4:28 pm, Georgios Galyfos yorg...@gmail.com wrote: Hi, I am using openContextMenu() when someone clicks on an item of a list (not when they long press as usual). The context menu does appear, however, it shows the context menu for the last item that the context menu had appeared. For example, if I long press the item C of the list then the context menu for item C appears, and later if I click on item B, with openContextMenu() the context menu for item C will again appear, not for B that I was expecting. How can I set the current item for which the context menu will appear to be the item of the list the user clicks on? I do have the position from onListItemClick() and I was trying to find a call like setContextMenuItem() or something, but I can't find anything Any help would be appreciated!!! 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: Fast, efficient usage of an object pool
Romain, was it renamed cannot find it by your link.. On Jul 15, 3:55 pm, Romain Guy romain...@google.com wrote: We have an efficient implementation for you: use thePools.java file fromhttp://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;... (and the associated classes.) These are not public APIs so just copy the code in your application. Here's an example of a Poolable object with this API: static class InvalidateInfo implements PoolableInvalidateInfo { private static final int POOL_LIMIT = 10; private static final PoolInvalidateInfo sPool =Pools.synchronizedPool( Pools.finitePool(new PoolableManagerInvalidateInfo() { public InvalidateInfo newInstance() { return new InvalidateInfo(); } public void onAcquired(InvalidateInfo element) { } public void onReleased(InvalidateInfo element) { } }, POOL_LIMIT) ); private InvalidateInfo mNext; public void setNextPoolable(InvalidateInfo element) { mNext = element; } public InvalidateInfo getNextPoolable() { return mNext; } static InvalidateInfo acquire() { return sPool.acquire(); } void release() { sPool.release(this); } } On Wed, Jul 15, 2009 at 1:48 PM, Brad Larsonbklar...@gmail.com wrote: At Google I/O and in the forums, it has been clear that if you need optimal performance, you must avoid memory allocation inside tight loops. I'm curious about the best way to handle this in my use-case, which I think must be fairly common. I need to access at most n objects of type MyObject, I need to iterate over them during every screen refresh, and I need to remove them and put them back in the object pool randomly. The object pool seems pretty straight-forward, just use a VectorMyObject(n), add n copies of MyObject at bootup, and add/ remove from the end to avoid any memcpy or allocation. The iterating is a little more difficult. I can use for(MyObject m : myObjects), but this will allocate memory to create the iterator. I could create a static final Iterator at bootup, but there is no good way to get back to the start of the List. For now, I'm using another Vector for active MyObjects, and a for loop with an int to get() the objects and avoid allocating an iterator. get() runs in constant time for a Vector, so this works well. However, when an object is done, I need to remove it and send it back to the pool. If I use Vector.remove(i), it has to memcpy everything after i. I could use an Iterator on a LinkedList, which can remove() in constant time, but I don't think there is a good way to get the Iterator back to the start of the list without allocating memory. I could use an int to loop through a LinkedList, but LinkedList.get(n) runs in O(n) time. Any tips on the optimal way to solve this? Worst-case, I assume the memcpy called during Vector.remove() is a better bet over allocating an Iterator inside my app loop, correct? Thanks! Brad -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Asking for Donations
I've read part 3 of the marketplace agreement and I can't see an answer. If I released a game for free with 100 levels but had a link in the application to my website where people could donate if they liked the game, once they donated I provided them with a code to unlock more levels to the game. Would this scenario be allowed under the current marketplace guidelines? The only reason I'm wanting to do this is to allow the players to judge how much the extra levels are worth. I'd probably want to use Google Checkout for the donation is it supports 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 -~--~~~~--~~--~--~---
[android-developers] Re: Fast, efficient usage of an object pool
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/util/Pools.java;h=8edb3e60405ed70f0b97b477b48c53fcab88c631;hb=donut On Sat, Jul 18, 2009 at 4:38 AM, Fred Grott(shareme)fred.gr...@gmail.com wrote: Romain, was it renamed cannot find it by your link.. On Jul 15, 3:55 pm, Romain Guy romain...@google.com wrote: We have an efficient implementation for you: use thePools.java file fromhttp://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;... (and the associated classes.) These are not public APIs so just copy the code in your application. Here's an example of a Poolable object with this API: static class InvalidateInfo implements PoolableInvalidateInfo { private static final int POOL_LIMIT = 10; private static final PoolInvalidateInfo sPool =Pools.synchronizedPool( Pools.finitePool(new PoolableManagerInvalidateInfo() { public InvalidateInfo newInstance() { return new InvalidateInfo(); } public void onAcquired(InvalidateInfo element) { } public void onReleased(InvalidateInfo element) { } }, POOL_LIMIT) ); private InvalidateInfo mNext; public void setNextPoolable(InvalidateInfo element) { mNext = element; } public InvalidateInfo getNextPoolable() { return mNext; } static InvalidateInfo acquire() { return sPool.acquire(); } void release() { sPool.release(this); } } On Wed, Jul 15, 2009 at 1:48 PM, Brad Larsonbklar...@gmail.com wrote: At Google I/O and in the forums, it has been clear that if you need optimal performance, you must avoid memory allocation inside tight loops. I'm curious about the best way to handle this in my use-case, which I think must be fairly common. I need to access at most n objects of type MyObject, I need to iterate over them during every screen refresh, and I need to remove them and put them back in the object pool randomly. The object pool seems pretty straight-forward, just use a VectorMyObject(n), add n copies of MyObject at bootup, and add/ remove from the end to avoid any memcpy or allocation. The iterating is a little more difficult. I can use for(MyObject m : myObjects), but this will allocate memory to create the iterator. I could create a static final Iterator at bootup, but there is no good way to get back to the start of the List. For now, I'm using another Vector for active MyObjects, and a for loop with an int to get() the objects and avoid allocating an iterator. get() runs in constant time for a Vector, so this works well. However, when an object is done, I need to remove it and send it back to the pool. If I use Vector.remove(i), it has to memcpy everything after i. I could use an Iterator on a LinkedList, which can remove() in constant time, but I don't think there is a good way to get the Iterator back to the start of the list without allocating memory. I could use an int to loop through a LinkedList, but LinkedList.get(n) runs in O(n) time. Any tips on the optimal way to solve this? Worst-case, I assume the memcpy called during Vector.remove() is a better bet over allocating an Iterator inside my app loop, correct? Thanks! Brad -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Asking for Donations
That sounds 100% like selling additional levels. On Sat, Jul 18, 2009 at 10:05 AM, qh.p...@gmail.comqh.p...@gmail.com wrote: good question, I am also interested by the answer On 18 juil, 14:21, aclelland aclell...@gmail.com wrote: I've read part 3 of the marketplace agreement and I can't see an answer. If I released a game for free with 100 levels but had a link in the application to my website where people could donate if they liked the game, once they donated I provided them with a code to unlock more levels to the game. Would this scenario be allowed under the current marketplace guidelines? The only reason I'm wanting to do this is to allow the players to judge how much the extra levels are worth. I'd probably want to use Google Checkout for the donation is it supports 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 -~--~~~~--~~--~--~---
[android-developers] Re: Fast, efficient usage of an object pool
Thank you Romain .. On Jul 18, 10:25 am, Romain Guy romain...@google.com wrote: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;... On Sat, Jul 18, 2009 at 4:38 AM, Fred Grott(shareme)fred.gr...@gmail.com wrote: Romain, was it renamed cannot find it by your link.. On Jul 15, 3:55 pm, Romain Guy romain...@google.com wrote: We have an efficient implementation for you: use thePools.java file fromhttp://android.git.kernel.org/?p=platform/frameworks/base.git;a=tree;... (and the associated classes.) These are not public APIs so just copy the code in your application. Here's an example of a Poolable object with this API: static class InvalidateInfo implements PoolableInvalidateInfo { private static final int POOL_LIMIT = 10; private static final PoolInvalidateInfo sPool =Pools.synchronizedPool( Pools.finitePool(new PoolableManagerInvalidateInfo() { public InvalidateInfo newInstance() { return new InvalidateInfo(); } public void onAcquired(InvalidateInfo element) { } public void onReleased(InvalidateInfo element) { } }, POOL_LIMIT) ); private InvalidateInfo mNext; public void setNextPoolable(InvalidateInfo element) { mNext = element; } public InvalidateInfo getNextPoolable() { return mNext; } static InvalidateInfo acquire() { return sPool.acquire(); } void release() { sPool.release(this); } } On Wed, Jul 15, 2009 at 1:48 PM, Brad Larsonbklar...@gmail.com wrote: At Google I/O and in the forums, it has been clear that if you need optimal performance, you must avoid memory allocation inside tight loops. I'm curious about the best way to handle this in my use-case, which I think must be fairly common. I need to access at most n objects of type MyObject, I need to iterate over them during every screen refresh, and I need to remove them and put them back in the object pool randomly. The object pool seems pretty straight-forward, just use a VectorMyObject(n), add n copies of MyObject at bootup, and add/ remove from the end to avoid any memcpy or allocation. The iterating is a little more difficult. I can use for(MyObject m : myObjects), but this will allocate memory to create the iterator. I could create a static final Iterator at bootup, but there is no good way to get back to the start of the List. For now, I'm using another Vector for active MyObjects, and a for loop with an int to get() the objects and avoid allocating an iterator. get() runs in constant time for a Vector, so this works well. However, when an object is done, I need to remove it and send it back to the pool. If I use Vector.remove(i), it has to memcpy everything after i. I could use an Iterator on a LinkedList, which can remove() in constant time, but I don't think there is a good way to get the Iterator back to the start of the list without allocating memory. I could use an int to loop through a LinkedList, but LinkedList.get(n) runs in O(n) time. Any tips on the optimal way to solve this? Worst-case, I assume the memcpy called during Vector.remove() is a better bet over allocating an Iterator inside my app loop, correct? Thanks! Brad -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: SDK 1.5_r3 is available
Does this fix the GPS emulation bug? - Brian Dan Morrill wrote: Hi, all! I wanted to let you know that a new SDK has been released: 1.5_r3 is now available. This is a minor release, and includes a Japanese IME and fixes for a few bugs, including a permissions issue. You can read more about the permissions issue here: http://www.ocert.org/advisories/ocert-2009-011.html You can download the SDK here: http://developer.android.com/sdk/1.5_r3/index.html and find the release notes here: http://developer.android.com/sdk/RELEASENOTES.html#1.5_r3 Happy coding! - Dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Asking for Donations
Hey perhaps he'll make'em an effort they can't refuse. On Jul 18, 9:30 am, Disconnect dc.disconn...@gmail.com wrote: That sounds 100% like selling additional levels. On Sat, Jul 18, 2009 at 10:05 AM, qh.p...@gmail.comqh.p...@gmail.com wrote: good question, I am also interested by the answer On 18 juil, 14:21, aclelland aclell...@gmail.com wrote: I've read part 3 of the marketplace agreement and I can't see an answer. If I released a game for free with 100 levels but had a link in the application to my website where people could donate if they liked the game, once they donated I provided them with a code to unlock more levels to the game. Would this scenario be allowed under the current marketplace guidelines? The only reason I'm wanting to do this is to allow the players to judge how much the extra levels are worth. I'd probably want to use Google Checkout for the donation is it supports 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 -~--~~~~--~~--~--~---
[android-developers] Re: Best practise to deal with killed services?
You shouldn't really be able to force the behavior by opening many applications, since only one can be in the foreground at the time, and background applications are always killed before ones actively running services. You can certainly force this by starting up a bunch of processes running services, in which case yes eventually there will be no more memory and something will need to go. The onLowMemory() callback happens a fair amount before any services are started -- currently it is sent when the system is not able to keep around any background processes. The next process to go will be a service, but there is a bit of a hump in memory use before that happens. The crashed service message is because all the activity manager knows is the process goes away -- this may be because the kernel killed it, or its process crashed, it can't tell between the two. As with everything else, there is no callback that happens before a service is killed, since this is done deep down in the kernel when it finds that it is getting low on memory. In general the management of running services is tricky because developers have a tendency to leave them running for longer than needed, or even just forgetting to stop them. They also often have memory leaks so as they continue to run they eat more and more memory, leaving no room for other things. So at this point the system is pretty heavy-handed with them. One thing in particular is that after a service has been running for a while, we will reclassify it as a background process, allowing it to be killed much more aggressively. As far as wake locks, the system automatically releases them when your process goes away so there is no need to worry about them when you are killed. Finally, if you are indeed showing an ongoing notification while your service is running, so the user is directly aware of what you are doing, and can explicitly stop your service when they want, then you have one additional facility available to you: Service.setForeground() will tell the system that you count as a foreground application, something the user is directly aware of, so your process will be killed much less aggressively. Please use this API only in this case (look at the media playback service as a the typical kind of behavior that should be associated with it). Actually I am starting to see apps abuse this API just to force themselves to run without those semantics, so we'll probably have to do something about it -- my current thought is to turn it into a no-op and add a new API that requires you have an ongoing notification to be counted as foreground. On Sat, Jul 18, 2009 at 5:47 AM, Mariano Kamp mariano.k...@gmail.comwrote: onDestroy() seems to be called regularly before the process vanishes, but onDestroy() is not. The process is just gone. On Wed, Jul 15, 2009 at 11:58 AM, Mariano Kamp mariano.k...@gmail.comwrote: Also, what is the best way to deal with wake locks in these situations? On Mon, Jul 13, 2009 at 1:44 PM, Mariano Kamp mariano.k...@gmail.comwrote: Hi, I often see that services are killed and then restarted. I can force this behavior when opening many applications. Low Memory or OutOfMemory are not problems per se, are they? This is just the normal behavior due to Android not closing applications, but killing the least important processes when more memory is needed, right? The terminology crashed service at least sounds very serious... D/dalvikvm( 112): GC freed 272 objects / 12256 bytes in 648ms D/dalvikvm( 55): GC freed 4021 objects / 156072 bytes in 897ms I/ActivityManager( 55): Process com.google.process.gapps (pid 1886) has died. W/ActivityManager( 55): Scheduling restart of crashed service com.google.android.apps.gtalkservice/com.google.android.gtalkservice.service.GTalkService in 5000ms I/ActivityManager( 55): Low Memory: No more background processes. I/ActivityManager( 55): Process com.tmobile.myfaves (pid 2156) has died. W/ActivityManager( 55): Scheduling restart of crashed service com.tmobile.myfaves/.MyFavesService in 5000ms I/ActivityManager( 55): Low Memory: No more background processes. D/LocationManager( 6830): removeUpdates: intent = PendingIntent{4318eb18 target android.os.binderpr...@4318e870} D/HTTPService( 5812): Calling: GET http://brightkite.com/me/config.jsonHTTP/1.1 W/InputManagerService( 55): Starting input on non-focused client com.android.internal.view.iinputmethodclient$stub$pr...@4333df90(uid=10016 pid=6825) W/InputManagerService( 55): Client not active, ignoring focus gain of: com.android.internal.view.iinputmethodclient$stub$pr...@43303ae0 W/ActivityManager( 55): Activity pause timeout for HistoryRecord{43593020 {com.android.vending/com.android.vending.AssetBrowserActivity}} D/dalvikvm( 5812): GC freed 1254 objects / 258832 bytes in 331ms I/WindowManager( 55): WIN DEATH: Window{4348c1b8 com.newsrob/com.newsrob.DashboardListActivity paused=false}
[android-developers] ListActivity: items with a button
Hi! I'm sure this is a classic question, but I couldn't find the answer anywhere. I'm trying to have a ListActivity whose items feature a button. As soon as I include the button on my item layout, the rows are no longer selectable. Any pointers to tutorials or sample code would be much appreciated! Thanks. BoD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Asking for Donations
According to the market terms: All fees received by Developers for Products distributed via the Market must be processed by the Market’s Payment Processor. Does this allow for fees to be collected outside of the market, like in OP's question, but using the Market's Payment Processor? Another words, if the OP uses Google Checkout on his own web site will this satisfy this provision? By my reading of the terms, the OP's idea of collecting additional revenue for his application by selling levels would be fine as long as he used Google Checkout. CAUTION: IANAL -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: SDK 1.5_r3 is available
If you mean by GPS emulation bug the problem with network provider on the emulator, it does, or at least does to my satisfaction. Before, accessing the network provider caused an error. Now it works as expected. -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] Alternatives to Multitouch
I need to zoom-in/zoom-out for my app. Multitouch would be the most obvious way to go about this *sigh*. I would prefer not to use the zoom-in/out widget. I have been trying a number of other techniques but am not satisfied with the feel. Looking for suggestions from the community on alternative approaches. A one fingered zoom? Thanks, Jason Van Anden --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: GPS on G1/G2
If you mean by a G2 the Google Ion (HTC Magic given out at Google IO), then the answer is yes, it does work as expected. I don't have a G1 to confirm this but if it works on the emulator, I would expect it to work on the Ion. -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: WebView and HTTP Post requests
Yeah so thats basically what I had to do,except if I got the Cookies from the HttpResponse by asking for the Set-Cookie headers and placing the values from each of the headers as the value for setCookie() and just use the URL. This way I didn't have to build a string, the string was already the proper value. Thanks for all the help! On Jul 16, 9:02 pm, Jason Proctor jason.android.li...@gmail.com wrote: here's your problem, i think -- the getValue() method of the Apache Cookie class returns the value of the cookie, ie from jsessionid=blah would retrieve blah -- but -- the setCookie() method of the WebKit CookieManager class takes a parameter called value, but it's referring to something different. the (typically terse) doc says the value for set-cookie: in http response header. my theory would be that it wants something like a full cookie response string, like this -- name=value; expires=date; path=pathname; domain=name; given that you also pass a URL into the setCookie() method, i think just the name=value and expires=date elements should do it. indeed the doc says that setCookie() checks the expiry, so minimally you'd want to set that explicitly, though you could try it without. so in your code, you'd build the value string from the Apache Cookie using getName(), getValue(), and getExpiry() etc, and then give that to WebKit. also -- is your code actually copying any cookies? log them and make sure you're copying what you think you're copying. hth I've been trying this. I get the CookieStore from the HttpClient that executes the HttpPost. I then get all the values from the CookieStore and place it in the CookieManager using CookiManager.getInstance ().setCookie(url, theCookieStore.getCookies().get(i).getValue()); where i is the value in whatever for loop I'm using. This still does not seem to work with the WebView, because after I execute the post and place the cookies in the CookieManager I attempt to load the tumblr.com/iphone website and it doesn't automatically login. I'm completely baffled as to what to do. I tried getting the cookies from the HttpResponse, but that still didn't do anything. does the CookieManager handle WebViews? -- jason.software.particle --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 and HTTP Post requests
Yeah so thats basically what I had to do,except if I got the Cookies from the HttpResponse by asking for the Set-Cookie headers and placing the values from each of the headers as the value for setCookie() and just use the URL. This way I didn't have to build a string, the string was already the proper value. Thanks for all the help! On Jul 16, 9:02 pm, Jason Proctor jason.android.li...@gmail.com wrote: here's your problem, i think -- the getValue() method of the Apache Cookie class returns the value of the cookie, ie from jsessionid=blah would retrieve blah -- but -- the setCookie() method of the WebKit CookieManager class takes a parameter called value, but it's referring to something different. the (typically terse) doc says the value for set-cookie: in http response header. my theory would be that it wants something like a full cookie response string, like this -- name=value; expires=date; path=pathname; domain=name; given that you also pass a URL into the setCookie() method, i think just the name=value and expires=date elements should do it. indeed the doc says that setCookie() checks the expiry, so minimally you'd want to set that explicitly, though you could try it without. so in your code, you'd build the value string from the Apache Cookie using getName(), getValue(), and getExpiry() etc, and then give that to WebKit. also -- is your code actually copying any cookies? log them and make sure you're copying what you think you're copying. hth I've been trying this. I get the CookieStore from the HttpClient that executes the HttpPost. I then get all the values from the CookieStore and place it in the CookieManager using CookiManager.getInstance ().setCookie(url, theCookieStore.getCookies().get(i).getValue()); where i is the value in whatever for loop I'm using. This still does not seem to work with the WebView, because after I execute the post and place the cookies in the CookieManager I attempt to load the tumblr.com/iphone website and it doesn't automatically login. I'm completely baffled as to what to do. I tried getting the cookies from the HttpResponse, but that still didn't do anything. does the CookieManager handle WebViews? -- jason.software.particle --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: SDK 1.5_r3 is available
in your device manager (I verified mine on win xp) do you see the device as 'samsung adb interface device', and check if you have enabled adb on the device .. in settings-development -Dan On Sat, Jul 18, 2009 at 2:13 AM, f_heft delphik...@gmail.com wrote: Okay, so now I installed the usb_driver from the SDK R3 (which worked well after some messing around with Windows 7). But neither 'adb devices' nor DDMS recognize the Galaxy. Did I miss sth? On 18 Jul., 00:55, dan raaka danra...@gmail.com wrote: nothing magical .. added vendor ids .. // Samsung's USB Vendor ID #define VENDOR_ID_SAMSUNG 0x04e8 http://android.git.kernel.org/?p=platform/system/core.git;a=blob_plai... can see a moto ID tooo :O that is good fodder for engadet folks :D -Dan On Fri, Jul 17, 2009 at 3:21 PM, f_heft delphik...@gmail.com wrote: After it seems like you figured it out: is there anything special to consider? I'm downloading it at the moment (thanks for your hint in the other thread) and will try it tomorrow ... On 17 Jul., 23:30, dan raaka danra...@gmail.com wrote: So what are the steps to use this SDK and adb into Samsung Galaxy -Dan On Fri, Jul 17, 2009 at 10:35 AM, Dan Morrill morri...@google.com wrote: Hi, all! I wanted to let you know that a new SDK has been released: 1.5_r3 is now available. This is a minor release, and includes a Japanese IME and fixes for a few bugs, including a permissions issue. You can read more about the permissions issue here: http://www.ocert.org/advisories/ocert-2009-011.htmlYou can download the SDK here:http://developer.android.com/sdk/1.5_r3/index.htmlandfind the release notes here: http://developer.android.com/sdk/RELEASENOTES.html#1.5_r3 Happy coding! - Dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 adb tool on SAMSUNG GALAXY?
My environment is win xp. if you see things properly in the device manager, i am guessing you have installed the drivers properly. can you post what you see in the settings-about .. about the build info you have .. -Dan On Sat, Jul 18, 2009 at 3:27 AM, Olaf Geibig olaf.gei...@googlemail.comwrote: I also don't see the galaxy. I'm on ubuntu hardy 64 bit. My udev rule: SUBSYSTEM==usb, SYSFS{idVendor}==04e8, MODE=0666 Sorry for cross posting but I think this thread is better for this subject so I'll stick to this one now. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: SDK 1.5_r3 is available
I think I installed the wrong driver .. the driver in the folder usb_driver is only for two HTC devices and a general adb bridge. I tried to install the adb bridge-driver für the galaxy, but that didn't work. I wonder how you installed the driver for the galaxy .. did you just take the files out of the usb_driver folder? adb is enabled on the galaxy .. On 18 Jul., 20:45, dan raaka danra...@gmail.com wrote: in your device manager (I verified mine on win xp) do you see the device as 'samsung adb interface device', and check if you have enabled adb on the device .. in settings-development -Dan On Sat, Jul 18, 2009 at 2:13 AM, f_heft delphik...@gmail.com wrote: Okay, so now I installed the usb_driver from the SDK R3 (which worked well after some messing around with Windows 7). But neither 'adb devices' nor DDMS recognize the Galaxy. Did I miss sth? On 18 Jul., 00:55, dan raaka danra...@gmail.com wrote: nothing magical .. added vendor ids .. // Samsung's USB Vendor ID #define VENDOR_ID_SAMSUNG 0x04e8 http://android.git.kernel.org/?p=platform/system/core.git;a=blob_plai... can see a moto ID tooo :O that is good fodder for engadet folks :D -Dan On Fri, Jul 17, 2009 at 3:21 PM, f_heft delphik...@gmail.com wrote: After it seems like you figured it out: is there anything special to consider? I'm downloading it at the moment (thanks for your hint in the other thread) and will try it tomorrow ... On 17 Jul., 23:30, dan raaka danra...@gmail.com wrote: So what are the steps to use this SDK and adb into Samsung Galaxy -Dan On Fri, Jul 17, 2009 at 10:35 AM, Dan Morrill morri...@google.com wrote: Hi, all! I wanted to let you know that a new SDK has been released: 1.5_r3 is now available. This is a minor release, and includes a Japanese IME and fixes for a few bugs, including a permissions issue. You can read more about the permissions issue here: http://www.ocert.org/advisories/ocert-2009-011.htmlYoucan download the SDK here:http://developer.android.com/sdk/1.5_r3/index.htmlandfind the release notes here: http://developer.android.com/sdk/RELEASENOTES.html#1.5_r3 Happy coding! - Dan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Alternatives to Multitouch
Hi, There is no easy way to do that, specially because you might have other functionality assigned to one finger specific gestures. Anyway, here's a suggestion: zoom in: one finger double tap zoom out: one finger long press or wait for multi-touch support... --- Ricardo Castro --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Low accuracy of the accelerometer Sensor
1. Tried to use event.timestamp instead of System.currentTime Still the same result: device skips some measurements. Many times, this is detrimental to being able to produce an accurate drawing of the phone motion. Some important acceleration peaks are missed. One way to combat this problem may be having the user repeat the motion several times or have him initially draw what they think the motion is on the screen. This could be used to supplement some missing data. 2. Subtracting G from different axes based on the phone's orientation may not be a good idea. The reason is that the orientation measurements also fluctuate somewhat wildly when the phone is moved in XY plane. On some measurements fluctuation reached 30-45 degrees. Makes me wonder if the measurements of acceleration and orientation are done by 1 sensor unit. see here http://forum.xda-developers.com/showthread.php?t=503055 At any rate, this G subtraction would introduce an additional significant error, I think. Also, I have been filtering G with an additional orientation sensor as getOrientation is not working. I used the following formulae to calculate adjustments due to G: double adjX = GRAVITY_EARTH * Math.sin(roll); double adjY = GRAVITY_EARTH * Math.sin(-pitch); double adjZ = GRAVITY_EARTH * Math.cos(roll) * Math.cos(pitch); Where GRAVITY_EARTH was obtained through calibration. 3. I have been plotting Accel X,Y against t and displacement plot XY with Gnu Plot. That is a very nice tool! Allows to plot in 3D too. We limited motion to the table top plane in 2D till other issues can be resolved. 4. We had some luck with drawing circular motion. One thought was that the sensor has centripetal acceleration in addition to the normal phone accel. The phone is applied centripetal force, not the measuring sensor part inside. Unfortunately, the results for other gestures were more mixed. For example, drawing letter M somehow produced an M like plot moving in right to left direction versus it was drawn right to left. Anyone has better luck, please let us know :) D On Jul 10, 3:04 am, keyboardr keyboa...@gmail.com wrote: I'm not 100% familiar with this aspect of the G1, but I know Nintendo had a similar problem with their Wiimotes. That's why they have the sensor bar set up: they couldn't get their accelerometers to be accurate enough to track position. On Jul 9, 2:23 pm, dilit dmit.lit...@gmail.com wrote: Sounds like some signal processing/filter math is in order.http://www.cs.unc.edu/~welch/kalman/ Anyone with experience? D On Jul 9, 1:18 pm, dilit dmit.lit...@gmail.com wrote: Just in case, We did calibrate our phones. E.g. My phone's Gravity value is more like 8.7 vs 9.81. While static, the phone's accel values were acceptable. As soon as the phone was in motion, the acceleration (position) data went out to lunch. FYI, marketing = lying 99% of the time. IMO On Jul 9, 1:05 pm, dilit dmit.lit...@gmail.com wrote: We are writing an application that uses acceleration sensor data to plot phone's movement in 3D. We are finding gross inconsistencies in the actual data output by the sensor. Also, sampling rates vary greatly from 8 to 200 millis. (using System.currentTimeMillis()) Specifically, when we try to draw a circle with G1 flat on the table all the time (filtering out gravity accel 9.8), most of the time we would get a plot of phone's position that is not a circle at all. Lots of times, it would be close to a straight line. Sometimes, it would start drawing an arc, but would not close the circle shooting off in a random direction. We tried to eliminate the time variable, by substituting a constant time sampling rate (10 millis) to calculate phones position, but the result was very close to what we had before (shapewise). Also, the acceleration in Z direction when the phone is displaced lying flat on a table (XY plane) varies too by +/- 2 units which is a lot. I do not think it is an error in our code, as we have checked it many times. If there were an error indeed and the accelerometer worked properly, we would see a consistently wrong depiction of the phone's movement. Unfortunately, repeating the same movement (circle) would produce sometimes wildly differently shaped plots. It all comes down to us wanting to know if that is indeed the case that the G1 accelerometer is very unreliable and inconsistent device when used for more or less precise measurements? Is there some documentation/facts paper that would tell us just how reliable accelerometer is? Thanks for you help! Dmitriy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to
[android-developers] Re: Should we use jade androide to develop application?
Hi Yusuf, My requirement is very simple.I want to send a plain text to the same application of another android user. Can you tell me more about SIP. Can you give me some useful link. Thanks, Sujit On Jul 16, 11:40 pm, Yusuf T. Mobile yusuf.s...@t-mobile.com wrote: Finding or installing aJADEserver, and using jChat is one way, but I take it from your post(s) that this is an obstacle. In that case, another option is SIP, which may (or may not) suit your purposes. There are a number of SIP clients ported to Android, and there are SIP servers out there that you can use for free. Yusuf Saib Android ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the author solely in their individual capacity, and do not necessarily represent those of T-Mobile USA, Inc. On Jul 15, 10:20 pm, sujitm suj...@gmail.com wrote: Hi All, I am building a social networking application for ADC-II. This needs peer-to-peer communications.Since GTalk service is not there any more (hoping some variant will be back in future), I have one easy option to useJADE. ButJADErequires a runningJADEplatform to function properly. And definitely this is a drawback if I useJADE. Dan, your comments will be highly appreciated. Thanks, Sujit --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 video and the browser
Have the link as http://my.web.page./my_clip.mp4 on your webpage. When the user clicks on it, the link would be passed to the mediaplayer. Note that not all mimetypes are recognized by the mediaplayer. -Ravi On Jul 17, 2:43 pm, Jason Proctor jason.android.li...@gmail.com wrote: I was under the impression the OP wasn't an Android developer. Click handlers and MediaPlayers wouldn't be an option for somebody just trying to make their Web site more Android browser-friendly. OTOH, I may have interpreted the OP incorrectly... no it's me that has it wrong. apologies to the OP. offhand i don't know good HTML for playing vid in the Android browser. roll on video. -- jason.software.particle --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: error on Oauth on android
Radzell wrote: The emulator keep saying the program unexpectically stopped Look at the stack trace to see the exception that caused your problem. You can find the stack trace in LogCat (adb logcat, DDMS, or the DDMS perspective in Eclipse). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need help for your Android OSS project? http://wiki.andmob.org/hado --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Avoid Failed Binder Transaction
There is definitely a bug here and I think it's within Android. I do not get an error stacktrace or anything but my application will just completely freeze and it won't continue on and within a few minutes I will see the Failed Binder Transaction. The exact line it's freezing at is Process process = Runtime.getRuntime ().exec(SOME COMMAND); It is very intermittent but after calling that line a number of times, the application will freeze with no indications of what's wrong. Any help? Any different way of doing this? Thanks, Arron On Jul 16, 6:53 am, biAji biaji...@gmail.com wrote: On Jul 13, 1:47 pm, Don Tran arro...@gmail.com wrote: My application is getting a failedbindertransaction, which causes it to completely hang, when I do the following: Process process = Runtime.getRuntime().exec(SOME COMMAND); BufferedReader br = new BufferedReader(new InputStreamReader (process.getInputStream()); While(read the content using br.readLine()) I count the same issue, and try a lot to eliminate it but not success.. And the most important thing is: I can not repeat the error, it's happened randomly. I guess it's not thread safe.~ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] error on Oauth on android
private void authpost(String verificationCode) throws OAuthMessageSignerException, OAuthNotAuthorizedException, OAuthExpectationFailedException, OAuthCommunicationException, IOException{ /*Creates a consumer object and configure it with access * token and token secret still needed from service I HAVE NO IDEA * WHAT THEY ARE*/ OAuthConsumer consumer = new CommonsHttpOAuthConsumer( CONSUMER_KEY, CONSUMER_SECRET, SignatureMethod.HMAC_SHA1); Log.i(cliqdroid, Finished consumer loading function); consumer.setTokenWithSecret(ACCESS_TOKEN, TOKEN_SECRET); //Http request to the protected resource URL url = new URL(https://api.cliqset.com/200905/user/radzell/ profile); HttpURLConnection request = (HttpURLConnection) url.openConnection (); //sign the request so it can get past the security consumer.sign(request); //send the request to the server in order to obtain access to resource request.connect(); String responsecode = request.getResponseMessage(); Log.i(Cliqdroid, responsecode); // create a new service provider object and configure it with // the URLs which provide request tokens, access tokens, and // the URL to which users are sent in order to grant permission // to your application to access protected resources OAuthProvider provider = new DefaultOAuthProvider(consumer, REQUEST_TOKEN_ENDPOINT_URL, ACCESS_TOKEN_ENDPOINT_URL, AUTHORIZE_WEBSITE_URL); // fetches a request token from the service provider and builds // a url based on AUTHORIZE_WEBSITE_URL and CALLBACK_URL to // which your app must now send the user @SuppressWarnings(unused) String url1 = provider.retrieveRequestToken(OAuth.OUT_OF_BAND); provider.retrieveAccessToken(verificationCode); } The emulator keep saying the program unexpectically stopped --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: ListActivity: items with a button
I hava the same problem ... At last,I change the button to a pic,looks like a button,in fact,it''s a button. Then the item can be selected... On 7月19日, 上午1时29分, BoD bodl...@gmail.com wrote: Hi! I'm sure this is a classic question, but I couldn't find the answer anywhere. I'm trying to have a ListActivity whose items feature a button. As soon as I include the button on my item layout, the rows are no longer selectable. Any pointers to tutorials or sample code would be much appreciated! Thanks. BoD --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Why the duration of clip is differen between VideoView.getDuration and MediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADAT A_KEY_DURATION)
Correct. When I want to get the duration, method #2 is right. matadata may be wrong from method #1. When I want to get the ID tag information, method #1 is better as Method #2 has not given out such API as Title, Aurthod, etc. Thanks Macro. On Jul 18, 1:23 am, Marco Nelissen marc...@android.com wrote: Method #1 gets the duration from the metadata in the file, which in practice is often wrong. On Fri, Jul 17, 2009 at 12:15 AM, Chennychenny...@gmail.com wrote: Hi Friends, When I create an APP for Media test, I'd like to get the duration of tested clip. Nut as the debug result, the duration is different between the 2 methods for many clips. Method 1: MediaMetadataRetriever retriever = new MediaMetadataRetriever(); retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY); retriever.setDataSource(mCurrentAVFile); int mDuration = retriever.extractMetadata (MediaMetadataRetriever.METADATA_KEY_DURATION); int mDurSecond = Integer.parseInt(mDuration); mDurSecond = mDurSecond/1000; int mDurHour = mDurSecond/3600; mDurSecond = mDurSecond%3600; int mDurMinute = mDurSecond/60; mDurSecond = mDurSecond%60; mDuration = mDurHour+:+mDurMinute+:+mDurSecond; Log.i(TAG,mDuration: +mDuration); Method 2: private VideoView mVideoView; mVideoView.setVideoURI(mUri); long mDurationTime = mVideoView.getDuration(); mDurationTime = mDurationTime/1000; Log.i(TAG,onPrepared Stream Duration: + mDurationTime+ seconds\n); What is the reason? And I checked the result of Method 2 is right when compared with PC result. Is there a bug for MediaMetadataRetriever.extractMetadata (MediaMetadataRetriever.METADATA_KEY_DURATION)? Anybod can help me out? Thanks very much. Chenny- 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 make framework (progress bar and trick mode button such as FF, FB, Pause) not disappear with android.widget.VideoView
If any constant or function to make it be? On Jul 17, 3:33 pm, Chenny chenny...@gmail.com wrote: Hi guys, I am creating a player for multimedia test with android.widget.VideoView. I'd like the framework (progress bar and trick mode button such as FF, FB, Pause) of player view not disappear as I'd like to see the playing status and time status. But as default, the progress bar and button will be disappear in 2~3 seconds. How could I do? If any function to make the progress bar appear all the time? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---