[android-developers] override earphone click button
Hi Guys, can some one tell me that,can we override headphone functionality in android 4+ version please let me know if any one have idea Thanks: Sadhna -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: Does the Android emulator run inside a VM?
Thanks, Yeah, it does work if I choose WXGA; RAM 512, heap 64; against latest 4.4.2 ARM/x86 images. Does takes a long time to load. On Wednesday, May 7, 2014 11:32:56 PM UTC-7, Ruud wrote: I've used the emulator successfully inside a VirtualBox VM recently. But didn't use all the options you used, and a lower resolution. It is slow though. Op donderdag 8 mei 2014 03:02:46 UTC+2 schreef Charles: Summary: Does the Android emulator run inside a VM? Or must it be run on a bare metal machine? I am trying to setup some automated tests using Jenkins using the Android plugin. The slave is a VM (on top) of VMWare ESXi, running Ubuntu Linux (32 bit x86). When the emulator tries to start the VM, it shows an error Failed to Initialize backend EGL display and nothing happens. [android] Using Android SDK: /home/hudson/hudson/tools/android-sdk [android] Creating Android AVD: /home/hudson/.android/avd/hudson_en-US_160_1080x1920_android-19_x86.avd [android] /home/hudson/hudson/tools/android-sdk/tools/android create avd -f -a -s 1080x1920 -n hudson_en-US_160_1080x1920_android-19_x86 -t android-19 --abi x86 [android] Setting hardware properties: hw.ramSize: 768 vm.heapSize: 64 $ /home/hudson/hudson/tools/android-sdk/platform-tools/adb start-server $ /home/hudson/hudson/tools/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_1080x1920_android-19_x86 [android] Starting Android emulator and creating initial snapshot $ /home/hudson/hudson/tools/android-sdk/tools/emulator -no-boot-anim -ports 45507,44892 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_1080x1920_android-19_x86 -no-snapshot-load -no-snapshot-save -wipe-data -no-window -noaudio -gpu off * daemon not running. starting it now on port 39784 * * daemon started successfully * Failed to Initialize backend EGL display ... emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. I tried with different abi (x86|x86) and options (combinations of -noaudio -gpu off). All failing. I also tried to login to the console and launch the emulator manually. All I see is a black emulator window. The emulator process is actively running ('top' command), but I don't see the home screen. Thanks, Charles -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Activity Back Stack and OutOfMemoryError
2014-05-09 0:12 GMT+02:00 Kostya Vasilyev kmans...@gmail.com: Are you absolutely sure that your code does not leak memory? How to be absolutely sure. :-) Just kidding. Have you tried using Eclipse MAT and putting the app through the usual paces, like rotating the screen, pausing / restarting, etc.? This i have done: * app started, before killed * dump hprof and load with mat (leak suspects) * rotate, rotate, rotate... * dump hprof again load with mat (leak suspects) i compared the mat reports with the suspects and i see no differences in the leak suspects report. Which sould differ in the occupied size when i am not wrong? You'd mentioned the app being heavy on image processing -- is your memory allocation strategy based on how much memory your app's process gets? You can use ActivityManager#getMemoryClass for that. Actually i am aware of this complicated and consequences so i use the universal image loader which is configured to scale the images exact in the bitmap which cost cpu time, but preserves memory. It's too bad that your log does not have any memory allocation data. I'd consider implementing a crash handler that logs to a file, recording things like: Debug.getNativeHeapAllocatedSize() Debug.getNativeHeapFreeSize() Runtime.getRuntime().maxMemory() Runtime.getRuntime().totalMemory() Runtime.getRuntime().freeMemory() ActivityManager.getMemoryClass() I am new to the memory thing, and it doesn't happen a lot. It happens mostly on a rare ressource device. But question again starting lots of activities where you can go back should not be the issue? If the activity itself isn't leaking anything it can be gc'ed? The backstack just fire the intent again? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Activity Back Stack and OutOfMemoryError
2014-05-09 16:59 GMT+04:00 Daniel Rindt daniel.ri...@gmail.com: 2014-05-09 0:12 GMT+02:00 Kostya Vasilyev kmans...@gmail.com: Are you absolutely sure that your code does not leak memory? How to be absolutely sure. :-) Just kidding. Have you tried using Eclipse MAT and putting the app through the usual paces, like rotating the screen, pausing / restarting, etc.? This i have done: * app started, before killed * dump hprof and load with mat (leak suspects) * rotate, rotate, rotate... * dump hprof again load with mat (leak suspects) i compared the mat reports with the suspects and i see no differences in the leak suspects report. Which sould differ in the occupied size when i am not wrong? Well, personally, I usually use the object histogram at the starting point -- filtered by my app's package. When I see something that looks strange, I right click on a object class and do merge shortest paths to object roots to investigate. That's just me -- I've not used leak suspects -- but maybe you'd be able to see something interesting in the histogram? You'd mentioned the app being heavy on image processing -- is your memory allocation strategy based on how much memory your app's process gets? You can use ActivityManager#getMemoryClass for that. Actually i am aware of this complicated and consequences so i use the universal image loader which is configured to scale the images exact in the bitmap which cost cpu time, but preserves memory. That's a well known library, but I guess it still needs to be configured in a way that makes sense for your app's flow. It's too bad that your log does not have any memory allocation data. I'd consider implementing a crash handler that logs to a file, recording things like: Debug.getNativeHeapAllocatedSize() Debug.getNativeHeapFreeSize() Runtime.getRuntime().maxMemory() Runtime.getRuntime().totalMemory() Runtime.getRuntime().freeMemory() ActivityManager.getMemoryClass() I am new to the memory thing, and it doesn't happen a lot. It happens mostly on a rare ressource device. You can create an emulator image with lowered per-process memory quotas. Don't know if it actually works the way it's supposed to, but the setting is there. But question again starting lots of activities where you can go back should not be the issue? If the activity itself isn't leaking anything it can be gc'ed? The backstack just fire the intent again? There have been a few discussions on this list about it -- with no clear answer that I can remember. This should be fairly easy to verify in the debugger. Maybe you can use the lifecycle callbacks (onStop / onStart) to release some memory? -- K -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Activity Back Stack and OutOfMemoryError
2014-05-09 15:53 GMT+02:00 Kostya Vasilyev kmans...@gmail.com: 2014-05-09 16:59 GMT+04:00 Daniel Rindt daniel.ri...@gmail.com: 2014-05-09 0:12 GMT+02:00 Kostya Vasilyev kmans...@gmail.com: Are you absolutely sure that your code does not leak memory? How to be absolutely sure. :-) Just kidding. Have you tried using Eclipse MAT and putting the app through the usual paces, like rotating the screen, pausing / restarting, etc.? This i have done: * app started, before killed * dump hprof and load with mat (leak suspects) * rotate, rotate, rotate... * dump hprof again load with mat (leak suspects) i compared the mat reports with the suspects and i see no differences in the leak suspects report. Which sould differ in the occupied size when i am not wrong? Well, personally, I usually use the object histogram at the starting point -- filtered by my app's package. When I see something that looks strange, I right click on a object class and do merge shortest paths to object roots to investigate. That's just me -- I've not used leak suspects -- but maybe you'd be able to see something interesting in the histogram? I tried what you said, but please tell me what i can recognize as strange? I don't find a definitve guide to find a leak. I can't really see any weird thing. The only conclusion i come to is that every new opened activity consumes more heap and i have the feeling that this causes the oom. You'd mentioned the app being heavy on image processing -- is your memory allocation strategy based on how much memory your app's process gets? You can use ActivityManager#getMemoryClass for that. Actually i am aware of this complicated and consequences so i use the universal image loader which is configured to scale the images exact in the bitmap which cost cpu time, but preserves memory. That's a well known library, but I guess it still needs to be configured in a way that makes sense for your app's flow. I've set it for now just to preserve memory. It's too bad that your log does not have any memory allocation data. I'd consider implementing a crash handler that logs to a file, recording things like: Debug.getNativeHeapAllocatedSize() Debug.getNativeHeapFreeSize() Runtime.getRuntime().maxMemory() Runtime.getRuntime().totalMemory() Runtime.getRuntime().freeMemory() ActivityManager.getMemoryClass() I am new to the memory thing, and it doesn't happen a lot. It happens mostly on a rare ressource device. You can create an emulator image with lowered per-process memory quotas. Don't know if it actually works the way it's supposed to, but the setting is there. But question again starting lots of activities where you can go back should not be the issue? If the activity itself isn't leaking anything it can be gc'ed? The backstack just fire the intent again? There have been a few discussions on this list about it -- with no clear answer that I can remember. This should be fairly easy to verify in the debugger. Maybe you can use the lifecycle callbacks (onStop / onStart) to release some memory? You mean set collections to null? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Re: Alarm Intent not triggered
No, made it work. But now the real problem is alarm is raised only when my activity is running, otherwise it will not. Currently trying to make my alarm activity as background service but no luck still. Any suggestion? On Wed, Apr 23, 2014 at 10:57 PM, Raymond Rodgers raym...@badlucksoft.comwrote: Is the alarm working while the screen is on, but it's failing when the screen is off? If so, you may need to implement a wakelock or partial wakelock for it to work properly. On 04/19/2014 09:11 AM, Sunil.K wrote: Tried all possibilities, but no SUCCESS. Experts, please point my mistake I'm kind of stuck here :( On Friday, 18 April 2014 18:16:30 UTC+5:30, Sunil.K wrote: Hello, I am developing an app related to alarm service and facing an issue of Intent not being called. I have registered for event in manifest file: receiver android:name=com.example.myfirstapp.EventTriggerManager /receiver And have implemented EventTriggerManager class extended from BroadcastReceiver: public class EventTriggerManager extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { System.out.println(Alarm raised); Toast.makeText(context, Don't panik You have an alarm., Toast.LENGTH_LONG).show(); } } Adding an alarm from the Activity class: Intent intent = new Intent(this, EventTriggerManager.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(this.getApplicationContext(), 12345678, intent, 0); AlarmManager alarmManager = (AlarmManager) getSystemService(Context. ALARM_SERVICE); alarmManager.set(AlarmManager.RTC_WAKEUP, totalTime, pendingIntent); But alarm is not getting triggered when totalTime is reached in the system. Note: totalTime is absolute time used. Pls point my mistake why the expected output is not seen. Regards, Sunil -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Raymond Rodgershttp://www.badlucksoft.com/http://anevilgeni.us/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Thanks Regards Sunil * -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Re: Does the Android emulator run inside a VM?
I remember doing this last year, I had to unlink some of the GL drivers to get things to go through... I used a testing suite which did GUI interaction and had no need to use UI. Kris On Fri, May 9, 2014 at 8:45 AM, Charles charles.wh.c...@gmail.com wrote: Thanks, Yeah, it does work if I choose WXGA; RAM 512, heap 64; against latest 4.4.2 ARM/x86 images. Does takes a long time to load. On Wednesday, May 7, 2014 11:32:56 PM UTC-7, Ruud wrote: I've used the emulator successfully inside a VirtualBox VM recently. But didn't use all the options you used, and a lower resolution. It is slow though. Op donderdag 8 mei 2014 03:02:46 UTC+2 schreef Charles: Summary: Does the Android emulator run inside a VM? Or must it be run on a bare metal machine? I am trying to setup some automated tests using Jenkins using the Android plugin. The slave is a VM (on top) of VMWare ESXi, running Ubuntu Linux (32 bit x86). When the emulator tries to start the VM, it shows an error Failed to Initialize backend EGL display and nothing happens. [android] Using Android SDK: /home/hudson/hudson/tools/android-sdk [android] Creating Android AVD: /home/hudson/.android/avd/hudson_en-US_160_1080x1920_android-19_x86.avd [android] /home/hudson/hudson/tools/android-sdk/tools/android create avd -f -a -s 1080x1920 -n hudson_en-US_160_1080x1920_android-19_x86 -t android-19 --abi x86 [android] Setting hardware properties: hw.ramSize: 768 vm.heapSize: 64 $ /home/hudson/hudson/tools/android-sdk/platform-tools/adb start-server $ /home/hudson/hudson/tools/android-sdk/tools/emulator -snapshot-list -no-window -avd hudson_en-US_160_1080x1920_android-19_x86 [android] Starting Android emulator and creating initial snapshot $ /home/hudson/hudson/tools/android-sdk/tools/emulator -no-boot-anim -ports 45507,44892 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_1080x1920_android-19_x86 -no-snapshot-load -no-snapshot-save -wipe-data -no-window -noaudio -gpu off * daemon not running. starting it now on port 39784 * * daemon started successfully * Failed to Initialize backend EGL display ... emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. I tried with different abi (x86|x86) and options (combinations of -noaudio -gpu off). All failing. I also tried to login to the console and launch the emulator manually. All I see is a black emulator window. The emulator process is actively running ('top' command), but I don't see the home screen. Thanks, Charles -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Re: Does the Android emulator run inside a VM?
Right. Also, if you are using the SDK tools on 64 bit Linux, then additional steps are necessary because the Android SDK was compiled for 32-bit systems. I used the following guides to figure out the 32-bit libraries: * Ubuntu: http://www.vogella.com/tutorials/AndroidInstallation/article.html#installation_linux64 * CentOS: http://www.redips.net/android/emulator-fedora-linux/ On Friday, May 9, 2014 8:15:06 AM UTC-7, Kristopher Micinski wrote: I remember doing this last year, I had to unlink some of the GL drivers to get things to go through... I used a testing suite which did GUI interaction and had no need to use UI. Kris -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] override earphone click button
On Fri, May 9, 2014 at 2:32 AM, Sadhna Upadhyay sadhna.braah...@gmail.comwrote: can some one tell me that,can we override headphone functionality in android 4+ version please let me know if any one have idea You may want to explain what headphone functionality you're looking to override. - 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Handling touch events inside a listview
I've got custom views inside a listview. I've noticed that built-in widgets and other apps have a certain behavior. 1. When an item is tapped (DOWN) to initiate a move - the item is not hi-lighted (the listview starts to scroll) 2. When an item is held down for a little bit longer - then it's hi-lighted. 3. Of course if it's a quick DOWN and UP - it's also hi-lighted. How can I get a similar behavior - notably the one in the 2nd entry above. I'm doing this with a custom view items in the listview. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Activity Back Stack and OutOfMemoryError
2014-05-09 18:37 GMT+04:00 Daniel Rindt daniel.ri...@gmail.com: 2014-05-09 15:53 GMT+02:00 Kostya Vasilyev kmans...@gmail.com: Well, personally, I usually use the object histogram at the starting point -- filtered by my app's package. When I see something that looks strange, I right click on a object class and do merge shortest paths to object roots to investigate. That's just me -- I've not used leak suspects -- but maybe you'd be able to see something interesting in the histogram? I tried what you said, but please tell me what i can recognize as strange? I don't find a definitve guide to find a leak. I can't really see any weird thing. Well, I usually look at instance counts of large objects that act as allocation roots (e.g. allocate and own lots of other objects). In my case, they're fragments (more or less) and activities. For you app, you may want to dump total memory used by the image loader / cache -- although MAT won't help here. The only conclusion i come to is that every new opened activity consumes more heap and i have the feeling that this causes the oom. An activity instance is not that heavy by itself -- but in your app, sounds like it also owns a fair amount of bitmap data. That's a well known library, but I guess it still needs to be configured in a way that makes sense for your app's flow. I've set it for now just to preserve memory. Well, that sounds like a nice magic switch but personally, I would verify what actually happens to memory allocations. For example, would this library, with this setting, be able to get rid of in-memory bitmaps used by stopped activities? In ImageViews still attached to the content of their respective activities? There have been a few discussions on this list about it -- with no clear answer that I can remember. This should be fairly easy to verify in the debugger. Maybe you can use the lifecycle callbacks (onStop / onStart) to release some memory? You mean set collections to null? Yes, that sort of thing, and verifying that it actually did something (I'd trigger GC in DDMS a few times, until it reaches a stable point). -- K -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [android-developers] Handling touch events inside a listview
On Fri, May 9, 2014 at 12:41 PM, dashman erjdri...@gmail.com wrote: How can I get a similar behavior - notably the one in the 2nd entry above. I'm doing this with a custom view items in the listview. Your view's background should be a state-list drawable that defines the drawables to use for the relevant states. - 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 --- You received this message because you are subscribed to the Google Groups Android Developers group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.