The StageApplication can be initialized in three ways: by inheriting StageApplication, by inheriting Android's native Application, or by creating a StageApplicationDelegate instance in an Activity. The StageApplicationDelegate instance is used to initialize the application. When using a native Activity to start an Ability, the parameters need to be passed through Intent's putExtra method. There are two ways to pass parameters: manually or using the WantParams utility class. The manual way involves setting the key as "params" and the value as a JSON string. The WantParams class provides various addValue methods to add parameters and a toWantParamsString method to convert the object to a JSON string. The supported parameter types include boolean, int, double, string, and WantParams. When using WantParams, the key cannot contain special characters, and double values have a precision of 6 decimal places. An Ability can be started using the startAbility method, which can also be used to start a native Activity by following the naming convention of the Ability's corresponding StageActivity.
dev.to
dev.to
