Android Open Source - android-sdk-samples Snapback Module






From Project

Back to project page android-sdk-samples.

License

The source code is released under:

Apache License

If you think the Android project android-sdk-samples listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.atooma.plugin.snapback;
//from w w w .  j  a  va  2s  .co  m
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;

import com.atooma.plugin.Module;
import com.atooma.plugin.blow.R;

public class SnapbackModule extends Module
{
  public SnapbackModule(Context context, String id, int version)
    {
        super(context, id, version);
    }
    
    public static final String MODULE_ID = "SnapbackModule";
    public static final int MODULE_VERSION = 1;

    @Override
    public void registerComponents()
    {
    registerTrigger(new TR_BlowDetectionGestureBased(getContext(), "Gesture+BlowDetection", 2));
    registerConditionChecker(new CC_BlowDetection(getContext(), "BlowDetection", 2));
    registerConditionChecker(new CC_SnapDetection(getContext(), "SnapDetection", 2));
    
    String manufacturer = Build.MANUFACTURER;
    String model = Build.MODEL;
    String deviceName = manufacturer + " " + model;
    
    if(getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH) &&
      !deviceName.equalsIgnoreCase("LGE Nexus 5") )
    {
      registerPerformer(new PE_TorchOnOff(getContext(), "TorchToggle", 1));
    }
    }
    
    @Override
    public void defineUI()
    {
        setIcon(R.drawable.brand_icon);
        setTitle(R.string.module_name);
    }
    
  @Override
  public void defineAuth()
  {
  }
  
  @Override
  public void clearCredentials()
  {
  }   
}




Java Source Code List

com.atooma.plugin.snapback.CC_BlowDetection.java
com.atooma.plugin.snapback.CC_SnapDetection.java
com.atooma.plugin.snapback.PE_TorchOnOff.java
com.atooma.plugin.snapback.SnapbackModule.java
com.atooma.plugin.snapback.SnapbackReceiver.java
com.atooma.plugin.snapback.SnapbackRegister.java
com.atooma.plugin.snapback.TR_BlowDetectionGestureBased.java
io.snapback.camlauncher.MainActivity.java
io.snapback.orientedkeygamepad.MainActivity.java
io.snapback.plugin.config.AssetsPropertyReader.java
io.snapback.plugin.data.ParseHandler.java
io.snapback.plugin.data.SharedPrefsHandler.java
io.snapback.plugin.util.Constants.java
io.snapback.plugin.util.ParseConstants.java
io.snapback.plugin.util.Utils.java
io.snapback.snap4magic.MainActivity.java