Where can I find good remote Android developers?

by dan raaka » Wed, 29 Jul 2009 09:09:05 GMT

Sponsored Links
 try this :)


Other Threads

1. onDraw issue? -- what's going on?!

Hey all,
I am writing an app that emulates a drum machine with a step
sequencer.  For those unfamiliar with step sequencers, a step
sequencer is basically a set of switches where the state of each
switch indicates whether or not a sound is to be played at a
particular point in a pattern.  I've already got audio playback
working using SoundPool and can play patterns (represented as objects
containing boolean arrays mapped to audio resources) by stepping
through these patterns using a timer.  What I am trying and struggling
to do at present is to write my UI.  I have subclassed ToggleSwitch
and made a custom switch called SeqSwitch which, in addition to
ToggleSwitch's isChecked field, also holds an isIlluminated field.
I've written another class called SwitchController that takes an array
of these switches and has a method (which I've called runSwitches)
that, with each call, advances one switch, illuminates the current
switch, and unilluminates the previous switch (the idea is that, when
the user plays his pattern, the button representing the current step
will illuminate, letting him know the current position of playback in
the sequence).  The SeqSwitches seem to render and behave fine in
response to clicks.  My SwitchController.runSwitches method also works
so long as I place it in a click handler of a button in my main
Activity.  When, however, I pass it into the runnable (called
PatternPlayTask) that I give to my Timer (which then calls
SwitchController.runSwitches every 300 milliseconds as it steps
through the pattern), it stops working.  I have used the de{*filter*} to
make sure that the object I am passing into the runnable is the same
as the one for which the call to SwitchController.runSwitches was
working in the main activity and have found that definitely it is.
Does anybody have any idea what's going on here.  Hopefully I am just
doing something totally stupid, here.  I've pasted the code for my
ToggleButton subclass below, if that helps:

package com.drummachine;
import android.widget.*;
import android.view.*;
import android.content.Context;
import com.drummachine.Instrument;
import android.util.*;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.*;
import android.util.AttributeSet;
import android.view.View;

public class SeqSwitch extends ToggleButton {

        //SeqSwitch holds an isIlluminated state.
        //if isIlluminated is true, onDraw will render an illuminated
        //button image as the SeqSwitch's drawable (currently the same image
used for
        //a ToggleButton whose isChecked == true)
        public boolean isIlluminated;

        public SeqSwitch(Context context)
                isIlluminated = false;


        //constructor called when params are taken from XML layout
    public SeqSwitch(Context context, AttributeSet attributes) {
        super(context, attributes);

        TypedArray a = context.obtainStyledAttributes(attributes,

       isIlluminated = false;


    public void setIlluminated(boolean state)
        isIlluminated = state;


    //yes, I know having illumniate() and unIlluminate() methods is
    //when I have a setIlluminated(boolean) method, but I am presently
too lazy
    //to rearrange code elsewhere that presently relies on these two
    public void unIlluminate()
        isIlluminated = false;

    public void illuminate()
        isIlluminated = true;

    public boolean switchIsIlluminated()
        return isIlluminated;

     * renders a image of a switch with an illuminated LED if either
the SeqSwitch's isChecked or
     * isIllumniated == true.  Otherwise it renders a drawable of a
button with an unIlluminated LED
    public void onDraw(Canvas canvas)
        if(super.isChecked() == true || this.isIlluminated == true)


Nick Zaillian


2. fill_parent for each child widget?


I am using a HorizontalScrollView to contain and scroll 3 child
widgets, each of which is either an ImageView or a custom widget. What
I'd like to achieve is something like homescreen, where each child
widget filling up the whole width of the display and the user is able
to switch to the other widget by flickering horizontally. I am having
a hard time figuring out what properties I should assign to each of
the child widget in order to have them fill the parent container. I
get it working if I hard coded the width for each child but I'd like
them to be able to fit to any screen resolutions, as the current
Android homescreen does.

Here is the xml (pseudo like)

HorizontalView -> LinearLayout -> children widgets

Hope this makes sense. Thanks!

3. Application install hooks?

4. How can i listen to "Home" key

5. Does Android support to read USIM phone book

6. Where can I enter PUK number after the SIM PIN is blocked

7. How can i back to the current activity when pressed "Home" and then click the icon on the home