Not able to launch music application for picking music files.

Technical | Application Development | Anand R | Just now | 2 Replies | 1,387 Views

*

Anand R

  • *
  • 15
  • 375 Points
  • I Love Tizen
Not able to launch music application for picking music files.
« On:November 20, 2015, 10:49:48 AM »
Hi,
I am trying to port my app from Tizen 2.3 to 2.4. I am trying to launch music application to import some mp3 files but it is throwing the error "APP_CONTROL_ERROR_APP_NOT_FOUND". Below is the code snippet.

int ret = APP_CONTROL_ERROR_NONE;
   app_control_h svc_handle = NULL;

   ret = app_control_create(&svc_handle);
   if (ret != APP_CONTROL_ERROR_NONE)
         dlog_print(DLOG_ERROR, LOG_TAG, "app_control_create Error ret value = %d", ret);

   ret = app_control_set_operation(svc_handle, APP_CONTROL_OPERATION_PICK);
   if (ret != APP_CONTROL_ERROR_NONE)
         dlog_print(DLOG_ERROR, LOG_TAG, "app_control_set_operation Error ret value = %d", ret);

   ret = app_control_set_mime(svc_handle, "audio/*");
   if (ret != APP_CONTROL_ERROR_NONE)
         dlog_print(DLOG_ERROR, LOG_TAG, "app_control_set_mime Error ret value = %d", ret);

   ret = app_control_add_extra_data(svc_handle, APP_CONTROL_DATA_SELECTION_MODE, "multiple");
   if (ret != APP_CONTROL_ERROR_NONE)
         dlog_print(DLOG_ERROR, LOG_TAG, "app_control_add_extra_data Error ret value = %d", ret);

   app_control_set_launch_mode(svc_handle, APP_CONTROL_LAUNCH_MODE_GROUP);

   char max_count[10] = { 0, };
   snprintf(max_count, sizeof(max_count), "%d", 100);

   ret = app_control_add_extra_data(svc_handle, "max-count", max_count); /* At a time only 100 images can be attached */
   if (ret != APP_CONTROL_ERROR_NONE)
         dlog_print(DLOG_ERROR, LOG_TAG, "app_control_add_extra_data Error ret value = %d", ret);

   ret = app_control_send_launch_request(svc_handle, _launch_music_app_result_cb, ad);
   if (ret != APP_CONTROL_ERROR_NONE)
         dlog_print(DLOG_ERROR, LOG_TAG, "app_control_send_launch_request Error ret value = %d", ret);


I have tried commenting out app_control_set_launch_mode, app_control_add_extra_data apis but still its not working. When i change the mime type from "audio/*" to "image/*" It launches image viewer.
Note: The above code was working in 2.3 with mime type "audio/mpeg"



*

psrinivas5

  • *
  • 10
  • 225 Points
  • I Love Tizen
Re: Not able to launch music application for picking music files.
« Reply #1 On:December 09, 2015, 10:25:13 AM »
Hello,
well, On Tizen 2.4 implicit launching of music app control for selecting music files is not supported.
To fix your issue, please call following API after setting mime type:
ret = app_control_set_app_id(svc_handle, "com.samsung.music-chooser-lite");

Kindly let me know if it helps or not :)

*

Anand R

  • *
  • 15
  • 375 Points
  • I Love Tizen
Re: Not able to launch music application for picking music files.
« Reply #2 On:December 14, 2015, 05:40:36 PM »
Yes. It works. Thanks for the info. Although i believe that implicit launching should be supported.

 


Facebook Comments




anything