[android-developers] Mechanism for collecting UDP Data

2012-02-19 Thread rperi...@yahoo.com
I'm trying to figure out a means to collect UDP packets as they come
in. I have been able to successfully collect one packet using
AsyncTask but it's not clear how to make this happen on an ongoing
basis. I cannot see an obvious means to generate a callback when a
packet arrives so I assume this is done by some means of polling. I
tried using classes like ScheduledThreadPoolExecutor and creating a
new thread but in all cases even though I'm trying to access the UDP
buffer in another thread I'm getting the exception (cannot recall the
exact name but it refers to trying to do network operations on the
main UI thread).

One way to make this work would be to run an AsyncTask on a timer but
can anyone suggest why I may be having this issue or some ways to make
this 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] Support for video streaming over RTP

2012-01-23 Thread rperi...@yahoo.com
Is this something that is supported? A quick search shows a class
RtpStream but it does not seem to do a whol lot. There appear to be
other classes which make use of RtpStream for streaming audio but
nothing that I can see for playing video.

Has anyone been able to receive rtp streams and play it on MediaPlayer.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Forcing an item in a GridView to remain highlighted after clicking

2012-01-20 Thread rperi...@yahoo.com
Okay thanks I will look into what you suggest. I did try the
setEnabled() method as well as setSelected() method among other things
and they all had no effect. I assumed the item would assume the
default behaviour in terms of selected color. But I will try
explicitly specifying that and see if it works.

On Jan 20, 2:02 am, jamesc jame...@gmail.com wrote:
 Create a new selector 
 (seehttp://developer.android.com/guide/topics/resources/drawable-resource...)
 for the item, and then configuring the colour/background values
 depending on state. By state, I mean, your item could be
 'Checkable' (i.e. only a single item in the whole GridView can be
 checked at a time) and then when it's tapped, set it to checked, and
 the appropriate value in the selector would be chosen. Alternatively,
 you could use the item's .setEnabled() method and do something
 similar.

 You may also need to be aware of the android:duplicateParentState
 attribute.

 On Jan 20, 6:10 am, rperi...@yahoo.com rperi...@yahoo.com wrote:



  I would like to make the blue border around a gridview item remain
  highlighted after clicking on it as a reminder to the user which item
  was slected while making the second choice. I have tried a number of
  methods from the View class and none of them seem to have any effect -
  the border disappears after a short while. Any ideas how to do this?- 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: No Video but audio present when using MediaPlayer on the emulator

2012-01-19 Thread rperi...@yahoo.com
Okay I got it done using the DDMS file manager. I have to say your
original thoughts about reasons for the video not playing is
absolutely correct. With your app I can also hear the audio but cannot
see any video. I can also see the all the control buttons and the
progress bar. I do not get the control buttons on my app but in my app
I'm using the MediaPlayer directly - not through MediaController.

I guess I will need to move to using a real device.

On Jan 19, 4:49 am, Mark Murphy mmur...@commonsware.com wrote:
 In your AVD Manager, you define how large of a virtual SD card to have
 in the AVD. It's called SD Card.

 You then transfer files to it using the DDMS File Manager, or via the
 adb push command.





 On Thu, Jan 19, 2012 at 2:54 AM, rperi...@yahoo.com rperi...@yahoo.com 
 wrote:
  Okay I'm still stuck trying to figure out how to use the SD card
  filesystem on the emulator. I followed the instructions in the
  documentation and created a sd card image using mksdcard. However, I
  cannot figure out how to push the test.mp4 file on to the image. The
  documentation mentions mtools but I cannot seem to find a version for
  Windows - all the downloads seem to be for Unix. Any ideas?

  On Jan 18, 3:57 am, Mark Murphy mmur...@commonsware.com wrote:
  On Wed, Jan 18, 2012 at 2:45 AM, rperi...@yahoo.com rperi...@yahoo.com 
  wrote:
   Thanks again for the reply. I actually subscribed to your books - they
   are well written.

  Thanks!

   I downloaded the video sample and tried to run it
   but the screen remains blank. However I suspect it is becuase it
   cannot find the file. It seems like it is designed run the file
   test.mp4 on an SD card on a real device.

  Or a test.mp4 file on the emulated SD card on an emulator. It still
  will not play well in an emulator, but the lack of the MP4 file will
  not stop you.

   Can I make the sample work on the emulator.

  Yes. Put a file named test.mp4 in the emulated SD card on the
  emulator. The specific MP4 file I used in those screenshots is the
  Documentaries and You video from here:

 http://www.law.duke.edu/cspd/contest/finalists/

  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

  _The Busy Coder's Guide to Android Development_ Version 3.7 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

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Warescription: Three Android Books, Plus Updates, One Low Price!- 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] Forcing an item in a GridView to remain highlighted after clicking

2012-01-19 Thread rperi...@yahoo.com
I would like to make the blue border around a gridview item remain
highlighted after clicking on it as a reminder to the user which item
was slected while making the second choice. I have tried a number of
methods from the View class and none of them seem to have any effect -
the border disappears after a short while. Any ideas how to do this?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: No Video but audio present when using MediaPlayer on the emulator

2012-01-18 Thread rperi...@yahoo.com
Okay I'm still stuck trying to figure out how to use the SD card
filesystem on the emulator. I followed the instructions in the
documentation and created a sd card image using mksdcard. However, I
cannot figure out how to push the test.mp4 file on to the image. The
documentation mentions mtools but I cannot seem to find a version for
Windows - all the downloads seem to be for Unix. Any ideas?

On Jan 18, 3:57 am, Mark Murphy mmur...@commonsware.com wrote:
 On Wed, Jan 18, 2012 at 2:45 AM, rperi...@yahoo.com rperi...@yahoo.com 
 wrote:
  Thanks again for the reply. I actually subscribed to your books - they
  are well written.

 Thanks!

  I downloaded the video sample and tried to run it
  but the screen remains blank. However I suspect it is becuase it
  cannot find the file. It seems like it is designed run the file
  test.mp4 on an SD card on a real device.

 Or a test.mp4 file on the emulated SD card on an emulator. It still
 will not play well in an emulator, but the lack of the MP4 file will
 not stop you.

  Can I make the sample work on the emulator.

 Yes. Put a file named test.mp4 in the emulated SD card on the
 emulator. The specific MP4 file I used in those screenshots is the
 Documentaries and You video from here:

 http://www.law.duke.edu/cspd/contest/finalists/

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 _The Busy Coder's Guide to Android Development_ Version 3.7 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: No Video but audio present when using MediaPlayer on the emulator

2012-01-17 Thread rperi...@yahoo.com
Does anyone have any sample code for playing video. Although it could
be emulator using the debugger it seems like the window is not even
being created even when the Mediaplayer is turned off. I'm using a
class I extended from VideoView. The surfaceCreated method does not
ever get called. I'm using this view within a GridView and I cannot
get any response from the OnClicked handler in the GridView. It works
fine for other objects in the GridView.

A working sample would be very useful to help me see what is going on.

As a sidenote I have a 3.6GHz Quadcore PC. Does the emulator make use
of the multiple cores?

On Jan 16, 7:22 pm, rperi...@yahoo.com rperi...@yahoo.com wrote:
 Thanks for the reply Mark. I guess I will need to try it out on a real
 device.

 On Jan 16, 4:25 am, Mark Murphy mmur...@commonsware.com wrote:



  You are trying to use the emulator to play back video. This is
  unlikely to be successful due to the speed of the emulator. For
  testing video in apps, most likely you will need to use an Android
  device.

  On Mon, Jan 16, 2012 at 1:09 AM, rperi...@yahoo.com rperi...@yahoo.com 
  wrote:
   Has anyone else had this issue. I'm trying to play video and the video
   window is not present although I can hear audio. I tried creating the
   Mediaplayer as an AsyncTask and the same thing happens although UI
   performance is much better.

   Any ideas on what could be wrong?

   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

  Android Training in DC:http://marakana.com/training/android/-Hide quoted 
  text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: No Video but audio present when using MediaPlayer on the emulator

2012-01-17 Thread rperi...@yahoo.com
Thanks again for the reply. I actually subscribed to your books - they
are well written. I downloaded the video sample and tried to run it
but the screen remains blank. However I suspect it is becuase it
cannot find the file. It seems like it is designed run the file
test.mp4 on an SD card on a real device.

Can I make the sample work on the emulator. I just to see if the
problem is really the emulator or something on in my program. I was
hoping I could try out your sample to prove this.

On Jan 17, 4:00 am, Mark Murphy mmur...@commonsware.com wrote:
 On Tue, Jan 17, 2012 at 3:32 AM, rperi...@yahoo.com rperi...@yahoo.com 
 wrote:
  Does anyone have any sample code for playing video.

 https://github.com/commonsguy/cw-advandroid/tree/master/Media/Video

  As a sidenote I have a 3.6GHz Quadcore PC. Does the emulator make use
  of the multiple cores?

 No. If the CPU is a Core i7 with TurboBoost, the extra cores will help
 speed up the core that qemu is using. Otherwise, extra cores have no
 real impact.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 _The Busy Coder's Guide to Android Development_ Version 3.7 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: No Video but audio present when using MediaPlayer on the emulator

2012-01-16 Thread rperi...@yahoo.com
Thanks for the reply Mark. I guess I will need to try it out on a real
device.

On Jan 16, 4:25 am, Mark Murphy mmur...@commonsware.com wrote:
 You are trying to use the emulator to play back video. This is
 unlikely to be successful due to the speed of the emulator. For
 testing video in apps, most likely you will need to use an Android
 device.





 On Mon, Jan 16, 2012 at 1:09 AM, rperi...@yahoo.com rperi...@yahoo.com 
 wrote:
  Has anyone else had this issue. I'm trying to play video and the video
  window is not present although I can hear audio. I tried creating the
  Mediaplayer as an AsyncTask and the same thing happens although UI
  performance is much better.

  Any ideas on what could be wrong?

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android Training in DC:http://marakana.com/training/android/- 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] No Video but audio present when using MediaPlayer on the emulator

2012-01-15 Thread rperi...@yahoo.com
Has anyone else had this issue. I'm trying to play video and the video
window is not present although I can hear audio. I tried creating the
Mediaplayer as an AsyncTask and the same thing happens although UI
performance is much better.

Any ideas on what could be wrong?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Seekbar button separating from slider

2012-01-08 Thread rperi...@yahoo.com
Hi everyone - I'm using the seekbar for the first time within a
RelativeLayout. When I try to reposition the bar using LayoutParams
and setPadding the bar does move as expected but I also see the button
moving apart from the progress slider. I'm unclear what is going on.
Has anyone else seen this?

Also I need a vertical seekbar. setRotation(90) seems to work but it
is very hard to get the slider to move. Again I did not see any
obvious way of creating a vertical seekbar.

Any suggestions/insights would be welcome.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en