Initial Commit - Fixing Accelerometer

This commit is contained in:
Joe Bowser
2010-04-28 15:46:15 -07:00
parent 36e90c9e22
commit 64671184a6
4 changed files with 77 additions and 29 deletions
@@ -0,0 +1,33 @@
package com.phonegap;
import java.util.HashMap;
import android.content.Context;
import android.webkit.WebView;
public class AccelBroker {
private WebView mAppView;
private Context mCtx;
private HashMap<String, AccelListener> accelListeners;
public AccelBroker(WebView view, Context ctx)
{
mCtx = ctx;
mAppView = view;
accelListeners = new HashMap<String, AccelListener>();
}
public String start(int freq, String key)
{
AccelListener listener = new AccelListener(key, freq, mCtx, mAppView);
accelListeners.put(key, listener);
return key;
}
public void stop(String key)
{
AccelListener acc = accelListeners.get(key);
acc.stop();
}
}