How to include data files in Tizen native application package (Tizen IDE 2.4)

Original Created Aug 30, 2016 | Regeneration Apr 22, 2026

I'm developing a native Tizen application that needs to load and potentially modify some files during runtime. I placed these files in the /data/ folder since the /res/ folder is read-only.

However, when I package the project into a .tpk file, the /data/ folder isn't included. This causes the application to fail after installation because it can't load the required files at startup. How can I ensure these data files are included in the package?

Problem Understanding

The issue occurs because Tizen's build system doesn't automatically include files in the /data/ directory when creating the .tpk package. This is different from the /res/ directory which is included by default but is read-only.

Solution Methods

  1. Using the shared/resource directory:

    • Move your files to the shared/resource directory in your project
    • These files will be included in the package automatically
    • Access them using app_get_shared_resource_path() at runtime
  2. Manually including files in package:

    • Create a "data" directory in your project root
    • Add the files you want to include
    • Modify your project's manifest file (tizen-manifest.xml) to include these files:
      <tizen:application>
          ...
          <tizen:file path="data/myfile.txt" />
      </tizen:application>
      
  3. Alternative approach for writable files:

    • Include initial files in the package using method 1 or 2
    • At first run, copy them to the app's data directory (obtained via app_get_data_path())
    • Modify the copies as needed during runtime

Code Examples

// For shared resources
char* resource_path = app_get_shared_resource_path();
// Use resource_path to access your files

// For app data directory
char* data_path = app_get_data_path();
// Use data_path for writable files

Additional Tips

  • Remember that files in /res/ are read-only
  • Files in the data directory (from app_get_data_path()) are writable but not included in the package
  • Always check file operations for success/failure
  • Consider file permissions when accessing files

Customize your cookie preferences

You can enable or disable non-essential cookies. Essential cookies are always on to ensure the site works properly and to keep you signed in.

Necessary

These cookies are necessary for the website to function properly and cannot be switched off. They help with things like logging in and setting your privacy preferences.

Always on

Analytics

These cookies help us improve the site by tracking which pages are most popular and how visitors move around the site.

Enable analytics cookies
Public Forum Public Forum
Employees only. Please sign in with your company account.