no xml for PathShape?

by exh » Wed, 29 Apr 2009 15:04:10 GMT


Sponsored Links
 Hi all,

I'm new to Android so apologies if this has been covered, but I didn't
see it mentioned:  I'd like to create a drawable resource that makes
use of ShapeDrawable and PathShape.  I haven't seen any docs online
describing this, so I've been poking through the Android source.  I
see that PathShape doesn't implement inflate(), so I'm assuming that
means there's no xml spec for it?  Is this correct?

thanks much,
eric

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. pause AudioTrack correctly

Hello,

I hope that somebody can explain how to pause AudioTrack correctly. I
am recording and playing back a pcm file with the
OnPlaybackPositionUpdateListener in a remote service. This works fine.
Now when I call pause() on the audioTrack object, the playback pauses
and if I want to resume I call start() again. This works in general,
but some frames are skipped and the playback does not resume from the
point it paused but from a few frames later. Why is that? Please show
me how to pause a AudioTrack correctly without losing frames. Here is
my code for the PlaybackListener


audioTrack.setPlaybackPositionUpdateListener(new
OnPlaybackPositionUpdateListener() {

                                @Override
                                public void onPeriodicNotification(AudioTrack 
track) {

                                        try {
                                                        int error=0;
                                                        if(ramfile!=null)
                                                        {
                                                                error = 
ramfile.read(buffer);
                                                        }

                                                        if(error==-1)
                                                        {
                                                                
audioTrack.stop();
                                                                
audioTrack.flush();
                                                                
if(ramfile!=null)
                                                                ramfile = null;
                                                                audioTrack=null;
                                                                playing=false;
                                                        }

                                                        if(audioTrack!=null &&
audioTrack.getPlayState()==AudioTrack.PLAYSTATE_PLAYING)
                                                        
audioTrack.write(buffer, 0, buffer.length);


                                        } catch (IOException e) {
                                                Log.d("EX","We run into an 
Exception");
                                                e.printStackTrace();
                                        }
                                }

                                @Override
                                public void onMarkerReached(AudioTrack track) {

                                }
                        });


Greetings,

Markus

-- 

2. Services and battery life

I have a service which interacts with the Android Location service to
get location updates. Once the service starts, it tries for 2 minutes
to get the best location possible.

I want to get location data for 30 mins, every 5 minutes. I can do
this in two ways:
1. start the service, let it run for 30 minutes, and get location
updates every 5 minutes
2. use the alarm manager and get the service to wake up every 5th
minute for 30 minutes

How do these methods compare in terms of
1. Battery life
2. Delays: If I use approach 2, after I start the service, there will
be a delay before the service is loaded into memory and started, the
service connects to the Android location service and then tries to fix
on the location vs. approach 1, where the fix attempts can start off
immediately.

Vikram

-- 

3. How to optimize an "image" app for various devices and screen resolutions

4. 2D game BallBraker

5. Does emulator support video recording(camera input)?

6. In android how to programmatically list the apps that uses Data connection?

7. JNI working