After using smartfox server 2x (sfs) for a while, I have gained some insights and decided to record them.
1 The event-driven model of sfs is very useful, which can be referred to when implementing my own time-driven model in the future.
2 When dispatching sfs events, make sure to use runOnUiThread(new Runnable() { code here }) to avoid any thread safety issues in Android.
3 It is possible to customize classes by inheriting from com.smartfoxserver.v2.protocol.serialization.SerializableSFSType. This allows for the transmission of class instance variables between the server and client, greatly facilitating the transfer of custom data.
4 UserVariable can be used to transmit variables related to each user.
5 sfs uses jetty server, which allows for the creation of custom servlets to implement file uploads and downloads. Android HTTP can be used to transfer data, avoiding excessive burden on sfs.
6 After multiple logins, sometimes it becomes impossible to log in again. This may be due to issues with the extensions. It is advisable to use try-catch-finally blocks in extensions to prevent errors from occurring.