Android Open Source - diceplus_test P Storage Handler






From Project

Back to project page diceplus_test.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project diceplus_test 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.example.dice_test2;
// ww  w. ja  v  a2s.  com
import android.util.Log;
import us.dicepl.android.sdk.DiceController;
import us.dicepl.android.sdk.Die;
import us.dicepl.android.sdk.protocol.payload.storage.record.Vector3;

public class PStorageHandler extends DiceEventHandler {

  public static void onPStorageCommunicationInitialized(Die die, MainActivity _mainActivity) {
    Log.d(TAG, "PStorage initialize");

    DiceController.writePStorageValue(die, 0, "my dice");
    }
  
  public static void onPStorageOperationFailed(Die die, Exception exception) {
    Log.d(TAG, "Pstorage failure: " + exception.getMessage());
  }

  public static void onPStorageValueWrite(Die die, int handle) {
    Log.d(TAG, "PStorage write: handle: " + handle);
  }

  public static void onPStorageReset(Die die, Exception exception) {
    Log.d(TAG, "PStorage reset");
  }
  
    public static void onPStorageValueRead(Die die, int handle, String str) {
    Log.d(TAG, "PStorage read: handle: " + handle + ", str value: " + str);
    }
    
    public static void onPStorageValueRead(Die die, int handle, Vector3 vector) {
    Log.d(TAG, "PStorage read: handle: " + handle + ", vector value: " + vector.toString());
    }
    
    public static void onPStorageValueRead(Die die, int handle, int value) {
    Log.d(TAG, "PStorage read: handle: " + handle + ", int value: " + value);
    }
    
}




Java Source Code List

com.example.dice_test2.AccelerometerReadoutHandler.java
com.example.dice_test2.BatteryStateHandler.java
com.example.dice_test2.DiceEventHandler.java
com.example.dice_test2.LedStateHandler.java
com.example.dice_test2.ListenerContainer.java
com.example.dice_test2.MagnetometerReadoutHandler.java
com.example.dice_test2.MainActivity.java
com.example.dice_test2.OrientationReadoutHandler.java
com.example.dice_test2.PStorageHandler.java
com.example.dice_test2.PowerModeHandler.java
com.example.dice_test2.ProximityReadoutHandler.java
com.example.dice_test2.RollHandler.java
com.example.dice_test2.SubscriptionChangeHandler.java
com.example.dice_test2.TapReadoutHandler.java
com.example.dice_test2.TemperatureReadoutHandler.java
com.example.dice_test2.TouchReadoutHandler.java