[android-developers] Re: Video Playback freezes on 1.6 donut with opencore2
bump Anyone has any ideas? On Dec 18, 9:35 pm, Alexey Krasnoriadtsev ale...@agilefusion.com wrote: It looks like there is something wrong with the player (opencore), at times, video playback will get stuck on one frame, and will stay there for a long time. If you look at the log, you can see that player started playing at 17:59:48, at that time it has already buffered 6 seconds of video. Then at 17:59:53 the video and sound got stuck, while buffering kept going on in the background After 25 seconds (18:00:19) it resumed playing and buffer was already at 36 seconds, and all this time the api report that it is playing, meaning in the code, i don't know that video is stuck... Any thoughts or suggestions? This started to happen in donut (1.6) with the introduction ofopencore2. I have never seen this problem in with previous version of opencore (android versions = 1.5) Legend: the integers next to current and buffer are in seconds of video. while playerDriver buffering are in percentages. 12-18 17:59:48.529 D/dalvikvm(19121): GC freed 4446 objects / 813696 bytes in 294ms 12-18 17:59:48.589 V/UpdatedMediaPlayerActivity(19121): update progress, current: 0 buffer: 4 playing?true 12-18 17:59:49.109 V/UpdatedMediaPlayerActivity(19121): update progress, current: 0 buffer: 4 playing?true 12-18 17:59:49.269 D/PlayerDriver(18730): buffering (5) 12-18 17:59:49.619 V/UpdatedMediaPlayerActivity(19121): update progress, current: 1 buffer: 5 playing?true 12-18 17:59:50.119 V/UpdatedMediaPlayerActivity(19121): update progress, current: 1 buffer: 5 playing?true 12-18 17:59:50.279 D/PlayerDriver(18730): buffering (6) 12-18 17:59:50.619 V/UpdatedMediaPlayerActivity(19121): update progress, current: 2 buffer: 6 playing?true 12-18 17:59:51.119 V/RhythmClipBrowser(19121): channels count: 20 12-18 17:59:51.249 V/UpdatedMediaPlayerActivity(19121): update progress, current: 3 buffer: 6 playing?true 12-18 17:59:51.619 D/PlayerDriver(18730): buffering (7) 12-18 17:59:51.759 V/UpdatedMediaPlayerActivity(19121): update progress, current: 3 buffer: 7 playing?true 12-18 17:59:52.269 V/UpdatedMediaPlayerActivity(19121): update progress, current: 4 buffer: 7 playing?true 12-18 17:59:52.719 D/PlayerDriver(18730): buffering (7) 12-18 17:59:52.779 V/UpdatedMediaPlayerActivity(19121): update progress, current: 4 buffer: 7 playing?true 12-18 17:59:52.939 D/PlayerDriver(18730): buffering (8) - VIDEO FREEZES HERE, 12-18 17:59:53.289 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 8 playing?true 12-18 17:59:53.794 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 8 playing?true 12-18 17:59:54.301 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 8 playing?true 12-18 17:59:54.724 D/PlayerDriver(18730): buffering (8) 12-18 17:59:54.809 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 8 playing?true 12-18 17:59:55.314 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 8 playing?true 12-18 17:59:55.621 D/PlayerDriver(18730): buffering (9) 12-18 17:59:55.819 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:56.325 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:56.719 D/PlayerDriver(18730): buffering (9) 12-18 17:59:56.829 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:57.340 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:57.849 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:58.353 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:58.730 D/PlayerDriver(18730): buffering (9) 12-18 17:59:58.859 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:59.363 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:59.849 D/PlayerDriver(18730): buffering (10) 12-18 17:59:59.869 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 10 playing?true 12-18 18:00:00.371 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 10 playing?true 12-18 18:00:00.879 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 10 playing?true 12-18 18:00:01.119 D/PlayerDriver(18730): buffering (11) 12-18 18:00:01.349 I/ActivityManager( 73): Start proc com.android.calendar for broadcast com.android.providers.calendar/.CalendarAppWidgetProvider: pid=19211 uid=10021 gids={3003} 12-18 18:00:01.379 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 11 playing?true 12-18 18:00:01.679 I/dalvikvm(19211): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=38) 12-18 18:00:01.729 I/dalvikvm(19211
[android-developers] Video Playback freezes on 1.6 donut with opencore2
It looks like there is something wrong with the player (opencore), at times, video playback will get stuck on one frame, and will stay there for a long time. If you look at the log, you can see that player started playing at 17:59:48, at that time it has already buffered 6 seconds of video. Then at 17:59:53 the video and sound got stuck, while buffering kept going on in the background After 25 seconds (18:00:19) it resumed playing and buffer was already at 36 seconds, and all this time the api report that it is playing, meaning in the code, i don't know that video is stuck... Any thoughts or suggestions? This started to happen in donut (1.6) with the introduction of opencore2. I have never seen this problem in with previous version of opencore (android versions = 1.5) Legend: the integers next to current and buffer are in seconds of video. while playerDriver buffering are in percentages. 12-18 17:59:48.529 D/dalvikvm(19121): GC freed 4446 objects / 813696 bytes in 294ms 12-18 17:59:48.589 V/UpdatedMediaPlayerActivity(19121): update progress, current: 0 buffer: 4 playing?true 12-18 17:59:49.109 V/UpdatedMediaPlayerActivity(19121): update progress, current: 0 buffer: 4 playing?true 12-18 17:59:49.269 D/PlayerDriver(18730): buffering (5) 12-18 17:59:49.619 V/UpdatedMediaPlayerActivity(19121): update progress, current: 1 buffer: 5 playing?true 12-18 17:59:50.119 V/UpdatedMediaPlayerActivity(19121): update progress, current: 1 buffer: 5 playing?true 12-18 17:59:50.279 D/PlayerDriver(18730): buffering (6) 12-18 17:59:50.619 V/UpdatedMediaPlayerActivity(19121): update progress, current: 2 buffer: 6 playing?true 12-18 17:59:51.119 V/RhythmClipBrowser(19121): channels count: 20 12-18 17:59:51.249 V/UpdatedMediaPlayerActivity(19121): update progress, current: 3 buffer: 6 playing?true 12-18 17:59:51.619 D/PlayerDriver(18730): buffering (7) 12-18 17:59:51.759 V/UpdatedMediaPlayerActivity(19121): update progress, current: 3 buffer: 7 playing?true 12-18 17:59:52.269 V/UpdatedMediaPlayerActivity(19121): update progress, current: 4 buffer: 7 playing?true 12-18 17:59:52.719 D/PlayerDriver(18730): buffering (7) 12-18 17:59:52.779 V/UpdatedMediaPlayerActivity(19121): update progress, current: 4 buffer: 7 playing?true 12-18 17:59:52.939 D/PlayerDriver(18730): buffering (8) - VIDEO FREEZES HERE, 12-18 17:59:53.289 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 8 playing?true 12-18 17:59:53.794 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 8 playing?true 12-18 17:59:54.301 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 8 playing?true 12-18 17:59:54.724 D/PlayerDriver(18730): buffering (8) 12-18 17:59:54.809 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 8 playing?true 12-18 17:59:55.314 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 8 playing?true 12-18 17:59:55.621 D/PlayerDriver(18730): buffering (9) 12-18 17:59:55.819 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:56.325 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:56.719 D/PlayerDriver(18730): buffering (9) 12-18 17:59:56.829 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:57.340 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:57.849 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:58.353 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:58.730 D/PlayerDriver(18730): buffering (9) 12-18 17:59:58.859 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:59.363 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 9 playing?true 12-18 17:59:59.849 D/PlayerDriver(18730): buffering (10) 12-18 17:59:59.869 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 10 playing?true 12-18 18:00:00.371 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 10 playing?true 12-18 18:00:00.879 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 10 playing?true 12-18 18:00:01.119 D/PlayerDriver(18730): buffering (11) 12-18 18:00:01.349 I/ActivityManager( 73): Start proc com.android.calendar for broadcast com.android.providers.calendar/.CalendarAppWidgetProvider: pid=19211 uid=10021 gids={3003} 12-18 18:00:01.379 V/UpdatedMediaPlayerActivity(19121): update progress, current: 5 buffer: 11 playing?true 12-18 18:00:01.679 I/dalvikvm(19211): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=38) 12-18 18:00:01.729 I/dalvikvm(19211): Debugger thread not active, ignoring DDM send (t=0x41504e4d l=44) 12-18 18:00:01.749 I/ActivityThread(19211): Publishing provider calendar:
Re: [android-developers] Re: Using MediaPlayer best practices?
You can register the buffering listener and save the current buffering position. You can also poll for current position say every second (using your ui handler), and if current position did not change since last poll, show ui message (or dialog). Alexey Krasnoriadtsev Agile Fusion Corp On Wed, Nov 4, 2009 at 9:23 AM, Moto medicalsou...@gmail.com wrote: Thanks Alex! When you say peek at the MediaPlaybackService you mean android framework code? I was afraid that MediaPlayer would somehow end in an invalid state if the internal server died or something but I guess reset() cleans it up... As of now I just use Reset() to stop playback.. :P seems to be faster than Stop() plus it cleans the MediaPlayer to be ready for another SetDataSource() and Prepare()... Something I don't like about MediaPlayer is that you can't get the audio status! Say it's progressively playing a file from the internet and all the sudden audio stops because it doesn't have enough data... I want to know when that happens and there is no information for that... Any ideas on this part? Thanks, -Moto On Nov 4, 3:34 am, Alexey Krasnoriadtsev ale...@agilefusion.com wrote: Preparing a mediaPlayer is the most expensive operation. calling stop() or pause() and then start() works best for me. You can also peek at the MediaPlaybackService for inspiration. Why do you think it will get into the bad state? On Nov 3, 7:14 pm, Moto medicalsou...@gmail.com wrote: What is the best way to use the MediaPlayer when needed multiple times? Reuse the instantiated MediaPlayer throughout the session? Or constantly stop() release() and instantiate a new MediaPlayer() ? If I reuse I'm afraid the player could be in a bad state? What about performance wise? what's better? reuse or renew? Note: This is for using as a music player so one audio be present at one given time... Thank! -Moto! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Using MediaPlayer best practices?
Preparing a mediaPlayer is the most expensive operation. calling stop() or pause() and then start() works best for me. You can also peek at the MediaPlaybackService for inspiration. Why do you think it will get into the bad state? On Nov 3, 7:14 pm, Moto medicalsou...@gmail.com wrote: What is the best way to use the MediaPlayer when needed multiple times? Reuse the instantiated MediaPlayer throughout the session? Or constantly stop() release() and instantiate a new MediaPlayer() ? If I reuse I'm afraid the player could be in a bad state? What about performance wise? what's better? reuse or renew? Note: This is for using as a music player so one audio be present at one given time... Thank! -Moto! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Dynamic Image loading from Resources in ImageView
you can place your images directly under assets directory, and then use getResources().getAssets().open(path to file); On Jul 31, 1:55 pm, DroidDude bhavy...@gmail.com wrote: Hi, I am very new to Android Development and I have a doubt regarding Image Loading in ImageView from R.drawable. Just to brief What I am trying to accomplish is :Showing a ListView with ImageView and TextView using ViewWrapper pattern. I get the Text Value for TextView from one http service and I store all the values in String Array. I have implemented my own Adapter with my own implementation of getView(). Now the issue: I have put all the images i want to show in res/drawable folder. now based on the value of text I want to pick that image from the folder and show it in the Imageview. For Example: if i get aaa as the value of TextView. I already have aaa.jpg in res/ drawable folder and I want to set that image in ImageView. I don't know how to get the handle for aaa.jpg in androind. I have tried follwoing with no luck: ImageView.setImageResource() - But it takes the rID as argument which is of type int. I cant generate R.drawable.+myVairable. ImageView.setImageDrawable(Drawable.createFromPath(PATHVariable))-But I don't know how to give the path to the image. I tried ./res/ drawable/+variable+.jpg BitmapFactory takes the similar argument for all its method. I really don't want to write any Async Image Loader based on any server based URIs as I dont have any hosting server available. Kindly help. 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: Alternatives to Multitouch
double tap, that circles through predefined zoom levels. On Jul 18, 11:18 am, Jason Van Anden jason.van.an...@gmail.com wrote: 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: Media AspectRatio
Is the aspect ration is really different, or do you think youtube app just re sizes video to fit the screen? You can dynamically adjust SurfaceView layout parameters to take all you screen, maintaining aspect ration. On Jul 10, 8:26 am, glory hiti.dee...@gmail.com wrote: Hi, I am playing the video from the you tube link.But the video played by my Application has different aspect ratio then what played by the youtube application. How to play the video in the same aspect ratio as that of the youtube application. I am using Video View for playing the application. Please help me out Thanks in advance Glory --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Associate app to open email attachments
You are correct that you should use contentResolver.openInputStream (uri), to get the data from gmail attachments. Default Email app, is very dumb and is hardcoded to only open audio and image attachments. (disclaimer, that was the case 6 month ago, the last time i looked at it). On Jul 8, 10:16 am, Mirko Nasato mirko.nas...@gmail.com wrote: Hi all, I've written an app that can handle the VIEW action for a given mimeType, say application/foo. By adding the following to AndroidManifest.xml the Browser automatically uses my app to open downloads of that type: intent-filter action android:name=android.intent.action.VIEW/ category android:name=android.intent.category.DEFAULT/ data android:mimeType=application/foo/ /intent-filter The GMail app also tries to use my app to Preview attachments of that type, but it's passing a URI with scheme gmail-ls:// rather than a file:// URI. I guess I need to use a ContentProvider to get the attachment data, I haven't looked into that yet. But the real mystery is the Email app... there just doesn't seem any way to make it open the attachments. Any pointers? Opening attachments is a very common requirement of course, and I would expect the Android platform to encourage developers to write apps to handle more mime types. Instead I couldn't find any answers: http://groups.google.com/group/android-developers/browse_thread/threa... http://groups.google.com/group/android-developers/browse_thread/threa... Thanks Mirko --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Image
You can create your class that will extend from ImageView. at some point store a Drawable of the small image as an instance variable. overwrite public void onDraw(Canvas canvas){ super.onDraw(canvas); mDrawable.setBounds(0, 0, drawableWidth, drableHeight); mDrawable.draw(canvas); } This will draw your smaller image (mDrawable), in the top left corner. On Jul 7, 10:45 pm, peeyush varshney varshney.peey...@gmail.com wrote: I want that user can move smaller one and drop any where he want over Big Image. It is almost same as SeekBar. I tried same with vertical SeekBar with also. but SeekBar Thumb is not getting adjust according to progress. On Wed, Jul 8, 2009 at 11:00 AM, Balwinder Kaur (T-Mobile) balwinder.k...@t-mobile.com wrote: You can try something like this : Create a mutable bitmap from your original image. //You can use the BitmapFactory class for that. http://developer.android.com/reference/android/graphics/BitmapFactory... Lets call it Bitmap b; Create a Canvas c as show below. Canvas c = new Canvas(b); Create another bitmap from the small Seeker Type image. Lets call it Bitmap bsmall. c.drawBitmap(bsmall, ...); //Choose one of the drawBitmap methods http://developer.android.com/reference/android/graphics/Bitmap.html Balwinder Kaur Open Source Development Center ·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 7, 10:02 pm, peeyush varshney varshney.peey...@gmail.com wrote: Hi All, Has anyone customized the Image. Actually I want to have one Image and over that one more samll Seeker Type image, Is it possible. Do anyone have some Idea please help me out.. -- Thank Regards Peeyush Varshney -- Thank Regards Peeyush Varshney --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Capture the Android's browser HTTP petitions
GIT is the repository where all android code is. for Browser, here is the specific link: http://android.git.kernel.org/?p=platform/packages/apps/Browser.git;a=summary On Jun 21, 1:02 pm, psaltamontes mcg2...@gmail.com wrote: @Alexey : What's the meaning of git? @ Hamy : ¡ I needed this line :) ! - resp.getEntity().writeTo(bao); I'm sure that the code that you are put help me a lot. @ Raphael : I used Google before put my question here. If you search this --http://www.google.com/search?q=set+proxy+for+android+web+browser The information that Google found is about change the general/main proxy, I only want redirect the browser's traffic. Thank you people. On 21 jun, 00:56, Raphael r...@android.com wrote: On Fri, Jun 19, 2009 at 7:57 AM, psaltamontesmcg2...@gmail.com wrote: Yes, I want to say request :), sorry , I need improve my English. I don't want my application modify the settings of the browser, the idea is that the user configure the proxy of the browser and install my application. This application is a service that listen theHTTP requests and send to the Internet. This might help: http://www.google.com/search?q=set+proxy+for+android+web+browser R/ I want capture theHTTPrequest and modify the headers because, in the header, I put a number to identify the client that connect to my webserver, doing this, the user don't have to put an user name and a password. I have written the code to do this, in PC works, but in Android I don't know how to get this behaviour. How can I do? On 18 jun, 21:14, Mark Murphy mmur...@commonsware.com wrote: I need capture the Android's browserHTTPpetitions. I think you mean request, not petition. In PC to capture theHTTPpetitions is easy, I change the browser configuration, I put localhost and a port () and it's works. But, in Android I don't know how to change the browser configuration. I would be rather surprised if they allowed applications to adjust the proxy server settings of the browser application. That would be a way for spyware to attack the user. For the emulator, you can set up a proxy server from outside the emulator environment itself: http://developer.android.com/guide/developing/tools/emulator.html#proxy -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Capture the Android's browser HTTP petitions
You can create your own Browser application, that will allow proxy configuration. You can also take original Browser app as the base (it's available in git). Those users who need proxy will be able to install your browser application and use it. On Jun 19, 9:44 am, psaltamontes mcg2...@gmail.com wrote: Here, http://groups.google.com/group/android-developers/browse_thread/threa... there is information about classes that I can use to modify HTTP requests. I will try something with this classes. On 19 jun, 17:34, psaltamontes mcg2...@gmail.com wrote: Do you know/think if this option will be in the future? Now, I'm trying to do something with a webview and webviewclient. But I don't know how to send a RAW HTTP request using these classes. I can send/receive RAW HTTP with sockets, but I don't know how to link these sockets with the webview. Any idea? Thanks. On 19 jun, 17:14, Mark Murphy mmur...@commonsware.com wrote: Yes, I want to say request :), sorry , I need improve my English. I don't want my application modify the settings of the browser, the idea is that the user configure the proxy of the browser and install my application. This application is a service that listen the HTTP requests and send to the Internet. Hmmm...I do not see where users can set their proxy server, either. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Howto detect media actions
Have you tried forcing any of the MediaScanner actions? like adding new image to the sd card, removing/inserting sdcard. download img or mp3 through browser. On Jun 18, 10:01 am, JayBird jayje...@gmail.com wrote: Hi Folks, I'm trying to detect media events. As a test I created a simple broadcast receiver so that I can understand the media events. However, for some reason I'm not receiving the broadcast. Here is my code segment and manifest below ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.test android:versionCode=1 android:versionName=1.0 application android:icon=@drawable/icon android:label=@string/ app_name receiver android:name=.MSDEBroadcastReceiver intent-filter action android:name=android.intent.action.ACTION_MEDIA_BAD_REMOVAL / action android:name=android.intent.action.ACTION_MEDIA_MEDIA_CHECKING / action android:name=android.intent.action.ACTION_MEDIA_EJECT / action android:name=android.intent.action.ACTION_MEDIA_MOUNTED / action android:name=android.intent.action.ACTION_MEDIA_NOFS / action android:name=android.intent.action.ACTION_MEDIA_REMOVED / action android:name=android.intent.action.ACTION_MEDIA_SHARED / action android:name=android.intent.action.ACTION_MEDIA_UNMOUNTABLE / action android:name=android.intent.action.ACTION_MEDIA_UNMOUNTED / action android:name=com.test.JAY / /intent-filter /receiver /application /manifest Code Segment package com.test; import android.content.BroadcastReceiver; public class MSDEBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { // Get the details of the intent String action = intent.getAction(); Log.i(LOG_TAG, - IntentAction: + action); } private static final String LOG_TAG = MSDEBroadcastReceiver; } I verified via a logcat that my receiver is working by doing the following in a shell # am broadcast -a com.test.jay Did I miss something? Thanks in advance, Jay --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Use drawable in TextView with SimpleAdapter
you can extend SimpleAdapter and textView.setCompoundDrawable() while you build view. On Jun 18, 3:17 pm, vovkab vov...@gmail.com wrote: Hello I want to use TextView as ListView item. Is any way to assign left drawable to TextView via SimpleAdapter? Thanks for any help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Wake Locks and Services
http://developer.android.com/reference/android/view/View.html#attr_android:keepScreenOn This will keep the screen on, while your view is visible. On Jun 16, 3:52 am, Thomas Riley tomrile...@googlemail.com wrote: How would I go about doing this. I have the wake lock working ok now but no harm in knowing a different method... On Jun 16, 8:49 am, Dianne Hackborn hack...@android.com wrote: Do you REALLY need to hold a full wake lock like this? The vast majority of apps should use the window flag to keep the screen on while their UI is shown. This way you don't need the power permission, and you are much less likely to have bugs that leave the screen on and cause the user's battery to drain. On Sat, Jun 13, 2009 at 3:04 PM, Thomas Riley tomrile...@googlemail.comwrote: I need to use a wakelock to hold the screen active while its required. I was recommended to use a service which I have been trying but on the onDestroy I am getting wl cannot be resolved. Code below: public class WakeLockService extends Service { �...@override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } public void onCreate() { PowerManager pm = (PowerManager) getSystemService (Context.POWER_SERVICE); PowerManager.WakeLock wl = pm.newWakeLock (PowerManager.FULL_WAKE_LOCK, My Tag); wl.acquire(); } public void onDestroy() { wl.release(); } } -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Sharing common view layouts and resources across multiple Android applications (APKs)
There is no such way right now to share resources between the apps. However, if you are building your own version of OS, you can add this functionality into the system image. On Jun 2, 11:09 am, Nag raju...@gmail.com wrote: I am working on developing several individual android applications. We had created common UI Layout View XMLs, classes and resources. I would like to share these common layout xml, classes and resources across all of my android applications. I dont want to duplicate them in my applications. Is there any easy way to do this? Thanks Nag --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: load image from the web?
In addition to Mark's suggestion, I would encourage you to use httpclient apis, instead of direct urlconnection. On May 25, 3:11 am, Mark Murphy mmur...@commonsware.com wrote: Bear in mind that the code shown below runs on the UI thread. This means the UI thread is blocked until the HTTP request returns. If the HTTP request has a problem (e.g., the server is not responding), it could very easily take beyond the ~5 seconds allowed before an application-not-responding (ANR) error occurs and your activity is forcibly closed. I heartily encourage you to use a placeholder image when launching your UI and have the real image downloaded off the Web in the background. AsyncTask should work very well for this case -- you can download and decode the image in doInBackground() and apply it to the ImageView in onPostExecute(). Nithin Varamballi wrote: hi... I did like this.. This may help you public class demo extends Activity { /** Called when the activity is first created. */ ImageView i1; public int position=0; private String[] myRemoteImages = { http://www.cssnz.org/flower.jpg}; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); button1 = (Button) findViewById(R.id.clear); i1 =(ImageView) findViewById(R.id.i1); load(); } } public void load() { try { URL aURL = new URL(myRemoteImages[i]); URLConnection con = aURL.openConnection(); con.connect(); InputStream is = con.getInputStream(); /* Buffered is always good for a performance plus. */ BufferedInputStream bis = new BufferedInputStream(is); /* Decode url-data to a bitmap. */ Bitmap bm = BitmapFactory.decodeStream(bis); i1.setImageBitmap(bm)); bis.close(); is.close(); /* Apply the Bitmap to the ImageView that will be returned. */ } catch (IOException e) { Log.e(DEBUGTAG, Remtoe Image Exception, e); } } Thank You Nithin N V -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android App Developer Training:http://commonsware.com/training.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to track down: java.lang.IllegalArgumentException: View not attached to window manager
Before calling Dialog.dismiss() try checking whether it is shown, isShown(); On May 19, 10:22 pm, Mariano Kamp mariano.k...@gmail.com wrote: Exactly my original point. That's the reason I originally asked this: I am wondering how to track down this IAE? It doesn't mention my code (com.newsrob.*) in the stack trace. Is there anymore information that I can automatically gather and include in the bug reports to get a better understanding why this happens? I just have the stack traces and wonder how to go from there. Mariano On Wed, May 20, 2009 at 7:10 AM, Romain Guy romain...@google.com wrote: Since Cupcake I have a couple of those issues where I don't see my code in the stack trace. That doesn't mean it's not your code at fault. For instance in this case what are you doing with the dialogs and their parent activities? -- 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: Add my application in Share menu gallery or others application
You would need to register your activity for Intent.ACTION_SEND, with the mime-type that you would like to support, in case of pictures, I would recommend image/* When in the Gallery user clicks on share, it scans the system for any activities that are registered to handle ACTION_SEND with picture's mime-type, and displays a dialog to the user, with the names of those activities. Google ACTION_SEND for samples on how to implement your activity. -Alexey Krasnoriadtsev On May 10, 1:38 am, arnouf arnaud.far...@gmail.com wrote: Hi all, I would like that users using Pictures application or an other app can launch my application directly. Two ways apparently exist: - add directly a menu in the other application (exemple: I use share menu in Gallery app and I can share by sms, email...or my app) - each application can be replaced by another: exemple when I installed aHome application changing the standard home application, a popup is displayed to choose app that I want launch How can I do these two methods? Thanks a lot for all your answers Best regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: how to check if sdcard is mounted in program
Also, most of the time, you would want to register and IntentReceiver to be notified when SD card is unmounted. On Apr 16, 10:27 pm, Desu Vinod Kumar vinny.s...@gmail.com wrote: public static boolean isSdPresent() { returnandroid.os.Environment.getExternalStorageState().equals(android.os. Environment.MEDIA_MOUNTED);} go through this http://code.google.com/android/reference/android/os/Environment.html On Fri, Apr 17, 2009 at 10:04 AM, sunwrt wrt.su...@gmail.com wrote: Any guy knows how to check if sdcard is mounted in program Thanks in advance! -- Regards --- Desu Vinod Kumar vinny.s...@gmail.com 09916009493 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Bitmap Memory
There best working approach is to only load Bounds of the image, and then use scale to load the Bitmap of the needed size. This way you never load the full-size bitmap in the memory. http://code.google.com/intl/ja/android/reference/android/graphics/BitmapFactory.Options.html#inJustDecodeBounds get the bounds, and then use those to calculate the appropriate sample size. On Feb 26, 2:36 pm, mark.ka...@gmail.com wrote: I'm just saying there have been a number of threads on this issue, I've had out of memory problems when processing bitmaps, and so have many other developers. It looks to me like a bug IMHO. I hope this problem will be resolved at some point. On Feb 26, 2:02 pm, bra...@gmail.com peacoc...@gmail.com wrote: If that is the case then why does calling myBitmap.recycle not give me that memory back to use for the next time I go into an edit. On Feb 26, 4:59 pm, Romain Guy romain...@google.com wrote: BitmapFactory does NOT leak Bitmaps. A 2056x1536 opaque image requires 6 MB of RAM. An application has 16 MB max. Do the math. On Thu, Feb 26, 2009 at 1:50 PM, mark.ka...@gmail.com wrote: Are you using BitmapFactory? There have been a number of threads about memory leaks, or similar problems when using BitmapFactory to process bitmaps. Using Bitmap.recycle may mitigate, but not eliminate these types of problems. M On Feb 26, 11:39 am, Mattaku Betsujin mattaku.betsu...@gmail.com wrote: I think the best solution to handle very large bitmaps is to be able to decode only a small chunk of the bitmap at a time and process it. Does anyone know if the existing Android API can support this? If not, probably one solution is to write a smart decoder (in Java, so slow :-( ) that can decode a small chunk. On Thu, Feb 26, 2009 at 11:32 AM, Tomei Ningen tomei.nin...@yahoo.comwrote: You're running into memory fragmentation problems. Bitmap memory is not allocated from the Java object heap. Instead, it's allocated from the 'malloc' heap. That's why you don't see the Java heap expanding. How big is your bitmap? If you're processing JPEG files, probably it will be better to read the thumbnail directly from the JPEG file. This way you don't need to create the Bitmap at all. On Feb 26, 9:47 am, bra...@gmail.com peacoc...@gmail.com wrote: Ok I am at the end of my rope. I am doing some image processing. I have a large image file which I open and create a smaller bitmap from. At the end of processing I call recycle on everything. I null everything. I run GC manually. I then try edit another image and I get an out of VM memory error. Bitmap exceeds etc etc. I am looking at the heap and the secone edit doesnt seem to cause it to increase at all. What else can I do. Surely google cannot possibly be suggesting that we can open one large bitmap per session and thats it?- Hide quoted text - - Show quoted text - -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---