[android-developers] Sound in games

2009-10-09 Thread yarik...@gmail.com

Hi all!

I have pretty common question:
is there any bug-free way to implement sound effects in a game?

Or we only have unpredictable SoundPool with its horrible bugs?
Or MediaPlayer that can only play one sound at once and which
is not solution for a game at all?

In fact, it is disturbing question for numerous developers right 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: Sound in games

2009-10-09 Thread yarik

MediaPlayer cuts last few milliseconds in short sounds after first
playing, at least with wma files.

On Oct 9, 12:28 pm, sleith raysle...@gmail.com wrote:
 how about allocate many MediaPlayer? is it bad?

 On Oct 9, 4:07 pm, yarik...@gmail.com yarik...@gmail.com wrote:



  Hi all!

  I have pretty common question:
  is there any bug-free way to implement sound effects in a game?

  Or we only have unpredictable SoundPool with its horrible bugs?
  Or MediaPlayer that can only play one sound at once and which
  is not solution for a game at all?

  In fact, it is disturbing question for numerous developers right 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: Sound in games

2009-10-09 Thread yarik

At the same time playing mp3 or ogg with MediaPlayer it is too slow
for games, it causes lags.

On Oct 9, 12:46 pm, yarik yarik...@gmail.com wrote:
 MediaPlayer cuts last few milliseconds in short sounds after first
 playing, at least with wma files.

 On Oct 9, 12:28 pm, sleith raysle...@gmail.com wrote:



  how about allocate many MediaPlayer? is it bad?

  On Oct 9, 4:07 pm, yarik...@gmail.com yarik...@gmail.com wrote:

   Hi all!

   I have pretty common question:
   is there any bug-free way to implement sound effects in a game?

   Or we only have unpredictable SoundPool with its horrible bugs?
   Or MediaPlayer that can only play one sound at once and which
   is not solution for a game at all?

   In fact, it is disturbing question for numerous developers right 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: GridView and BaseAdapter position bug

2009-04-28 Thread yarik...@gmail.com

I have exactly same problem. Why do we have 102 values of position
when there is only 100 cells displayed on screen?
position is changed like: 0, 0, 1, 2, 3... 99, 0 - what is the cause
of that? Can someone from google team answer?
That seems to be a bug, very annoying bug. Answer It's not a bug is
not answer! How do you generate position?

On Apr 27, 9:40 pm, Illidane illid...@gmail.com wrote:
 There is a way to make GridView without Adapter ( e.g. something
 like .addView() method ) ?

 On 27 апр, 21:38, Illidane illid...@gmail.com wrote:



  My GridView shows all 100 cells on the screen ( all visible at one
  moment )
  and all the animation works fine, and pretty fast ( on all 100
  elements ),
  but than begin problems with last cell.
  Animation not child-view's. Each cell is a imageView with animation on
  it.

  On 27 апр, 20:43, Streets Of Boston flyingdutc...@gmail.com wrote:

   It's not buggy. I use the adapters and grid/list-views in my apps and
   they work fine. I think they are not designed for your purpose.

   e.g. If your adapter has 100 elements and the grid/list-view only
   shows about 15 at a time on the screen, the getView is called about 15
   times. Sometimes more times, depending whether a little bit (a few
   pixels) of the top or bottom child-view become visible or not. Then,
   when you start scrolling, getView gets called again and again when
   child-views become visible and others become invisible.

   Also, seriously consider re-using the convertView for your grid- or
   list-view. My experience is that it can really slow down your app if
   you just return new View instances for each child-view/cell:
   public ... getView() {
     View view = convertView != null ? convertView : createNewView(...);
     ...
     ...
     return view;

   }

   The implementation of the adapter+listviews does not need to rely on
   the order in which the getView is called. As long as it is called for
   every child-view that becomes visible.

   Isn't is possible to start a child-view's (cell's) animation when you
   handle it the getView(...) method?

   If you really want at least 100 child-views/cells to be created (i
   won't recommend it... it's a LOT), you can override the Adapter's
   getViewTypeCount() and getItemViewType(int pos). Even with this, I'm
   still not sure if getView would get called in the order you want.

   ...
     private static int EXPECTED_CELL_COUNT = 100;

     public int getViewTypeCount() { return EXPECTED_CELL_COUNT; }
     public int getItemViewType(int pos) { return pos %
   EXPECTED_CELL_COUNT; }

   On Apr 27, 1:07 pm, Illidane illid...@gmail.com wrote:

And you think it's not a bug? where is guarantee that it will work in
general?
Where adapter takes it's magic number N?

On 27 апр, 19:56, Romain Guy romain...@google.com wrote:

 There is no guarantee it's going to be called N times either.

 2009/4/27 Illidane illid...@gmail.com:

  Even with convertView problem is still same - last cell is not
  animating.
  And... you said WHEN getView()... I think it's no matter, matter HOW
  MANY times getView() called.
  It calls more than 100 times, whats very strange.
  For the first time it's called 102 times and all animations was
  working. For the second and next times it was 101, and last 
  animation
  was static.
  I think where is some bug regularity...

  On 27 апр, 19:31, Romain Guy romain...@google.com wrote:
  You should ALWAYS reuse the convertView, oherwise you're gonna eat 
  up
  memory and just slow down your app. And like I said, there is no
  guarantee on how and when getView() is called so you cannot rely 
  on it
  with your anim counter.

  2009/4/27 Illidane illid...@gmail.com:

   I dont use convertView parametr and return new child-view.

   Each cell has an animation. In the getView I generate an array of
   animations, wich I start when the adapter stops his work ( e.g. 
   when
   my mAnimCounter == 102 ( but need be max 100, lol ) When I run 
   app,
   all 100 cells are animated. But when I re-check the field as I 
   need
   and call mGameGrid.setAdapter(mAdapter), new animations working, 
   but
   last. Last cell are NOT animated. Problem can be only in getView 
   and
   method how it works. I very doubt that it's not a bug of 
   GridView or
   Adapter.

   On 27 апр, 18:59, Streets Of Boston flyingdutc...@gmail.com 
   wrote:
   The child/item-views in list-views and grid-views are re-used
   (convertView input parameter). I suspect that depending on the 
   layout/
   measurements/visibility of the child-views and the way you 
   implement
   getView (re-using convertView or ignoring it and returning a 
   brand-new
   child-view every time), the order in which these child-views are
   called (value of 'position' parameter 

[android-developers] Re: GridView and BaseAdapter position bug

2009-04-28 Thread yarik...@gmail.com

We have three times same value of pure the magical-generated position
and the official answer it is NOT a bug. Ok, than I am Al Pacino.

Why not to post algorithm of position generating? That looks fishy...

On Apr 28, 7:44 pm, Romain Guy romain...@google.com wrote:
 No, you are just making assumptions about how it should work. Nowhere
 does it say that it should work the way you want it to work, that's
 not how it works and that's not how it will work.

 2009/4/28 Illidane illid...@gmail.com:





  To Romain Guy:
  Ok, I understood that you think that it's NOT a bug and that you
  implement it how you want it be.
  But I need to say you, that in such situation is very hard, or
  sometimes is impossible to write good, stable, beauty, useful and
  competitive apps for Android, not only for me, but for all Android
  programmers.
  And I think you know that.

  On 28 апр, 18:53, Romain Guy romain...@google.com wrote:
  I am from the Google team (and I did implement a lot of GridView and
  ListView) and it is NOT a bug. GridView and ListView can call
  getView() out of order and more times than the number of views that
  will fit on screen, depending how the Grid/ListView is measured/laid
  out.

  2009/4/28 yarik...@gmail.com yarik...@gmail.com:

   I have exactly same problem. Why do we have 102 values of position
   when there is only 100 cells displayed on screen?
   position is changed like: 0, 0, 1, 2, 3... 99, 0 - what is the cause
   of that? Can someone from google team answer?
   That seems to be a bug, very annoying bug. Answer It's not a bug is
   not answer! How do you generate position?

   On Apr 27, 9:40 pm, Illidane illid...@gmail.com wrote:
   There is a way to make GridView without Adapter ( e.g. something
   like .addView() method ) ?

   On 27 апр, 21:38, Illidane illid...@gmail.com wrote:

My GridView shows all 100 cells on the screen ( all visible at one
moment )
and all the animation works fine, and pretty fast ( on all 100
elements ),
but than begin problems with last cell.
Animation not child-view's. Each cell is a imageView with animation on
it.

On 27 апр, 20:43, Streets Of Boston flyingdutc...@gmail.com wrote:

 It's not buggy. I use the adapters and grid/list-views in my apps 
 and
 they work fine. I think they are not designed for your purpose.

 e.g. If your adapter has 100 elements and the grid/list-view only
 shows about 15 at a time on the screen, the getView is called about 
 15
 times. Sometimes more times, depending whether a little bit (a few
 pixels) of the top or bottom child-view become visible or not. Then,
 when you start scrolling, getView gets called again and again when
 child-views become visible and others become invisible.

 Also, seriously consider re-using the convertView for your grid- or
 list-view. My experience is that it can really slow down your app if
 you just return new View instances for each child-view/cell:
 public ... getView() {
   View view = convertView != null ? convertView : 
 createNewView(...);
   ...
   ...
   return view;

 }

 The implementation of the adapter+listviews does not need to rely on
 the order in which the getView is called. As long as it is called 
 for
 every child-view that becomes visible.

 Isn't is possible to start a child-view's (cell's) animation when 
 you
 handle it the getView(...) method?

 If you really want at least 100 child-views/cells to be created (i
 won't recommend it... it's a LOT), you can override the Adapter's
 getViewTypeCount() and getItemViewType(int pos). Even with this, I'm
 still not sure if getView would get called in the order you want.

 ...
   private static int EXPECTED_CELL_COUNT = 100;

   public int getViewTypeCount() { return EXPECTED_CELL_COUNT; }
   public int getItemViewType(int pos) { return pos %
 EXPECTED_CELL_COUNT; }

 On Apr 27, 1:07 pm, Illidane illid...@gmail.com wrote:

  And you think it's not a bug? where is guarantee that it will 
  work in
  general?
  Where adapter takes it's magic number N?

  On 27 апр, 19:56, Romain Guy romain...@google.com wrote:

   There is no guarantee it's going to be called N times either.

   2009/4/27 Illidane illid...@gmail.com:

Even with convertView problem is still same - last cell is not
animating.
And... you said WHEN getView()... I think it's no matter, 
matter HOW
MANY times getView() called.
It calls more than 100 times, whats very strange.
For the first time it's called 102 times and all animations 
was
working. For the second and next times it was 101, and last 
animation
was static.
I think where is some bug regularity...

On 27 апр, 19:31, Romain Guy romain...@google.com wrote:
You should ALWAYS reuse

[android-developers] Re: Observer for Adaper

2009-04-28 Thread yarik...@gmail.com

Anybody?

On 28 апр, 00:26, yarik...@gmail.com yarik...@gmail.com wrote:
 Hi everyone!
 I have an BaseAdapter and  I need to know when it stops to change data
 ( eg View getView(int position, View convertView, ViewGroup parent) is
 no more calling ).
 I tried to use registerDataSetObserver method of the Adapter:
     public class DataObserver extends DataSetObserver
     {
         @Override
         public void onChanged()
         {
                 /*
                             do smth
                         */
         }
     }

 private DataObserver mObserver;
 private BaseAdapter mAdapter;

 mObserver = new DataObserver();
 mAdapter.registerDataSetObserver(mObserver);

 But it seems to be not working. Any ideas?
--~--~-~--~~~---~--~~
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] Observer for Adaper

2009-04-27 Thread yarik...@gmail.com

Hi everyone!
I have an BaseAdapter and  I need to know when it stops to change data
( eg View getView(int position, View convertView, ViewGroup parent) is
no more calling ).
I tried to use registerDataSetObserver method of the Adapter:
public class DataObserver extends DataSetObserver
{
@Override
public void onChanged()
{
/*
do smth
*/
}
}

private DataObserver mObserver;
private BaseAdapter mAdapter;

mObserver = new DataObserver();
mAdapter.registerDataSetObserver(mObserver);

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



[android-developers] Android/G1 video driver

2009-04-09 Thread yarik...@gmail.com

Where can I find G1 video driver source?
--~--~-~--~~~---~--~~
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/G1 video driver

2009-04-09 Thread yarik...@gmail.com

ok... thanks a lot.

I have another one question though. It' about framebuffer driver.
There are a lot of sources in git and I can't find out wich one is
used for MSM7201A chipset used in G1. Thanks for response.

On 9 апр, 18:09, David Turner di...@android.com wrote:
 If you are referring to the accelerated OpenGL ES shared library used by
 the system on G1 / ADP1 devices, its source is not available, it's a
 proprietary
 binary blob.

 There is however a software-only OpenGL ES implementation that is part of
 the system (and is used when you run in the emulator), released under the
 Apache 2.0
 license. Look for pixelflinger in the sources.

 On Thu, Apr 9, 2009 at 4:28 PM, yarik...@gmail.com yarik...@gmail.comwrote:





  Where can I find G1 video driver source?
--~--~-~--~~~---~--~~
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] adb push wtf

2009-04-03 Thread yarik...@gmail.com

C:\android-sdk-windows-1.1_r1\toolsadb push C:\src\test \data
failed to copy 'C:\src\test' to '\data': Read-only file system

wtf??
--~--~-~--~~~---~--~~
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: adb push wtf

2009-04-03 Thread yarik...@gmail.com


thanks a lot!
--~--~-~--~~~---~--~~
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] [1.1_r1 SDK] Capturing Screen Issue

2009-03-31 Thread yarik...@gmail.com

Hi!

I'm trying to get screenshot of GLSurfaceView sample with the
following code:

http://www.everfall.com/paste/id.php?c4h4lwesb3nu

According to all docs that should works properly but it does not,
resulting
image is entire white. Can't imagine what is the essence of the problem
((

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