What is the best way to cross-platform write some data to a local storage (file)?

Use PlatformFactory.getPlatform().getSettingService() or PlatformFactory.getPlatform().getPrivateStorage(). For an example of the later check out GluonSQLite sample.