---
title: "Resources"
canonical_url: https://developer.repebble.com/docs/c/Foundation/Resources/
last_updated: 2026-10-28
sdk_version: 4.33.1
---
# Resources

Source: https://developer.repebble.com/docs/c/Foundation/Resources/

Managing application resources

Resources are data files that are bundled with your application binary and can be loaded at runtime. You use resources to embed images or custom fonts in your app, but also to embed any data file. Resources are always read-only.

Resources are stored on Pebble’s flash memory and only loaded in RAM when you load them. This means that you can have a large number of resources embedded inside your app, even though Pebble’s RAM memory is very limited.

See

[App Resources in the Pebble Developer Guides](https://developer.repebble.com/guides/pebble-apps/resources/)
 for information on how to embed resources into your app's bundle. 
## Modules

#### [File Formats](https://developer.repebble.com/docs/c/Foundation/Resources/File_Formats.md)

&nbsp;

## Function Documentation

[ResHandle](https://developer.repebble.com/docs/c/Foundation/Resources.md#ResHandle) resource\_get\_handle([uint32\_t](https://developer.repebble.com/docs/c/Standard_C.md#uint32_t) resource\_id)

Gets the resource handle for a file identifier.

The resource IDs are auto-generated by the Pebble build process, based on the `appinfo.json`. The "name" field of each resource is prefixed by `RESOURCE_ID_` and made visible to the application (through the `build/src/resource_ids.auto.h` header which is automatically included).

For example, given the following fragment of `appinfo.json`:

```
..."resources" : {"media": [{"name": "MY\_ICON","file": "img/icon.png","type": "png",}, ...
```

 The generated file identifier for this resource is `RESOURCE_ID_MY_ICON`. To get a resource handle for that resource write: 

```
ResHandle rh = resource\_get\_handle(RESOURCE\_ID\_MY\_ICON);
```

#### Parameters
 resource\_id

The resource ID

[size\_t](https://developer.repebble.com/docs/c/Standard_C/Memory.md#size_t) resource\_size([ResHandle](https://developer.repebble.com/docs/c/Foundation/Resources.md#ResHandle) h)

Gets the size of the resource given a resource handle.

#### Parameters
 h

The handle to the resource

#### Returns

The size of the resource in bytes

[size\_t](https://developer.repebble.com/docs/c/Standard_C/Memory.md#size_t) resource\_load([ResHandle](https://developer.repebble.com/docs/c/Foundation/Resources.md#ResHandle) h, uint8\_t \* buffer, [size\_t](https://developer.repebble.com/docs/c/Standard_C/Memory.md#size_t) max\_length)

Copies the bytes for the resource with a given handle from flash storage into a given buffer.

#### Parameters
 h

The handle to the resource

 buffer

The buffer to load the resource data into

 max\_length

The maximum number of bytes to copy

#### Returns

The number of bytes actually copied

[size\_t](https://developer.repebble.com/docs/c/Standard_C/Memory.md#size_t) resource\_load\_byte\_range([ResHandle](https://developer.repebble.com/docs/c/Foundation/Resources.md#ResHandle) h, [uint32\_t](https://developer.repebble.com/docs/c/Standard_C.md#uint32_t) start\_offset, uint8\_t \* buffer, [size\_t](https://developer.repebble.com/docs/c/Standard_C/Memory.md#size_t) num\_bytes)

Copies a range of bytes from a resource with a given handle into a given buffer.

#### Parameters
 h

The handle to the resource

 start\_offset

The offset in bytes at which to start reading from the resource

 buffer

The buffer to load the resource data into

 num\_bytes

The maximum number of bytes to copy

#### Returns

The number of bytes actually copied

## Typedef Documentation

- [SDK 3](javascript:void(0);)
- [SDK 4](javascript:void(0);)
- [SDK 4.9+](javascript:void(0);)

 typedef void \* ResHandle

Opaque reference to a resource.

#### See Also
[resource\_get\_handle()](https://developer.repebble.com/docs/c/Foundation/Resources.md#resource_get_handle)

 typedef void \* ResHandle

Opaque reference to a resource.

#### See Also
[resource\_get\_handle()](https://developer.repebble.com/docs/c/Foundation/Resources.md#resource_get_handle)

 typedef void \* ResHandle

Opaque reference to a resource.

#### See Also

`resource_get_handle()`

## Macro Definition Documentation

#define RESOURCE\_ID\_FONT\_FALLBACK RESOURCE\_ID\_GOTHIC\_14
