For passing arguments, maybe you can check application control in 
https://developer.tizen.org/dev-guide/2.2.1/org.tizen.native.appprogramming/html/guide/app/delivering_launch_arguments.htm
Sample code like 
https://developer.tizen.org/dev-guide/2.2.1/org.tizen.native.appprogramming/html/guide/app/appcontrol_call.htm,
You can check how the parameter like "tel:+919867123456" is handled in source 
code of Call app - https://review.tizen.org/git/?p=apps/osp/Call.git;a=summary



From: application-dev-boun...@lists.tizen.org 
[mailto:application-dev-boun...@lists.tizen.org] On Behalf Of durgaprasad 
alaparthi
Sent: Monday, November 18, 2013 7:57 PM
To: application-dev@lists.tizen.org
Subject: [Tizen Application-dev] How to pass arguments to tizen native 
application?


I am trying to create a tizen native application which can launch another 
application. I wanted to create an application in such a way that I can give 
application name as a parameter to the application I am going to develop.

Following are the steps I have followed to understand how to pass command line 
arguments to the application and how to process the arguments in application:

  1.  Added log statement to check on how many arguments are passed to my 
application

for (int i = 0; i < argc; i++)

{

pArgs->Add(*(new String(pArgv[i])));

AppLog("index : %d, argument : %s", i, pArgv[i]);

}

  1.  Launched the application using launch_app in sdb -e shell

  *   launch_app $hello_world_application (without arguments).

It is observed that the count of the arguments that are passed to osp_main are 
6.

Logs :

11-14 20:11:37.411 : INFO / tizenSrvAppProject2 ( 3904 : 3904 ) : int 
OspMain(int, char **)(24) > Application started, arg count : 6
11-14 20:11:37.411 : INFO / tizenSrvAppProject2 ( 3904 : 3904 ) : int 
OspMain(int, char **)(30) > index : 0, argument : 
/opt/apps/Xbfv5mXrHt/bin/tizenSrvAppProject2
11-14 20:11:37.421 : INFO / tizenSrvAppProject2 ( 3904 : 3904 ) : int 
OspMain(int, char **)(30) > index : 1, argument : `zaybxcwdveuftgsh`
11-14 20:11:37.421 : INFO / tizenSrvAppProject2 ( 3904 : 3904 ) : int 
OspMain(int, char **)(30) > index : 2, argument : __AUL_STARTTIME__
11-14 20:11:37.421 : INFO / tizenSrvAppProject2 ( 3904 : 3904 ) : int 
OspMain(int, char **)(30) > index : 3, argument : 
NAAAAAEEAAASAAAAX19BVUxfU1RBUlRUSU1FX18AEgAAADEzODQ0Mjc0OTYvNzU2OTM1AA==
11-14 20:11:37.421 : INFO / tizenSrvAppProject2 ( 3904 : 3904 ) : int 
OspMain(int, char **)(30) > index : 4, argument : __AUL_CALLER_PID__
11-14 20:11:37.421 : INFO / tizenSrvAppProject2 ( 3904 : 3904 ) : int 
OspMain(int, char **)(30) > index : 5, argument : 
KAAAAAEEAAATAAAAX19BVUxfQ0FMTEVSX1BJRF9fAAUAAAAzOTAzAA==
11-14 20:11:38.231 : INFO / tizenSrvAppProject2 ( 3904 : 3904 ) : virtual bool 
tizenSrvAppProject2App::OnAppInitializing(Tizen::App::AppRegistry &)(50) > 
Timer construct status : [E_SUCCESS]

  *   launch_app Xbfv5mXrHt.tizenSrvAppProject2 "test1"

It is observed that the count of the arguments that are passed to osp_main are 
6.

  *   launch_app Xbfv5mXrHt.tizenSrvAppProject2 "test1" "test2"

It is observed that the count of the arguments that are passed to osp_main are 
8.

also it is observed that the last argument that is passed to the application is 
not taken into consideration by the application.

Logs:

11-14 20:14:34.241 : INFO / tizenSrvAppProject2 ( 3926 : 3926 ) : int 
OspMain(int, char **)(24) > Application started, arg count : 8
11-14 20:14:34.281 : INFO / tizenSrvAppProject2 ( 3926 : 3926 ) : int 
OspMain(int, char **)(30) > index : 0, argument : 
/opt/apps/Xbfv5mXrHt/bin/tizenSrvAppProject2
11-14 20:14:34.291 : INFO / tizenSrvAppProject2 ( 3926 : 3926 ) : int 
OspMain(int, char **)(30) > index : 1, argument : `zaybxcwdveuftgsh`
11-14 20:14:34.291 : INFO / tizenSrvAppProject2 ( 3926 : 3926 ) : int 
OspMain(int, char **)(30) > index : 2, argument : test1
11-14 20:14:34.291 : INFO / tizenSrvAppProject2 ( 3926 : 3926 ) : int 
OspMain(int, char **)(30) > index : 3, argument : 
HAAAAAEEAAAGAAAAdGVzdDEABgAAAHRlc3QyAA==
11-14 20:14:34.291 : INFO / tizenSrvAppProject2 ( 3926 : 3926 ) : int 
OspMain(int, char **)(30) > index : 4, argument : __AUL_STARTTIME__
11-14 20:14:34.291 : INFO / tizenSrvAppProject2 ( 3926 : 3926 ) : int 
OspMain(int, char **)(30) > index : 5, argument : 
MwAAAAEEAAASAAAAX19BVUxfU1RBUlRUSU1FX18AEQAAADEzODQ0Mjc2NzQvOTE0MjQA
11-14 20:14:34.291 : INFO / tizenSrvAppProject2 ( 3926 : 3926 ) : int 
OspMain(int, char **)(30) > index : 6, argument : __AUL_CALLER_PID__
11-14 20:14:34.291 : INFO / tizenSrvAppProject2 ( 3926 : 3926 ) : int 
OspMain(int, char **)(30) > index : 7, argument : 
KAAAAAEEAAATAAAAX19BVUxfQ0FMTEVSX1BJRF9fAAUAAAAzOTI1AA==
11-14 20:14:34.681 : INFO / tizenSrvAppProject2 ( 3926 : 3926 ) : virtual bool 
tizenSrvAppProject2App::OnAppInitializing(Tizen::App::AppRegistry &)(50) > 
Timer construct status : [E_SUCCESS]



Kindly provide me some pointers on:

How are arguments passed to osp_main?

How to make use of the arguments passed to the application by the application?



Thanks in Advance


Language English
_______________________________________________
Application-dev mailing list
Application-dev@lists.tizen.org
https://lists.tizen.org/listinfo/application-dev

Reply via email to