Using the SDKService
AndroidManifest.xml
<receiver android:name=".Application"
android:permission="jp.co.ricoh.isdk.sdkservice.common.SdkService.APP_EVENT_PERMISSION">
<intent-filter>
<action android:name="jp.co.ricoh.isdk.sdkservice.auth.GET_AUTH_STATE"/>
</intent-filter>
</receiver>
Application*.java
_context = context;
Intent intent = new Intent(Constants.ACTION_GET_AUTH_STATE);
BroadcastReceiver resultReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context c, Intent i) {
Bundle extras = getResultExtras(false);
//This one returns UserId and UserName of the device authentication
userid = extras.getString("USER_ID");
username = extras.getString("USER_NAME");
boolean r = extras.getBoolean(Constants.EXTRA_RESULT);
}
};
context.sendOrderedBroadcast(intent, CMD_PERMISSION, resultReceiver, null, 0, null, null);