Added folder monitoring capability and fixed emulator launching problem.

- The folder monitoring allows users to add one or more native android
apps on fly and selendroid immediately signs and adds these files to
the app store so they can be used without restarting the node.
- Adding one seconds wait before calling "isDeviceReady" to avoid the
command sent too quickly while the emulator still starting and not ready
to receive any commands

Signed-off-by: Binh Vu <bvu@paypal.com>
I was hinting on the start () method being called on the same object twice.
The current implementation basically re initialises the thread and starts
it again. So when the method is called twice it would start a thread and
then assign a new thread object to it and start that one also causing the
previous thread object to be removed forcibly. Instead we could assign a
thread object if it's not null. That way for a folderMonitor object start
() invocation has effect only once and the subsequent calls have no effect.
On Nov 20, 2014 6:46 AM, "Binh Vu" <notifications@github.com> wrote:

> In
> selendroid-standalone/src/main/java/io/selendroid/server/util/FolderMonitor.java:
>
> > +      String ext = file.getName();
> > +      return ext.endsWith(".apk");
> > +    }
> > +    return false;
> > +  }
> > +
> > +  private boolean isResigned(File file) {
> > +    if (file.getAbsolutePath().contains("resigned")) {
> > +        String ext = file.getName();
> > +        return ext.endsWith(".apk");
> > +    }
> > +    return false;
> > +  }
> > +
> > +  public void start() {
> > +    thread = new Thread(this);
>
> We can call start() twice, if we want to monitor the folder at two places
> with different actions upon the added file at each place.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/selendroid/selendroid/pull/712/files#r20621695>.
>