53 | | Retrieve and configure PJSIP: |
54 | | 1. For this tutorial, I assume pjsip will be checked out to '''{{{C:\project\pjproject}}}''' directory. |
55 | | 1. Checkout PJSIP from the usual location (see [http://www.pjsip.org/download.htm PJSIP Download page] for details). |
56 | | 1. Fill in your '''{{{config_site.h}}}''' with: |
| 46 | [http://trac.pjsip.org/repos/wiki/Getting-Started/Download-Source Get the source code], if you haven't already. |
| 47 | |
| 48 | ---- |
| 49 | |
| 50 | == Importing PJSIP Projects == |
| 51 | |
| 52 | 1. Select '''File''' --> '''Import''' from the menu. |
| 53 | 1. On the 'Import' dialog, select '''Symbian OS''' --> '''Symbian OS Bld.inf file''' from the tree. |
| 54 | 1. On the next dialog, click '''Browse..''' button, select '''bld.inf''' file from PJSIP's {{{build.symbian}}} directory. |
| 55 | 1. On the SDK selection dialog, check the target SDKs and build configurations. |
| 56 | 1. Next you will be presented with MMP selection dialog. Just select all MMPs. |
| 57 | 1. Once the importing process completes, you will see the PJSIP project tree on the bottom left part of the Carbide main window. |
| 58 | - Note: on the '''Problems''' pane (bottom center of the main window) you may see one ''Warning'' about duplicate path, but we can ignore this for now. |
| 59 | |
| 60 | ---- |
| 61 | |
| 62 | == Building the Projects == #build |
| 63 | |
| 64 | 1. Select active build configuration: |
| 65 | 1. Select the (just imported) PJSIP project in the Carbide's ''Project Explorer'' or ''Symbian Project Navigator'' pane. |
| 66 | 1. On the main menu, select '''Project''' --> '''Build Configuration''' --> '''Set Active''' --> select the SDK used for the build. |
| 67 | - alternatively, this can be set via right clicking the PJSIP project --> '''Build Configuration''' --> '''Set Active''' --> select the SDK used for the build. |
| 68 | 1. Build the Project: |
| 69 | 1. Setup PJSIP config on {{{pjlib/include/pj/config_site.h}}} file. As starting point, we would suggest to just fill it with the following: |
60 | | |
61 | | ---- |
62 | | |
63 | | == Importing PJSIP Projects == |
64 | | |
65 | | |
66 | | Run Carbide C++. When it asks the workspace location, enter a directory where you would want to put Carbide specific settings for PJSIP (or just accept the default value): |
67 | | |
68 | | [[Image(DevelopingSymbianAppWithCarbide:carbide-workspace.JPG)]] |
69 | | |
70 | | You will now be presented with Carbide Welcome page. |
71 | | |
72 | | |
73 | | Now we need to import PJSIP's project files (the MMP files) into Carbide's workspace. |
74 | | |
75 | | Select '''File''' --> '''Import''' from the menu: |
76 | | |
77 | | [[Image(DevelopingSymbianAppWithCarbide:file_import.JPG)]] |
78 | | |
79 | | This dialog below will pop up. Select '''Symbian OS''' --> '''Symbian OS Bld.inf file''' from the list, then press '''Next''' button: |
80 | | |
81 | | [[Image(DevelopingSymbianAppWithCarbide:import.JPG)]] |
82 | | |
83 | | On the next dialog, click '''Browse..''' button to select '''bld.inf''' file from PJSIP's {{{build.symbian}}} directory, then press '''Next''' button: |
84 | | |
85 | | [[Image(DevelopingSymbianAppWithCarbide:import_bld.JPG)]] |
86 | | |
87 | | Then on the SDK selection dialog, select the build configurations that you want to support. For this tutorial, select WINSCW and GCCE from S60 3rd Edition MR SDK, and press '''Next''' button ('''do not select ARMV5 unless you have the commercial ARMV5 compiler'''): |
88 | | |
89 | | [[Image(DevelopingSymbianAppWithCarbide:import_sdk.JPG)]] |
90 | | |
91 | | You will then presented with MMP selection dialog. Leave the default selection (normally it should select all MMPs) and press '''Next''': |
92 | | |
93 | | [[Image(DevelopingSymbianAppWithCarbide:import_mmp.JPG)]] |
94 | | |
95 | | The project now is ready to be imported, press the '''Finish''' button: |
96 | | |
97 | | [[Image(DevelopingSymbianAppWithCarbide:import_finished.JPG)]] |
98 | | |
99 | | Carbide is now exporting the MMP files into the workspace and this progress window will be displayed: |
100 | | |
101 | | [[Image(DevelopingSymbianAppWithCarbide:import_creating.JPG)]] |
102 | | |
103 | | Wait for the process to complete. |
104 | | |
105 | | Once it completes, you will see the PJSIP project tree on the bottom left part of the Carbide main window: |
106 | | |
107 | | [[Image(DevelopingSymbianAppWithCarbide:carbide_main.JPG)]] |
108 | | |
109 | | On the '''Problems''' pane (bottom center of the main window) you may see one ''Warning'' about duplicate path, but we can ignore this for now. |
110 | | |
111 | | The projects should now be ready to be build. |
112 | | |
113 | | ---- |
114 | | |
115 | | == Building the Projects == |
116 | | |
117 | | Let's try to build the project first to make sure that the source is okay. |
118 | | |
119 | | === Select the Build Configuration === |
120 | | |
121 | | First select the build target by selecting '''Project''' --> '''Build Configuration''' --> '''Set Active''' from main menu (or right clicking the ''Bld.inf'' or ''pjproject'' item from ''Symbian Project Navigator'' pane from the bottom left part of the main window). |
122 | | |
123 | | Select '''Phone Debug (GCCE) [S60_3rd_MR]''' from the menu: |
124 | | |
125 | | [[Image(SetActiveBuildConfiguration.png)]] |
126 | | |
127 | | === Build the Project === |
128 | | |
129 | | Then right click ''Bld.inf'' or ''pjproject'' item from ''Symbian Project Navigator'' pane from the bottom left part of the main window, and select '''Build Project''': |
130 | | |
131 | | [[Image(build-project.png)]] |
132 | | |
133 | | Wait for the build process to complete. You may take a peek on what Carbide is doing by clicking on ''Console'' pane/tab in the bottom part of main window. |
134 | | |
135 | | Once it completes, watch out for any errors in the ''Problems'' pane (at the bottom center). There shouldn't be any errors, although there may be few warnings which I think can be ignored, for now: |
136 | | |
137 | | [[Image(DevelopingSymbianAppWithCarbide:build_problems.JPG)]] |
138 | | |
139 | | We are now ready to build the .sis/.sisx file to be deployed to the phone. |
140 | | |
141 | | |
142 | | ---- |
143 | | |
144 | | |
145 | | == Preparing the .sis/.sisx File == |
146 | | |
147 | | The .sis file is the packaging for the executable to be deployed in the device. The .sisx file is a signed .sis. Both the .sis and .sisx file can be created very easily with Carbide C++. |
148 | | |
149 | | |
150 | | === Set the .pkg File to be Used === |
151 | | |
152 | | First we'll need to configure the .pkg file to be used to generate the .sisx file. PJSIP provides some sample .pkg files which can be used, however there may be few editing needed before you can use them (this is because the .pkg file contains absolute directory path for your Symbian SDK, which may be different on your installation). |
153 | | |
154 | | Assign the .pkg file to be used by the project by selecting Project Properties: |
155 | | |
156 | | [[Image(DevelopingSymbianAppWithCarbide:project_properties_menu.JPG)]] |
157 | | |
158 | | Then Project Properties dialog will appear. On this dialog: |
159 | | |
160 | | 1. Select ''Carbide Build Configuration'' from the tree (left part of the dialog). |
161 | | 1. Make sure that the Active Configuration is set to '''Phone Debug (GCCE) [S60_3rd_MR]''' (the SDK name will be different, if you use different SDK version) |
162 | | 1. Set the ''PKG File'' by clicking ''Add'' button, and choose {{{symbian_ua.pkg}}} from PJSIP's {{{build.symbian}}} directory. |
163 | | |
164 | | [[Image(add-sis-builder.png)]] |
165 | | [[Image(select-pkg.png)]] |
166 | | |
167 | | We can leave the "SIS creation and Signing" settings empty to use the default settings. |
168 | | |
169 | | Press ''OK'' button to save the project configuration. |
170 | | |
171 | | [[Image(add-pkg-file.png)]] |
172 | | |
173 | | Now right click '''bld.inf''' (or '''pjproject''') and click '''Refresh''': |
174 | | |
175 | | [[Image(DevelopingSymbianAppWithCarbide:project_refresh.JPG)]] |
176 | | |
177 | | Wait for few seconds (30 seconds on my computer) for Carbide to do its job, once it's done, you will see the .pkg file in the ''Project Navigator'' pane: |
178 | | |
179 | | [[Image(pkg-in-explorer.png)]] |
180 | | |
181 | | |
182 | | === Build the SISX File === |
183 | | |
184 | | Once PKG has been setup on the project, a SISX file will be created everytime we build the project. So lets build the project now. |
185 | | |
186 | | Right click ''Bld.inf'' or ''pjproject'' item from ''Symbian Project Navigator'' pane from the bottom left part of the main window, and select '''Build Project''': |
187 | | |
188 | | [[Image(build-project.png)]] |
189 | | |
190 | | The build process will start. You can take a peek on the '''Console''' tab to see what's being done. Once the build process completes, you should see something like this on the '''Console''' tab: |
191 | | |
| 73 | 1. Select the (just imported) PJSIP project in the Carbide's ''Project Explorer'' or ''Symbian Project Navigator'' pane. |
| 74 | 1. On the main menu, select '''Project''' --> '''Build Project'''. |
| 75 | - Alternatively, this can be done via right clicking the PJSIP project --> '''Build Project'''. |
| 76 | 1. Wait for the build process to complete. You may take a peek on what Carbide is doing by clicking on ''Console'' pane/tab in the bottom part of main window. Once it completes, watch out for any errors in the ''Problems'' pane (at the bottom center). There shouldn't be any errors, although there may be few warnings which I think can be ignored, for now. |
| 77 | |
| 78 | ---- |
| 79 | |
| 80 | == Preparing the .sis/.sisx Installer File == |
| 81 | |
| 82 | The {{{.sis}}} file is the packaging for the executable to be deployed in the device. The {{{.sisx}}} file is a signed {{{.sis}}}. Both the {{{.sis}}} and {{{.sisx}}} file can be created very easily with Carbide C++. |
| 83 | 1. Configure the {{{.pkg}}} configuration file to be used |
| 84 | 1. Open ''Project Properties'' dialog from main menu or right click on the PJSIP project. |
| 85 | 1. Select '''Carbide.c++''' --> '''Build Configuration''' from the tree (left part of the dialog). |
| 86 | 1. Check if the Active Configuration is set correctly to the targeted SDK. |
| 87 | 1. On ''SIS Builder'' tab, click ''Add'' button |
| 88 | - Set ''PKG File'' to {{{pjsip-apps/src/pjsua/symbian/sis/pjsua.pkg}}} from the drop down. |
| 89 | - Optional, set ''Signing Options'' appropriately, for now, just leave its setting to ''Self sign sis file''. Note that, to be able to distribute the application properly, you will need to sign it with a valid certificate from Symbian. |
| 90 | - Just leave the other setting fields empty for now. |
| 91 | 1. Done with ''Project Properties'' dialog, click the ''OK'' button. |
| 92 | 1. You may need to refresh the project by right clicking on the project and '''Refresh'''. |
| 93 | 1. [#build Build the Project] to generate the {{{.sisx}}} file. Note that once PKG has been setup on the project, a SISX file will be created everytime we build the project. After the build process completes, you should see something like this on the '''Console''' tab: |
223 | | === Installing TRK 3.x Application on the Phone === |
224 | | |
225 | | Install TRK 3.x support on the phone. You can do this via the On Device Connections menu on Carbide: |
226 | | |
227 | | |
228 | | [[Image(setup-connection.png)]] |
229 | | |
230 | | You will be presented with a choice of connections. Choose '''USB''', not {{{TRK 2.x USB}}}. |
231 | | |
232 | | [[Image(connection-type.png)]] |
233 | | |
234 | | In the next screen, choose the tab '''Install Remote Agent''': |
235 | | |
236 | | [[Image(install-remote-agent.png)]] |
237 | | |
238 | | You will need to choose the appropriate installer for your phone: |
239 | | |
240 | | ||'''Phone'''||'''Installer'''|| |
241 | | ||S60 3rd Plain/MR||3.0.0|| |
242 | | ||S60 3rd FP1||3.1.0|| |
243 | | ||S60 3rd FP2||3.2.0|| |
244 | | ||S60 5th||5.0.0|| |
245 | | |
246 | | |
247 | | Now click '''Install'''. |
248 | | |
249 | | |
250 | | When asked if we want to install, click '''Yes''': |
251 | | |
252 | | [[Image(DevelopingSymbianAppWithCarbide:trk_install.JPG)]] |
253 | | |
254 | | On the PC, this window should be displayed. |
255 | | |
256 | | [[Image(DevelopingSymbianAppWithCarbide:trk_wait.JPG)]] |
257 | | |
258 | | Leave it this way, the installation will start on the phone now. Your phone should display something like this: |
259 | | |
260 | | [[Image(DevelopingSymbianAppWithCarbide:trk_p_install.JPG)]] |
261 | | |
262 | | Click Yes. |
263 | | |
264 | | Now the phone will display '''Details''' information: |
265 | | |
266 | | [[Image(DevelopingSymbianAppWithCarbide:trk_p_details.JPG)]] |
267 | | |
268 | | Click Continue. |
269 | | |
270 | | Your phone may now display the target memory location: |
271 | | |
272 | | [[Image(DevelopingSymbianAppWithCarbide:trk_p_mem.JPG)]] |
273 | | |
274 | | Select the memory and press '''Select''' menu. |
275 | | |
276 | | Now the phone will display license agreement: |
277 | | |
278 | | [[Image(DevelopingSymbianAppWithCarbide:trk_p_lic.JPG)]] |
279 | | |
280 | | Click '''OK''' (if you agree, of course). The phone should display installation progress window for couple of seconds now: |
281 | | |
282 | | [[Image(DevelopingSymbianAppWithCarbide:trk_p_progress.JPG)]] |
283 | | |
284 | | Once it's done, '''Installation Complete''' window will appear briefly: |
285 | | |
286 | | [[Image(DevelopingSymbianAppWithCarbide:trk_p_complete.JPG)]] |
287 | | |
288 | | TRK is now installed on the phone. Next step is to run it. |
289 | | |
290 | | |
291 | | === Running TRK Application on the Phone === |
292 | | |
293 | | 1. Run it from '''Menu''' --> '''Installations''' --> TRK (it may be different on your phone). |
294 | | 1. When it asks to switch on Blueetooth, click '''No'''. We use USB cable for this session. |
295 | | 1. The TRK window will appear. We can ignore the error message for now: |
296 | | |
297 | | [[Image(DevelopingSymbianAppWithCarbide:trk_r_welcome.JPG)]] |
298 | | |
299 | | 1. Select '''Options''' --> '''Settings''' menu. |
300 | | 1. Change the '''Connection''' to USB, and leave all settings unchanged. (Note: You may not get the baud rate settings input): |
301 | | |
302 | | [[Image(DevelopingSymbianAppWithCarbide:trk_p_usb.JPG)]] |
303 | | |
304 | | 1. Click '''Back''' to get back to TRK main window. |
305 | | 1. Now select '''Options''' --> '''Connect''' from the menu. |
306 | | 1. TRK main window should display '''Status: Connected''' now. There might less info on newer version of TRK, but as long as it says Connected, you're good to go: |
307 | | |
308 | | [[Image(DevelopingSymbianAppWithCarbide:trk_p_connected.JPG)]] |
309 | | |
310 | | Leave TRK running on the phone for the duration of this tutorial, and move on back to Carbide to set the connection up. |
| 118 | === Installing TRK Application on the Phone === |
| 119 | |
| 120 | TRK provides the debugging service from the device side. |
| 121 | 1. On the menu, select '''Help''' --> '''On-device connection''' to open ''Connection Setting'' dialog. |
| 122 | 1. On the ''Setup Connection'' tab, configure the connection type to ''USB'' and select the ''Serial Port'' to the target device (when the phone device is properly connected, the name should be shown in the drop down menu). |
| 123 | 1. On the ''Install Remote Agent'' tab, there will be list/tree of TRK version for each Symbian OS version, select the TRK version appropriately according to the SDK/OS version used by the target phone/device and click ''Install'' button, and follow the installation instruction on the device. Just for reference, here is a map of SDK name and its OS version target: |
| 124 | ||'''SDK'''||'''OS target'''|| |
| 125 | ||S60 3rd Plain/MR||3.0.0|| |
| 126 | ||S60 3rd FP1||3.1.0|| |
| 127 | ||S60 3rd FP2||3.2.0|| |
| 128 | ||S60 5th||5.0.0|| |
| 129 | |
| 130 | === Running TRK Application on the Device/Phone === |
| 131 | |
| 132 | 1. Run it from '''Menu''' --> '''Installations'''/'''Applications''' --> '''TRK'''. |
| 133 | 1. When it asks to switch on Bluetooth, click '''No'''. Note, you can re-configure it later to use Bluetooth if you want from the ''Option'' --> ''Settings'' menu in the TRK application. |
| 134 | 1. The TRK window will appear and there should be line as: |
| 135 | {{{ |
| 136 | Status: Connected |
| 137 | }}} |
333 | | Because we haven't setup a debug configuration, if you start debugging, Carbide C++ will offer you to setup one. |
334 | | |
335 | | On the ''Symbian Project Navigator'' select bld.inf, and press debug on the toolbar (the picture of the bug...): |
336 | | |
337 | | [[Image(new-launch-configuration.png)]] |
338 | | |
339 | | You will get the Launch Configuration Wizard. Click '''Next'''. You'll get : |
340 | | |
341 | | [[Image(executable-selection.png)]] |
342 | | |
343 | | Executable should already be set to {{{symbian_ua.exe}}}, so just click '''Next'''. You'll get: |
344 | | |
345 | | [[Image(trk-conn-settings.png)]] |
346 | | |
347 | | This should be defaulted to {{{connection 1}}} which we have setup earlier. Click '''Next'''. You'll get: |
348 | | |
349 | | [[Image(trk-sis-selection.png)]] |
350 | | |
351 | | Verify that the sisx is {{{symbian_ua.sisx}}} which we already tested beforehand. Click '''Next''' then '''Finish'''. You should immediately begin debugging. |
352 | | |
353 | | Carbide now may rebuild the project (you may take a peek on what it's doing by looking at '''Console''' tab). Once it's done, Carbide will switch to ''Debug Perspective'' and the SIS file will be downloaded to the phone and this window will appear briefly: |
354 | | |
355 | | [[Image(DevelopingSymbianAppWithCarbide:debug_download.JPG)]] |
356 | | |
357 | | When this window dissappear, you should see the application runs on the phone: |
358 | | |
359 | | [[Image(DevelopingSymbianAppWithCarbide:symbian_ua.JPG)]] |
360 | | |
361 | | You may make calls, receive calls, do presence stuffs, etc. Full debugging should also be possible; you may set breakpoints, step into functions, etc. |
362 | | |
| 151 | 1. Setup a debug configuration by selecting '''Run''' --> '''Debug Configurations..''' from the Carbide's main menu. |
| 152 | 1. Select ''Symbian OS Application TRK'' from the left pane list and click ''New launch configuration'' icon on the top left. |
| 153 | 1. The new debug configuration is created and appears on the left pane list, now we need adjust the setting: |
| 154 | - '''Remote process to launch''' should be set to {{{pjsua.exe}}}, e.g: on Windows it should be {{{C:\sys\bin\pjsua.exe}}} |
| 155 | - Setup the connection properly and optionally run connection test again by clicking '''Edit''' button and activate ''Test Connection'' tab. |
| 156 | - On the ''Installation'' tab, verify that the installer file ({{{.sisx}}}) is set to {{{pjsua.sisx}}} which we already generated beforehand. |
| 157 | 1. Click '''Debug''' button to start the debugging right away. |
| 158 | - Carbide now may rebuild the project (you may take a peek on what it's doing by looking at ''Console'' tab). Once it's done, Carbide will switch to ''Debug Perspective'' and the {{{.sisx}}} file will be downloaded to the phone. |
| 159 | - It may take some time to see the {{{pjsua}}} application started on the device. The '''pjsua''' application is ready when 'PJSUA' logo+text and 'Telnet to IP:port' appears on the screen. |
| 160 | - Note that the network connection (usually via WiFi) should have been setup properly on the device. |
| 161 | 1. Start a telnet client and connect to the IP address and port as shown in the ''pjsua'' application screen. You may make calls, receive calls, do presence stuffs, etc from the telnet Command Line Interface session. Full debugging should also be possible; you may set breakpoints, step into functions, etc. |