Question

Evening all, I have an android device with an SOS button on it (hardware) I am trying to set it up so that it calls up a test application I have created purely as a proof of concept.

This is the information I have been provided by the manufacturer

// Add for SOS/PTT Key Start
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_EXT_PTTDOWN = "com.TMZP.Main.PTTDown";      

@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_EXT_PTTUP = "com.TMZP.Main.PTTUp";  

@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_EXT_SOSDOWN = "com.TMZP.Main.SOSDown";

@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_EXT_SOSUP = "com.TMZP.Main.SOSUp";
// Add for SOS/PTT Key End


Please NOTE:
Both the PTT up and PTT down intent are useful.

int ACTION_DOWN getAction() value: the key has been pressed down.

int ACTION_UP getAction() value: the key has been released.

The problem is, I don't know what to do with the @SdkConstant, I've never seen it before and cant seem to find any explanation.

Currently I have simply added the following intent filter to my test activity, however pressing the hardware button produces no result.

<intent-filter>
     <action android:name="com.TMZP.Main.SOSDown"/>
</intent-filter>

Any insight into where I add the @SdkContant would be really helpful (or simply pointing me towards some reading material.)

Thanks in advance.

Was it helpful?

Solution

@SdkConstant, AFAIK, is from the Android OS source code itself, or things built into a revised version of that OS.

For your purposes, just comment them out.

Currently I have simply added the following intent filter to my test activity, however pressing the hardware button produces no result.

That is because, based on the @SdkConstant lines, those are used for broadcasts, not starting activities. Try implementing a BroadcastReceiver that listens for them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top