Updated list of app code sources?

by Tony Su » Mon, 13 Apr 2009 12:14:00 GMT

Sponsored Links
 Finally got the ADT installed into Eclipse just now.
Recommend KISS instructions(default steps don't seem to work), I don't know why 
"no repository found" kept displaying when trying to connect using SSL and also 
pointing to the compressed SDK file, but it finally worked pointing to the web 
source without SSL.
So, I'm looking around now at what kind of application snippets and full apps 
there might be to start looking at just about anything...
Have found a few scattered references, is there a centralized list or 
recognized sites for code?

Other Threads

1. CTS API Demos test case


While executing CTS  testNumberOfItemsInListView is failing.

The test case is in ApiDemosReferenceTest

Looks like the test harness is not pushing a ApiDemos.apk
ApiDemosReferenceTest.apk. files to the device, before executing the
test and recording the result.

When these apk files are manually installed (installed through adb on
to the device) these test case are passing.

Can we manually install these apk and run the test case?


2. Audiotrack buffer issues?

Ok so I have a frequency generator which uses AudioTrack to send PCM
data to the hardware. Here's the code I'm using for that:

private class playSoundTask extends AsyncTask<Void, Void, Void> {
  float frequency;
  float increment;
  float angle = 0;
  short samples[] = new short[1024];

  protected void onPreExecute() {
   int minSize = AudioTrack.getMinBufferSize( 44100,
AudioFormat.ENCODING_PCM_16BIT );
   track = new AudioTrack( AudioManager.STREAM_MUSIC, 44100,
     minSize, AudioTrack.MODE_STREAM);

  protected Void doInBackground(Void... params) {
   while( Main.this.isPlaying) {
    frequency = (float)Main.this.slider.getProgress();
    increment = (float)(2*Math.PI) * frequency / 44100;
    for( int i = 0; i < samples.length; i++ ) {
     samples[i] = (short)((float)Math.sin( angle )*Short.MAX_VALUE);
     angle += increment;

    track.write(samples, 0, samples.length);
   return null;

The frequency is tied to a slide bar, and the correct value is being
reported in the while loop. Everything is fine and dandy when I start
the app. When you drag your finger along the slide bar you get a nice
sweeping sound. But after around 10 seconds of playing around with it,
the audio starts to get wonky.  If a small change is made to the
frequency, either nothing will happen, or it will change a few whole
seconds later.  This made me think that it was a buffering issue, that
I had generated too much data and it had to get to the new samples.
But if the change is large enough (usually over 1500 Hz), then it
works, but there's a noticable staggered sound, not a clean sweep.
Does anyone see a problem with my code, or know of an issue that would
be causing this?


3. Android Developer, San Francisco, C

4. Seach suggestions with MatrixCursor no longer work in 2.2

5. Cannot get Level-List Drawable to work in ListAdapter

6. How do you handle a pound sign (#) in a string?

7. How do you handle a pound sign (#) in a string?