Java Question Progress

NFOBoy

Active Member
Licensed User
Longtime User
Erel,

so I have the PlayerWrapper and GameClientWrapper coming along. Am now implementing the different listeners(holy carpe diem) for GameClient within the wrapper.

A few questions:

Many of the load"inserttype here" return a DataBuffer, with different things contained... I'm pretty sure that means I need to build a function in the listener that breaks up the DataBuffer into component parts, and return those parts in some way to a ba.raiseEvent. If it is a multiple item DataBuffer, what is preferred method for me to return it?

e.g. For each Achievement item returned in onAchievementsLoaded there exists:
abstract String getAchievementId()
Retrieves the ID of this achievement.
abstract int getCurrentSteps()
Retrieves the number of steps this user has gone toward unlocking this achievement; only applicable for TYPE_INCREMENTAL achievement types.
abstract String getDescription()
Retrieves the description for this achievement.
abstract void getDescription(CharArrayBuffer dataOut)
Loads the achievement description into the given CharArrayBuffer.
abstract void getFormattedCurrentSteps(CharArrayBuffer dataOut)
Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale) into the given CharArrayBuffer.
abstract String getFormattedCurrentSteps()
Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale); only applicable for TYPE_INCREMENTAL achievement types.
abstract void getFormattedTotalSteps(CharArrayBuffer dataOut)
Loads the total number of steps necessary to unlock this achievement (formatted for the user's locale) into the given CharArrayBuffer; only applicable for TYPE_INCREMENTAL achievement types.
abstract String getFormattedTotalSteps()
Retrieves the total number of steps necessary to unlock this achievement, formatted for the user's locale; only applicable for TYPE_INCREMENTAL achievement types.
abstract long getLastUpdatedTimestamp()
Retrieves the timestamp (in millseconds since epoch) at which this achievement was last updated.
abstract void getName(CharArrayBuffer dataOut)
Loads the achievement name into the given CharArrayBuffer.
abstract String getName()
Retrieves the name of this achievement.
abstract Player getPlayer()
Retrieves the player information associated with this achievement.
abstract Uri getRevealedImageUri()
Retrieves a URI that can be used to load the achievement's revealed image icon.
abstract int getState()
Retrieves the state of the achievement - one of STATE_UNLOCKED, STATE_REVEALED, or STATE_HIDDEN.
abstract int getTotalSteps()
Retrieves the total number of steps necessary to unlock this achievement; only applicable for TYPE_INCREMENTAL achievement types.
abstract int getType()
Retrieves the type of this achievement - one of TYPE_STANDARD or TYPE_INCREMENTAL.
abstract Uri getUnlockedImageUri()
Retrieves a URI that can be used to load the achievement's unlocked image icon.
(any hints on how to handle the Uri would be appreciated)


Next: My app will connect to the Google Servers in Release and Debug mode. So now I think I know that the Debug mode actually gets our release key tied to it (I always thought the debug went on when we debugged, and only at release was the release key integrated). Just want to confirm that is correct? (for when I write how to get the OAuth setup)


Next^2: The RealTimeSocket: This may be above me to wrap right now, but if I see it correctly, two of the big things incorporated are the InputStream and OutputStream, if these are identical to the ones in B4A, then is it as easy as I think it might be? If so, has ParcelFileDescriptor been wrapped previously that I can use in some way? (this was discussed as being important by one of the other members, so if I can get it, I'm sure more than a few will be happy)


More I'm sure as I move along, but I have Leaderboards, Achievements, incrementAchievements, Player stuff and more all working right now... so it is coming along, and I'm learning (painfully sometimes) a lot about proper syntax of Java.


Ross
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
If it is a multiple item DataBuffer, what is preferred method for me to return it?
Seems like you will need to wrap the DataBuffer. This is a good place to use AbsObjectWrapper. It will allow you to wrap DataBuffer and use it with subclasses of DataBuffer.

B4A InputStream and OutputStream are wrappers for any valid Java InputStream / OutputStream.

If so, has ParcelFileDescriptor been wrapped previously that I can use in some way?
There is no need to completely wrap this object. You can just provide a method that opens a file stream.
 
Top