Tizen Developers

Menu
Sites
Language
Phone & Wearable share the same (external) c code?

Hi,

I have developed an audio app which can play/record sounds on Tizen 3.0 (wearable). Now I want to port this app to the Tizen phone but I am not sure how to make both projects share the same piece of c code (e.g., the core logic to process and play audio). 

My project now looks like:

Wearable

-inc/

       - app.h

       - libas.h 

- src/

       - app.c

       - libas.c

Where app.c/h are just the wearable UI and the libas.c/h includes the core logic. It is hard for me to build libas.c/h as a static library because it also uses the Tizen's networking(socket) and audio libraries.

 

So, Is it possible I can move the libas.c/h to an external folder and include this folder on my both phone and wearable projects? 

 

I have made a small test of doing this by "right-click the project -> properties -> C/C++ general -> paths and symbols -> link folder", but it doesn't work. Tizen studio seems to misrecognize the folder and refuse to show what files are inside the folder (also not compilable)

 

Edited on 09 11, 2017

Responses

1 Replies
Armaan-Ul- Islam

Please correct me If I'm going the wrong way, Why are you not considering 'copying and pasting' the ' libas.h ' and. 'libas.c' files into the mobile project from wearable project?

I guess, May be you are looking for some feature like, "change in code once, would effect both the mobile and wearable project" / "shared codebase". There's a suggestion from my end:

 

From Tizen Studio project explorer, On your Mobile project > src > right-click > New > File > Advanced >> Link to file in the filesystem > browse> 'libas.c' file from wearable project directory. Similarly for the 'libas.h' file in 'inc' folder.

 

 

Please share feedback here, it did the trick or not.