diff --git a/packages/tizen_app_control/example/lib/main.dart b/packages/tizen_app_control/example/lib/main.dart index ee06f16cd..2b7a1fa39 100644 --- a/packages/tizen_app_control/example/lib/main.dart +++ b/packages/tizen_app_control/example/lib/main.dart @@ -89,14 +89,11 @@ class _MyAppState extends State { _localPort?.unregister(); } - Future _sendSms() async { + Future _openWeb() async { final AppControl request = AppControl( - operation: 'http://tizen.org/appcontrol/operation/share_text', - uri: 'sms:', + operation: 'http://tizen.org/appcontrol/operation/view', + uri: 'https://flutter.dev/', launchMode: LaunchMode.group, - extraData: { - 'http://tizen.org/appcontrol/data/text': 'Some text', - }, ); final List matches = await request.getMatchedAppIds(); if (matches.isEmpty) { @@ -108,42 +105,6 @@ class _MyAppState extends State { await request.sendLaunchRequest(); } - Future _pickImage() async { - final AppControl request = AppControl( - operation: 'http://tizen.org/appcontrol/operation/pick', - mime: 'image/*', - launchMode: LaunchMode.group, - ); - final List matches = await request.getMatchedAppIds(); - if (matches.isEmpty) { - _messengerKey.currentState!.showSnackBar( - const SnackBar(content: Text('No application found.')), - ); - return; - } - await request.sendLaunchRequest( - replyCallback: ( - AppControl request, - AppControl reply, - AppControlReplyResult result, - ) { - const String kAppControlDataSelected = - 'http://tizen.org/appcontrol/data/selected'; - String? imagePath; - if (result == AppControlReplyResult.succeeded && - reply.extraData.containsKey(kAppControlDataSelected)) { - final List imagePaths = - (reply.extraData[kAppControlDataSelected] as List) - .cast(); - imagePath = imagePaths[0]; - } - _messengerKey.currentState!.showSnackBar( - SnackBar(content: Text(imagePath ?? 'No image selected.')), - ); - }, - ); - } - Future _launchService() async { final AppControl request = AppControl(appId: _kServiceAppId); await request.sendLaunchRequest( @@ -184,13 +145,8 @@ class _MyAppState extends State { mainAxisSize: MainAxisSize.min, children: [ ElevatedButton( - onPressed: _sendSms, - child: const Text('Send SMS'), - ), - const SizedBox(height: 10), - ElevatedButton( - onPressed: _pickImage, - child: const Text('Pick image'), + onPressed: _openWeb, + child: const Text('Open web page(https://flutter.dev/).'), ), const SizedBox(height: 10), if (_isServiceStarted) diff --git a/packages/tizen_app_control/example/tizen/service/.exportMap b/packages/tizen_app_control/example/tizen/service/.exportMap deleted file mode 100644 index 3b97a4f3b..000000000 --- a/packages/tizen_app_control/example/tizen/service/.exportMap +++ /dev/null @@ -1,5 +0,0 @@ -{ - global: main; - _IO_*; - local: *; -}; diff --git a/packages/tizen_app_control/example/tizen/service/.gitignore b/packages/tizen_app_control/example/tizen/service/.gitignore index 660cb0f67..750f3af1b 100644 --- a/packages/tizen_app_control/example/tizen/service/.gitignore +++ b/packages/tizen_app_control/example/tizen/service/.gitignore @@ -1,8 +1,5 @@ -lib/*.so -res/flutter_assets/ -res/icudtl.dat -.cproject -.sign -crash-info/ -Debug/ -Release/ +flutter/ +.vs/ +*.user +bin/ +obj/ diff --git a/packages/tizen_app_control/example/tizen/service/App.cs b/packages/tizen_app_control/example/tizen/service/App.cs new file mode 100644 index 000000000..98aa9f128 --- /dev/null +++ b/packages/tizen_app_control/example/tizen/service/App.cs @@ -0,0 +1,21 @@ +using Tizen.Flutter.Embedding; + +namespace Runner +{ + public class App : FlutterServiceApplication + { + protected override void OnCreate() + { + base.OnCreate(); + + GeneratedPluginRegistrant.RegisterPlugins(this); + } + + static void Main(string[] args) + { + var app = new App(); + app.DartEntrypoint = "serviceMain"; + app.Run(args); + } + } +} diff --git a/packages/tizen_app_control/example/tizen/service/RunnerService.csproj b/packages/tizen_app_control/example/tizen/service/RunnerService.csproj new file mode 100644 index 000000000..365cec128 --- /dev/null +++ b/packages/tizen_app_control/example/tizen/service/RunnerService.csproj @@ -0,0 +1,12 @@ + + + + Exe + tizen40 + + + + + + + diff --git a/packages/tizen_app_control/example/tizen/service/inc/runner.h b/packages/tizen_app_control/example/tizen/service/inc/runner.h deleted file mode 100644 index a2d45b6ee..000000000 --- a/packages/tizen_app_control/example/tizen/service/inc/runner.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __RUNNER_H__ -#define __RUNNER_H__ - -#include - -#endif /* __RUNNER_H__ */ diff --git a/packages/tizen_app_control/example/tizen/service/project_def.prop b/packages/tizen_app_control/example/tizen/service/project_def.prop deleted file mode 100644 index 6b1fd7545..000000000 --- a/packages/tizen_app_control/example/tizen/service/project_def.prop +++ /dev/null @@ -1,25 +0,0 @@ -# See https://docs.tizen.org/application/tizen-studio/native-tools/project-conversion -# for details. - -APPNAME = runner_service -type = app -profile = common-5.5 - -# Source files -USER_SRCS += src/runner.cc - -# User defines -USER_DEFS = -USER_UNDEFS = -USER_CPP_DEFS = TIZEN_DEPRECATION DEPRECATION_WARNING -USER_CPP_UNDEFS = - -# User includes -USER_INC_DIRS = inc ../ui/flutter src -USER_INC_FILES = -USER_CPP_INC_FILES = - -# Linker options -USER_LIB_DIRS = lib -USER_LIBS = -USER_LFLAGS = -Wl,-E diff --git a/packages/tizen_app_control/example/tizen/service/shared/res/ic_launcher.png b/packages/tizen_app_control/example/tizen/service/shared/res/ic_launcher.png deleted file mode 100644 index 4d6372eeb..000000000 Binary files a/packages/tizen_app_control/example/tizen/service/shared/res/ic_launcher.png and /dev/null differ diff --git a/packages/tizen_app_control/example/tizen/service/src/runner.cc b/packages/tizen_app_control/example/tizen/service/src/runner.cc deleted file mode 100644 index b344cf215..000000000 --- a/packages/tizen_app_control/example/tizen/service/src/runner.cc +++ /dev/null @@ -1,19 +0,0 @@ -#include "runner.h" - -#include "generated_plugin_registrant.h" - -class App : public FlutterServiceApp { - public: - bool OnCreate() { - if (FlutterServiceApp::OnCreate()) { - RegisterPlugins(this); - } - return IsRunning(); - } -}; - -int main(int argc, char *argv[]) { - App app; - app.SetDartEntrypoint("serviceMain"); - return app.Run(argc, argv); -} diff --git a/packages/tizen_app_control/example/tizen/service/tizen-manifest.xml b/packages/tizen_app_control/example/tizen/service/tizen-manifest.xml index 1f09d03ac..b486a2bb9 100644 --- a/packages/tizen_app_control/example/tizen/service/tizen-manifest.xml +++ b/packages/tizen_app_control/example/tizen/service/tizen-manifest.xml @@ -1,10 +1,11 @@ - - + + ic_launcher.png + diff --git a/packages/tizen_app_control/example/tizen/ui/.exportMap b/packages/tizen_app_control/example/tizen/ui/.exportMap deleted file mode 100644 index 3b97a4f3b..000000000 --- a/packages/tizen_app_control/example/tizen/ui/.exportMap +++ /dev/null @@ -1,5 +0,0 @@ -{ - global: main; - _IO_*; - local: *; -}; diff --git a/packages/tizen_app_control/example/tizen/ui/.gitignore b/packages/tizen_app_control/example/tizen/ui/.gitignore index 2ce470fa9..750f3af1b 100644 --- a/packages/tizen_app_control/example/tizen/ui/.gitignore +++ b/packages/tizen_app_control/example/tizen/ui/.gitignore @@ -1,9 +1,5 @@ flutter/ -lib/*.so -res/flutter_assets/ -res/icudtl.dat -.cproject -.sign -crash-info/ -Debug/ -Release/ +.vs/ +*.user +bin/ +obj/ diff --git a/packages/tizen_app_control/example/tizen/ui/App.cs b/packages/tizen_app_control/example/tizen/ui/App.cs new file mode 100644 index 000000000..6dd4a6356 --- /dev/null +++ b/packages/tizen_app_control/example/tizen/ui/App.cs @@ -0,0 +1,20 @@ +using Tizen.Flutter.Embedding; + +namespace Runner +{ + public class App : FlutterApplication + { + protected override void OnCreate() + { + base.OnCreate(); + + GeneratedPluginRegistrant.RegisterPlugins(this); + } + + static void Main(string[] args) + { + var app = new App(); + app.Run(args); + } + } +} diff --git a/packages/tizen_app_control/example/tizen/ui/Runner.csproj b/packages/tizen_app_control/example/tizen/ui/Runner.csproj new file mode 100644 index 000000000..f4e369d0c --- /dev/null +++ b/packages/tizen_app_control/example/tizen/ui/Runner.csproj @@ -0,0 +1,19 @@ + + + + Exe + tizen40 + + + + + + + + + + %(RecursiveDir) + + + + diff --git a/packages/tizen_app_control/example/tizen/ui/inc/runner.h b/packages/tizen_app_control/example/tizen/ui/inc/runner.h deleted file mode 100644 index a2d45b6ee..000000000 --- a/packages/tizen_app_control/example/tizen/ui/inc/runner.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __RUNNER_H__ -#define __RUNNER_H__ - -#include - -#endif /* __RUNNER_H__ */ diff --git a/packages/tizen_app_control/example/tizen/ui/project_def.prop b/packages/tizen_app_control/example/tizen/ui/project_def.prop deleted file mode 100644 index 51eed84e2..000000000 --- a/packages/tizen_app_control/example/tizen/ui/project_def.prop +++ /dev/null @@ -1,25 +0,0 @@ -# See https://docs.tizen.org/application/tizen-studio/native-tools/project-conversion -# for details. - -APPNAME = runner -type = app -profile = common-5.5 - -# Source files -USER_SRCS += src/runner.cc - -# User defines -USER_DEFS = -USER_UNDEFS = -USER_CPP_DEFS = TIZEN_DEPRECATION DEPRECATION_WARNING -USER_CPP_UNDEFS = - -# User includes -USER_INC_DIRS = inc flutter src -USER_INC_FILES = -USER_CPP_INC_FILES = - -# Linker options -USER_LIB_DIRS = lib -USER_LIBS = -USER_LFLAGS = -Wl,-E diff --git a/packages/tizen_app_control/example/tizen/ui/src/runner.cc b/packages/tizen_app_control/example/tizen/ui/src/runner.cc deleted file mode 100644 index 74d25472a..000000000 --- a/packages/tizen_app_control/example/tizen/ui/src/runner.cc +++ /dev/null @@ -1,18 +0,0 @@ -#include "runner.h" - -#include "generated_plugin_registrant.h" - -class App : public FlutterApp { - public: - bool OnCreate() { - if (FlutterApp::OnCreate()) { - RegisterPlugins(this); - } - return IsRunning(); - } -}; - -int main(int argc, char *argv[]) { - App app; - return app.Run(argc, argv); -} diff --git a/packages/tizen_app_control/example/tizen/ui/tizen-manifest.xml b/packages/tizen_app_control/example/tizen/ui/tizen-manifest.xml index 9dd571b41..7488cabf1 100644 --- a/packages/tizen_app_control/example/tizen/ui/tizen-manifest.xml +++ b/packages/tizen_app_control/example/tizen/ui/tizen-manifest.xml @@ -1,9 +1,10 @@ - - + + ic_launcher.png + http://tizen.org/privilege/appmanager.launch